ActionMailer EOFError (sometimes)


#1

I’m having problems sending emails sometimes using ActionMailer. Looks
like some emails are never sent because something breaks when sending
it. It is a small quantity but can’t even have one drop. Browsing
through the list I saw that one person had the same error as I did but
in his case he couldn’t send any emails and in the end he needed no
authentication at all. I can send most of them but some will not get
sent. Does anybody know what situations will make this error appear?
Slow or non-responsive connection to the mail server? The user hitting
ESC before the page finishes? Here is the full trace for one:

EOFError (End of file reached):
/usr/local/lib/ruby/1.8/net/protocol.rb:197:in sysread' /usr/local/lib/ruby/1.8/net/protocol.rb:197:inrbuf_fill’
/usr/local/lib/ruby/1.8/net/protocol.rb:196:in timeout' /usr/local/lib/ruby/1.8/timeout.rb:55:intimeout’
/usr/local/lib/ruby/1.8/net/protocol.rb:196:in rbuf_fill' /usr/local/lib/ruby/1.8/net/protocol.rb:160:inreaduntil’
/usr/local/lib/ruby/1.8/net/protocol.rb:171:in readline' /usr/local/lib/ruby/1.8/net/smtp.rb:664:inrecv_response’
/usr/local/lib/ruby/1.8/net/smtp.rb:651:in getok' /usr/local/lib/ruby/1.8/net/smtp.rb:649:incritical’
/usr/local/lib/ruby/1.8/net/smtp.rb:649:in getok' /usr/local/lib/ruby/1.8/net/smtp.rb:639:inquit’
/usr/local/lib/ruby/1.8/net/smtp.rb:426:in do_finish' /usr/local/lib/ruby/1.8/net/smtp.rb:381:instart’
/usr/local/lib/ruby/1.8/net/smtp.rb:316:in `start’

/usr/local/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:436:in
`perform_delivery_smtp’

/usr/local/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:327:in
`send’

/usr/local/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:327:in
`deliver!’

/usr/local/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:223:in
method_missing' /app/models/sample_cart.rb:123:inprocess’
/app/controllers/cart_controller.rb:69:in `ajax_order’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
`send’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
`perform_action_without_filters’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/filters.rb:332:in
`perform_action_without_benchmark’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
`measure’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:82:in
`perform_action’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
`send’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
`process_without_session_management_support’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session_management.rb:116:in
`process’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in
`dispatch’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:141:in
`process_request’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in
`process!’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
each_cgi' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:ineach’
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
`process!’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:in
`process!’
/public/dispatch.fcgi:24

Any help would be appreciated,


Adrian M.
HyperX Inc.
Mobile: 801.815.1870
Office: 801.566.0670
removed_email_address@domain.invalid

9000 S. 45 W.
Sandy, UT 84070


#2

Hello Adrian

I’m having problems sending emails sometimes using ActionMailer. Looks
like some emails are never sent because something breaks when sending
it. It is a small quantity but can’t even have one drop.
Does anybody know what situations will make this error appear?
EOFError (End of file reached):
/usr/local/lib/ruby/1.8/net/protocol.rb:197:in `sysread’

Lately I came across very same error. The list was no help to me,
because I knew my server required authentication. So case similar to
yours, but I couldn’t send mail at all (all sent from same email
though).
Started experimenting with raw smtp to check connection parameters and
try to send at least one email. I found out, that EOFError happened when
‘From’ email field was different than account I was sending email from.
So in ActiveMailer is simply means that ‘From’ was different than email
used in configuration to authenticate to smtp server.

As I was saying, I send email only from one account (for testing
purposes it’s free public account, so many restrictions apply), but
maybe in your situation those few bad emails fail for the very same
reason?

Hope it helps.

Michal Wronka


#3

Thanks for the help. In my case I finally found out that the server I
was
talking was dropping connections and using a new server (mostly) solved
my
problems. Thanks for remembering me, though!

AEM