Rails Sessions and marshal data too short
July 12, 2008
I’ve been struggling a bit with a case of
marshal data too short
for one of my users. It happened out of the blue, and I was stumped as to how it could happen, as I only save a couple of ID’s in the sessions and never any objects.
Turns out I forgot something which is pretty obvious, really.
flash['notice'] = "#{link_to_task_with_tooltip} successfully saved"
As the tooltip contains the full task description, what would happen if someone entered a massive description (~65kb) and saved the task?
It would case the session data to get truncated on save, and end up impossible to restore on the next request.
Also, the exception when this happens doesn’t really include any useful information (like which session it was unable to restore) so I thought this was a way more common problem than it really was. Turns out this problem only affected two users, but they both kept trying and trying and it looked like I had this problem all over the place.
Fix coming up. 🙂
November 17, 2008 at 9:35 pm
Hi,
I’ve been using Weft QDA to code qualitative data. Now I’m getting the message ‘marshal data too short’ every time I try to open my file. I think because my laptop had a power problem and cut out while using the programme.
I was trying to look up a solution and came across this entry. Do you know of any fix I can do to make the file open normally again?
Thanks in advance,
Lucy (lucyehollis@gmail.com)
November 20, 2008 at 1:56 pm
As I have no idea what Weft QDA is, or what file you’re trying to open, I don’t think I can help you much.
My problem was that the session data being truncated due to some too big data getting stored and ending up truncated when saved to the database.
— Erlend
June 23, 2009 at 9:07 am
Just thought I’d leave a note and say that if you’re using MySQL, and need big sessions but keep hitting this problem, trychanging the data fields in your sessions field to “longtext” That will give your DB more than enough space to work with.