Login Engine, user object "marshal data too short"?

This suddenly started happening to my app today. No code changes, so I
expect that this has something to do with a server change.

I’m using Login Engine and ActiveRecord sessions. LE stores the whole
user object in the session, then pulls it out as needed with
UserController#current_user.

Out of the blue today this starts failing with the infamous “you’re
serializing AR objects into the db so you’re getting a ‘marshal data
too short’ error”. No code has changed in this app in weeks and
suddenly I’m getting this error.

I can clear all sessions from the DB, do something to create a session
and store a user, then hit another page that pulls the user out of the
DB and I get a Application Error with the log saying “marshal data too
short.”

Thoughts?

thx,
–dwf

I can clear all sessions from the DB, do something to create a session
and store a user, then hit another page that pulls the user out of the
DB and I get a Application Error with the log saying “marshal data too
short.”

If you are using ActiveRecord session store, you may need to change the
type of your :data column in the :sessions table. You can do this by
creating a migration that ups the :limit on the :data column, like so:

def self.up
change_column :sessions, :data, :text, { :limit => 1.megabyte }
end

  • Danny

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs