rails: ArgumentError (dump format error (user class))
Hello.
Im trying to upgrade rails from 3.0.9 to 3.1. Evrething was successfull and i deploy it to production. But when i
m trying to visit the main page - error happens.
In production log file i find : “ArgumentError (dump format error (user class))”
The same issue i find there: http://wondible.com/2011/08/11/updating-to-rails-3-1-rc5/ and there http://wondible.com/2011/08/11/updating-to-rails-3-1-rc5/
How i can fix this issue?
About this issue
- Original URL
- State: closed
- Created 13 years ago
- Comments: 72 (33 by maintainers)
Commits related to this issue
- Provide failing test case for #3298 #2509 — committed to rails/rails by josevalim 13 years ago
- Add some implementation docs. closes #3298. closes #2509. — committed to waseem/rails by josevalim 13 years ago
If Rails cannot deserialize the session in development or test, then it should probably raise. But if Rails cannot deserialize the session in production, it should probably clear the session instead of raising.
I traced this error and it happens because the FlashHash class in the session has been changed to no longer inherit from the Hash class in rails 3.1. Monkey patching the Flash to inherit from Hash again is not trivial, I gave up after half an hour.
So the only option to fix this is to expire all sessions by changing the SESSION_KEY variable in the session_store.rb. This will log out all your users so best to do it on a weekend at night or something.