Suddenly, in my first Rails app, I've started seeing this error:
/!\ FAILSAFE /!\ Fri Sep 11 17:30:48 -0400 2009
Status: 500 Internal Server Error
ActionController::Session::CookieStore::CookieOverflow
A little research points to the usage of of cookies to store session data, but I'm not doing that (at least not intentionally). Moreover, this just started happening today. The only thing I've started working on today is the ability to upload a zip file. The zip file that I'm trying to use for testing is 1.1MB.
Additionally, Firebug shows only 2 cookies for this domain. The one named _html_session
is 507B and the one named user_credentials
is 147B. Are uploaded files temporarily stored in such a way that a large-ish file could be causing this? Uploading a single image works just fine.
Thanks for your help.
UPDATE: Oops. Contrary to my comments to Vitaly and xijo below, the error is not quite instant. In this case I'm uploading something to my Image
model and the error is happening when my ImagesController
calls @image.save!
.
What's interesting is that I still don't really understand where the error happens. I created an Image#before_validation
method and raising an exception there, but the CookieOverflow error happens before I ever get there. Is there any place I can drop code after the controller makes the save call and before that particular callback? My understanding is that before_validation
is the first callback.
This can easily happen if you try and store a flash[:notice] = 'blah'
message that is too long, since that message is stored in the session cookie.
I just ran into a similar problem today. Apparently, Rails sessions can only store 4k of data. One possible solution it to use a database store for your sessions.
To do this:
config.action_controller.session_store = :active_record_store
to your environment.rb
file.rake db:sessions:create
rake db:migrate
Hope this helps
the only thing that comes to mind is that you somehow did put your .zip into the session.
To debug it:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With