0

I have started getting a strange issue in a Rails app, that is proving very difficult to debug.

EOFError
end of file reached

is being raised on some Devise routes. So far I'm getting this on session#destroy and registration#update (I have not been able to try others).

The issue is not occurring in tests, only in development environment.

After stepping through the controllers, the error appears to be raised on the following lines.

registration#update
resource_updated = update_resource(resource, account_update_params)

session#destroy
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))

I realise that identifing the cause will likely need much more code. But after several hours trying to debug this I'm at a loss to next steps. I'd be grateful if anyone can:

  1. Suggest how to obtain more useful information when EOFError is raised. Currently all I'm getting is Completed 500 Internal Server Error in 2627ms (ActiveRecord: 10.1ms) EOFError - end of file reached: without much to identify where this is being raised.
  2. Suggest a logical approach to debug this. From my attempts, the error appears to be coming from the Devise internals, which I don't think is correct.
Andy Harvey
  • 12,333
  • 17
  • 93
  • 185
  • maybe the answers to [this](https://stackoverflow.com/questions/16819801/rails-eoferror-end-of-file-reached-when-saving-a-devise-user/16827336) question can help to get yours. Also for debugging errors, I use [better_errors](https://github.com/charliesome/better_errors). You may it a try. – Roshan Aug 22 '17 at 12:36
  • Thanks @Roshan this is a useful reference, but I don't think it solves my problem. I've just replaced my entire initializer with the default - I am using Devise::Mailer and have set mail_sender to mailer@example.com. I'm still getting the error. Have I missed something? – Andy Harvey Aug 22 '17 at 14:38

0 Answers0