Rails marshal data too short

I ran into an error when trying to save an object in flash between Rails actions.  I’m still not sure why marshal data too short happened as the session storage is mysql using the text type which should be 64kb.  I can’t imagine the object taking more size than that but it would be worth checking.  I resolved the issue by not storing the object but other options would be figuring out why the object is so large (Marshal.dump(object) maybe) or switching to mediumtext type which has a limit of 16MB.  To do this via a migration can be found here:

ruby on rails – marshal data too short!!! – Stack Overflow

Leave a Reply

Your email address will not be published. Required fields are marked *