Rails Mailer “Net::OpenTimeout: execution expired” Exception on production server only

前端 未结 8 1428
南方客
南方客 2020-12-05 04:19

I am using Ruby MRI 2.0.0 and Rails 3.2.12 on a Ubuntu 12.04 TLS VPS and attempting to setup email notifications in my app. It was working fine a few days ago, but n

8条回答
  •  忘掉有多难
    2020-12-05 04:50

    Here is also a temporary fix that may come in handy while waiting for your hosting provider to fix the issue:

    Add the following lines to /etc/sysctl.conf:

    #disable ipv6
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    

    Now reload the sysctl service using the following command:

    sudo sysctl -p
    

    Now the apps are able to send emails again.

    You can always know if IPv6 is enabled calling

    cat /proc/sys/net/ipv6/conf/all/disable_ipv6
    

    from terminal. Two possible answers: 0 => IPv6 is enabled; 1 => IPv6 disabled.

    From: https://serverfault.com/questions/512744/timeout-error-in-all-my-apps-for-every-call-to-smtp-servers

提交回复
热议问题