marston-8Qo2DTIsO68RmelmmXo44Q@public.gmane.org
2006-Dec-02 20:47 UTC
Need help debugging a Singleton TypeError in my app.
I keep getting this error: TypeError (singleton can''t be dumped): /lib/sql_session_store.rb:124:in `dump'' /lib/sql_session_store.rb:124:in `marshalize'' /lib/sql_session_store.rb:91:in `close'' /usr/local/lib/ruby/1.8/cgi/session.rb:330:in `close'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:1015:in `close_session'' This only recently started happening and I haven''t changed much of anywhere from before I started getting this error. This happens when I''m updating a user account (I''m using auth_generator). Weird thing is if I take the image upload form field out of the view, it runs fine... But I kind of need that form field to update user icons (Again this worked fine a little while ago and I''ve tried to revert any changes I''ve made since with no luck, obviously I missed something. I suppose I should write better tests :-\ ). I''m just having trouble finding out where the actual problem is. What are the most common causes of the: "TypeError (singleton can''t be dumped)" error? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Justin Forder
2006-Dec-02 22:02 UTC
Re: Need help debugging a Singleton TypeError in my app.
marston-8Qo2DTIsO68RmelmmXo44Q@public.gmane.org wrote:> I keep getting this error: > > TypeError (singleton can''t be dumped): > /lib/sql_session_store.rb:124:in `dump'' > /lib/sql_session_store.rb:124:in `marshalize'' > /lib/sql_session_store.rb:91:in `close'' > /usr/local/lib/ruby/1.8/cgi/session.rb:330:in `close'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:1015:in > `close_session'' > > This only recently started happening and I haven''t changed much of > anywhere from before I started getting this error. > > This happens when I''m updating a user account (I''m using > auth_generator). Weird thing is if I take the image upload form field > out of the view, it runs fine... But I kind of need that form field to > update user icons (Again this worked fine a little while ago and I''ve > tried to revert any changes I''ve made since with no luck, obviously I > missed something. I suppose I should write better tests :-\ ). I''m > just having trouble finding out where the actual problem is. > > What are the most common causes of the: "TypeError (singleton can''t be > dumped)" error? Thanks.The dumping in question is the serialisation of an object into the session. In Ruby terminology, a singleton is an instance that has methods added to it (i.e. methods in addition to those defined in its class). As a general point, your application will be more robust if you hold the IDs of persistent objects in your session, rather than the objects themselves. I hope that helps, because that''s the whole extent of my knowledge! regards Justin Forder --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
WuyaSea Operator
2006-Dec-02 22:04 UTC
Re: Need help debugging a Singleton TypeError in my app.
"What are the most common causes of the: "TypeError (singleton can''t be dumped)" error? " you put IO kind of objects or singleton obj into session, when rails try to serialize it and save it into session, ruby complains since they can''t be marshalled/serialized. uploaded image blob is of StringIO type, you should exclude that from saving into session. wuyaSea Operator www.wuyaSea.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---