Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mandrill SMTP giving EOFError: end of file reached errors

We use Mandrill to send transactional email from our Rails application (on Heroku).

# config/environments/production.rb
config.action_mailer.delivery_method = :smtp  
config.action_mailer.smtp_settings = {
  :address   => "smtp.mandrillapp.com",
  :port      => 587,
  :enable_starttls_auto => true,
  :user_name => ENV['MANDRILL_USERNAME'],
  :password  => ENV['MANDRILL_PASSWORD'],
  :authentication => 'login',
  :domain => ENV['URL_OPTIONS_HOST'],
} 

When we send email, we use ActiveJob with deliver_later, to send email in the background with Resque.

Occasionally, perhaps once every 2-3 days, we get the following error:

EOFError: end of file reached
File "/app/bin/rake" line 8 in <main>
....
"queue_name": "production_mailers", "job_class": "ActionMailer::DeliveryJob"

I think this caused by an SMTP timeout issue from Mandrill.

Does anyone know how to avoid this error? Is it best to retry the failed email, and if so how can this be achieved with ActiveJob and Resque?

like image 395
rlarcombe Avatar asked Sep 25 '22 12:09

rlarcombe


1 Answers

I'm also seeing this problem. It does not happen with every send and most of my sends are done from resque jobs. I wonder if this is a transient problem on mandrill's side or a network problem.

like image 85
kellyfelkins Avatar answered Oct 07 '22 15:10

kellyfelkins