Emails stop sending (Temporary failure in name resolution)

Hello,

I updated in admin today to 189b4c4992 and and since then the emails stop sending. I use Mailgun EU.

I have got this error in /logs Job exception: getaddrinfo: Temporary failure in name resolution
And this in Sidekiq Jobs::HandledExceptionWrapper: Wrapped SocketError: getaddrinfo: Temporary failure in name resolution

Thank you for any help to fix this! :slightly_smiling_face:

Backtrace

Job exception: getaddrinfo: Temporary failure in name resolution

/usr/local/lib/ruby/2.7.0/net/smtp.rb:539:in `initialize'
/usr/local/lib/ruby/2.7.0/net/smtp.rb:539:in `open'
/usr/local/lib/ruby/2.7.0/net/smtp.rb:539:in `tcp_socket'
/usr/local/lib/ruby/2.7.0/net/smtp.rb:549:in `block in do_start'
/usr/local/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
/usr/local/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
/usr/local/lib/ruby/2.7.0/net/smtp.rb:548:in `do_start'
/usr/local/lib/ruby/2.7.0/net/smtp.rb:518:in `start'
/var/www/discourse/vendor/bundle/ruby/2.7.0/bundler/gems/mail-5b700fc95ee6/lib/mail/network/delivery_methods/smtp.rb:109:in `start_smtp_session'
/var/www/discourse/vendor/bundle/ruby/2.7.0/bundler/gems/mail-5b700fc95ee6/lib/mail/network/delivery_methods/smtp.rb:100:in `deliver!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/bundler/gems/mail-5b700fc95ee6/lib/mail/message.rb:2141:in `do_delivery'
/var/www/discourse/vendor/bundle/ruby/2.7.0/bundler/gems/mail-5b700fc95ee6/lib/mail/message.rb:253:in `block in deliver'
actionmailer-6.1.4.1/lib/action_mailer/base.rb:559:in `block in deliver_mail'
activesupport-6.1.4.1/lib/active_support/notifications.rb:203:in `block in instrument'
activesupport-6.1.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport-6.1.4.1/lib/active_support/notifications.rb:203:in `instrument'
actionmailer-6.1.4.1/lib/action_mailer/base.rb:557:in `deliver_mail'
/var/www/discourse/vendor/bundle/ruby/2.7.0/bundler/gems/mail-5b700fc95ee6/lib/mail/message.rb:253:in `deliver'
actionmailer-6.1.4.1/lib/action_mailer/message_delivery.rb:119:in `block in deliver_now'
actionmailer-6.1.4.1/lib/action_mailer/rescuable.rb:17:in `handle_exceptions'
actionmailer-6.1.4.1/lib/action_mailer/message_delivery.rb:118:in `deliver_now'
/var/www/discourse/lib/email/sender.rb:267:in `send'
/var/www/discourse/app/jobs/regular/user_email.rb:83:in `send_user_email'
/var/www/discourse/app/jobs/regular/user_email.rb:38:in `execute'
/var/www/discourse/app/jobs/base.rb:232:in `block (2 levels) in perform'
rails_multisite-3.0.0/lib/rails_multisite/connection_management.rb:80:in `with_connection'
/var/www/discourse/app/jobs/base.rb:221:in `block in perform'
/var/www/discourse/app/jobs/base.rb:217:in `each'
/var/www/discourse/app/jobs/base.rb:217:in `perform'
sidekiq-6.2.2/lib/sidekiq/processor.rb:196:in `execute_job'
sidekiq-6.2.2/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
sidekiq-6.2.2/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
/var/www/discourse/lib/sidekiq/pausable.rb:138:in `call'
sidekiq-6.2.2/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
sidekiq-6.2.2/lib/sidekiq/middleware/chain.rb:143:in `invoke'
sidekiq-6.2.2/lib/sidekiq/processor.rb:163:in `block in process'
sidekiq-6.2.2/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
sidekiq-6.2.2/lib/sidekiq/job_retry.rb:112:in `local'
sidekiq-6.2.2/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
sidekiq-6.2.2/lib/sidekiq.rb:38:in `block in <module:Sidekiq>'
sidekiq-6.2.2/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
sidekiq-6.2.2/lib/sidekiq/processor.rb:257:in `stats'
sidekiq-6.2.2/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
sidekiq-6.2.2/lib/sidekiq/job_logger.rb:13:in `call'
sidekiq-6.2.2/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
sidekiq-6.2.2/lib/sidekiq/job_retry.rb:79:in `global'
sidekiq-6.2.2/lib/sidekiq/processor.rb:124:in `block in dispatch'
sidekiq-6.2.2/lib/sidekiq/logger.rb:11:in `with'
sidekiq-6.2.2/lib/sidekiq/job_logger.rb:33:in `prepare'
sidekiq-6.2.2/lib/sidekiq/processor.rb:123:in `dispatch'
sidekiq-6.2.2/lib/sidekiq/processor.rb:162:in `process'
sidekiq-6.2.2/lib/sidekiq/processor.rb:78:in `process_one'
sidekiq-6.2.2/lib/sidekiq/processor.rb:68:in `run'
sidekiq-6.2.2/lib/sidekiq/util.rb:43:in `watchdog'
sidekiq-6.2.2/lib/sidekiq/util.rb:52:in `block in safe_thread'
1 Like

Is your Discourse instance hosted with Linode? (Possibly Atlanta, specifically) I had this issue within the last hour or two with Linode’s default DNS server returning SERVFAIL when requesting any mailgun.org domain.

I’m unclear as to why that was the case but I switched to Google DNS temporarily and after a while, (20-30 minutes, I think) Linode’s DNS started resolving mailgun.org domains again.

2 Likes

Hi Simon,
Thanks for the quick reply. :slightly_smiling_face:
I hosting with Vultr Frankfurt. Never happened this before. Only when Mailgun crashed but I checked it and seems to All Systems Operational.

1 Like

I wonder if there is a DNS problem with the provider Mailgun use. DNS caching can be kinda funky so one name server might get hit by a problem almost immediately while another never notices it, or at least doesn’t propagate it.

Google’s public DNS (8.8.8.8) appears to still be resolving it correctly so switching to that temporarily or adding it as a permanent fallback on your server should get your emails sending again.

2 Likes

Thank you Simon! :slightly_smiling_face: It works perfect! :heart:

1 Like