Marshal data too short -- getting this all the time now

I’m getting this never before seen error quite a bit all of a sudden:
marshal data too short

It shows up as an application error just after a “stale_session_check”
in the stack dump in the error log.

Anybody know what it means? Why it happens? The only solution I’ve
found so far is to use mySQL admin to delete the session data. It has
been happening often enough today that it is really slowing me down but
I have no clue what’s broke.

thanks,
jp

jens wille wrote:

what helped in my case was to set the type of the ‘data’ column in
the ‘sessions’ table to ‘longtext’ (or ‘mediumtext’) instead of ‘text’.

note, however, that this is specific to mysql and if you’re using
migrations you need to set it manually: t.columns << ‘data longtext’
(at the end of your ‘create_table’ block).

hth
jens

Interesting. I’ll give it a try. Thanks!

jp

hi jeff!

Jeff P. [25.02.2007 02:26]:

I’m getting this never before seen error quite a bit all of a
sudden: marshal data too short
what helped in my case was to set the type of the ‘data’ column in
the ‘sessions’ table to ‘longtext’ (or ‘mediumtext’) instead of ‘text’.

note, however, that this is specific to mysql and if you’re using
migrations you need to set it manually: t.columns << ‘data longtext’
(at the end of your ‘create_table’ block).

hth
jens


Jens W., Dipl.-Bibl. (FH)
prometheus - Das verteilte digitale Bildarchiv für Forschung & Lehre
An St. Laurentius 4, 50931
KölnTel.: +49 (0)221 470-6668, E-Mail: [email protected]
http://www.prometheus-bildarchiv.de/

Hi Mathieu,

‘marshal data too short’ is usually caused by the session data column in
the sessions table being too short to handle large session data.
Whatever the database you’re using, the default migration sets it to a
preset size (TEXT in MySQL) and if your session is too large, it will
cause the marshaled data checksum to fail. Try setting your column type
to something larger (in MySQL, LONGTEXT works better).

Mathieu Jobin wrote:

I’m having the same problem as jeff. ‘marshal data too short’ but I am
not using mysql for session storage. I left it to the default and the
sessions are stored on disk. I have 27000 registered users on my system
and this problem happens for only two of these users. I have no idea
what that could be from…

jens wille wrote:

hi jeff!

Jeff P. [25.02.2007 02:26]:

I’m getting this never before seen error quite a bit all of a
sudden: marshal data too short
what helped in my case was to set the type of the ‘data’ column in
the ‘sessions’ table to ‘longtext’ (or ‘mediumtext’) instead of ‘text’.

note, however, that this is specific to mysql and if you’re using
migrations you need to set it manually: t.columns << ‘data longtext’
(at the end of your ‘create_table’ block).

hth
jens


Jens W., Dipl.-Bibl. (FH)
prometheus - Das verteilte digitale Bildarchiv f�r Forschung & Lehre
An St. Laurentius 4, 50931
K�lnTel.: +49 (0)221 470-6668, E-Mail: [email protected]
http://www.prometheus-bildarchiv.de/

I’m having the same problem as jeff. ‘marshal data too short’ but I am
not using mysql for session storage. I left it to the default and the
sessions are stored on disk. I have 27000 registered users on my system
and this problem happens for only two of these users. I have no idea
what that could be from…

jens wille wrote:

hi jeff!

Jeff P. [25.02.2007 02:26]:

I’m getting this never before seen error quite a bit all of a
sudden: marshal data too short
what helped in my case was to set the type of the ‘data’ column in
the ‘sessions’ table to ‘longtext’ (or ‘mediumtext’) instead of ‘text’.

note, however, that this is specific to mysql and if you’re using
migrations you need to set it manually: t.columns << ‘data longtext’
(at the end of your ‘create_table’ block).

hth
jens


Jens W., Dipl.-Bibl. (FH)
prometheus - Das verteilte digitale Bildarchiv f�r Forschung & Lehre
An St. Laurentius 4, 50931
K�lnTel.: +49 (0)221 470-6668, E-Mail: [email protected]
http://www.prometheus-bildarchiv.de/

I believe this has something to do with a corrupt session file. If you
empty out your tmp/session dir or remove the session files of those
people it will probably work again.

Let me know what happened.
Marco

Mathieu Jobin wrote:

Hi Milan, thanks for your answer.
but I dont use a DB for session storage, but the default on disk in
RAILS_ROOT/tmp/sessions

I only store IDs and short strings in the session, no big object.
i really don’t understand why I am getting this error.

and I am getting this error only when 3 of my 27000 users login.
it works fine for most people.

I’m out of ideas…

Milan Iliev wrote:

Hi Mathieu,

Hey guys, Im experiencing the exact same thing. Normally the data column
would never even be even close to reaching its character limit. The
problem is that, all of a sudden, when data gets written to the session
data column, its writes the data for a few lines and then starts
repeating

“YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh”

until its out of space. Im sure thats causing the error. Anybody seen
this before?

Marco Kotrotsos wrote:

I believe this has something to do with a corrupt session file. If you
empty out your tmp/session dir or remove the session files of those
people it will probably work again.

Let me know what happened.
Marco

Mathieu Jobin wrote:

Hi Milan, thanks for your answer.
but I dont use a DB for session storage, but the default on disk in
RAILS_ROOT/tmp/sessions

I only store IDs and short strings in the session, no big object.
i really don’t understand why I am getting this error.

and I am getting this error only when 3 of my 27000 users login.
it works fine for most people.

I’m out of ideas…

Milan Iliev wrote:

Hi Mathieu,

Hi Milan, thanks for your answer.
but I dont use a DB for session storage, but the default on disk in
RAILS_ROOT/tmp/sessions

I only store IDs and short strings in the session, no big object.
i really don’t understand why I am getting this error.

and I am getting this error only when 3 of my 27000 users login.
it works fine for most people.

I’m out of ideas…

Milan Iliev wrote:

Hi Mathieu,

‘marshal data too short’ is usually caused by the session data column in
the sessions table being too short to handle large session data.
Whatever the database you’re using, the default migration sets it to a
preset size (TEXT in MySQL) and if your session is too large, it will
cause the marshaled data checksum to fail. Try setting your column type
to something larger (in MySQL, LONGTEXT works better).

Mathieu Jobin wrote:

I’m having the same problem as jeff. ‘marshal data too short’ but I am
not using mysql for session storage. I left it to the default and the
sessions are stored on disk. I have 27000 registered users on my system
and this problem happens for only two of these users. I have no idea
what that could be from…

jens wille wrote:

hi jeff!

Jeff P. [25.02.2007 02:26]:

I’m getting this never before seen error quite a bit all of a
sudden: marshal data too short
what helped in my case was to set the type of the ‘data’ column in
the ‘sessions’ table to ‘longtext’ (or ‘mediumtext’) instead of ‘text’.

note, however, that this is specific to mysql and if you’re using
migrations you need to set it manually: t.columns << ‘data longtext’
(at the end of your ‘create_table’ block).

hth
jens


Jens W., Dipl.-Bibl. (FH)
prometheus - Das verteilte digitale Bildarchiv f�r Forschung & Lehre
An St. Laurentius 4, 50931
K�lnTel.: +49 (0)221 470-6668, E-Mail: [email protected]
http://www.prometheus-bildarchiv.de/

Hi, I ended up with this problem, but having a six hundred thousands
records in my sessions table…
Surely’ve been hacked;
The site are protected with a simple login page (salt & hash, successful
create a user session) and is just on the web for development/production
testing.
I wonder exactly how it has happenned; The logs don’t show any
activities !!!
might be something like XSS, but if it seems obvious for some of you,
thanks for the info you’d provide.

For MySQL db, here is the migration to change to longtext:

class ChangeSessions2 < ActiveRecord::Migration
>   def self.up
>     execute "ALTER TABLE sessions CHANGE COLUMN data data LONGTEXT"
>   end
> 
>   def self.down
>   end
> end
> 

Regards,

LarryK

For MySQL db, here is the migration to change to longtext:

class ChangeSessions2 < ActiveRecord::Migration
  def self.up
    execute "ALTER TABLE sessions CHANGE COLUMN data data LONGTEXT"
  end

  def self.down
  end
end

Regards,

LarryK