I keep getting this error in rails 1.1, does anybody know what it means? My site will be working fine, i do some more development, get a parse error, and then all of a sudden the page 404''s with the following error Session contains objects whose class definition isn''t available Remember to require the classes for all objects kept in the session. (Original exception: uninitialized constant BigDecimal [NameError]) Any ideas here ? Clearing all the sessions and cookies brings everything back to normal.. not sure whats going on. This is on Rails 1.1, Linux, Ruby 1.8.4, Postgres thanks adam -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060405/d3e3872f/attachment.html
You have changed your model since your sessions were created. This causes a mismatch and and the error. Each time you change your model or database your sessions will no longer be valid. That''s why clearing them fixes the problem. On Wed, 2006-04-05 at 10:47 -0400, Adam Denenberg wrote:> I keep getting this error in rails 1.1, does anybody know what it > means? My site will be working fine, i do some more development, get > a parse error, and then all of a sudden the page 404''s with the > following error > > > Session contains objects whose class definition isn''t available > Remember to require the classes for all objects kept in the session. > (Original exception: uninitialized constant BigDecimal [NameError]) > > Any ideas here ? Clearing all the sessions and cookies brings > everything back to normal.. not sure whats going on. This is on Rails > 1.1, Linux, Ruby 1.8.4, Postgres > > thanks > adam > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060405/69a7135d/attachment.html
Thanks for the explanation. However my model and database (column definitions) were not changed here. Anything else that would cause this? All that happened was i had a parse error in an rhtml page, fixed it, i reloaded and then got this and wouldnt go away. adam On 4/5/06, Charlie Bowman <charlie@castlebranch.com> wrote:> > You have changed your model since your sessions were created. This causes > a mismatch and and the error. Each time you change your model or database > your sessions will no longer be valid. That''s why clearing them fixes the > problem. > > > On Wed, 2006-04-05 at 10:47 -0400, Adam Denenberg wrote: > > I keep getting this error in rails 1.1, does anybody know what it means? > My site will be working fine, i do some more development, get a parse error, > and then all of a sudden the page 404''s with the following error > > Session contains objects whose class definition isn''t availableRemember to require the classes for all objects kept in the session.(Original exception: uninitialized constant BigDecimal [NameError]) > > Any ideas here ? Clearing all the sessions and cookies brings everything > back to normal.. not sure whats going on. This is on Rails 1.1, Linux, > Ruby 1.8.4, Postgres > > thanks > adam > > _______________________________________________Rails mailing listRails@lists.rubyonrails.orghttp://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060405/8b842608/attachment.html
I''m not sure. I know that rails will die if you try to access an object in your session that rails knows nothing about. What are you storing in your session? On Wed, 2006-04-05 at 11:07 -0400, Adam Denenberg wrote:> Thanks for the explanation. However my model and database (column > definitions) were not changed here. Anything else that would cause > this? All that happened was i had a parse error in an rhtml page, > fixed it, i reloaded and then got this and wouldnt go away. > > adam > > > On 4/5/06, Charlie Bowman <charlie@castlebranch.com> wrote: > > You have changed your model since your sessions were created. > This causes a mismatch and and the error. Each time you > change your model or database your sessions will no longer be > valid. That''s why clearing them fixes the problem. > > > On Wed, 2006-04-05 at 10:47 -0400, Adam Denenberg wrote: > > > I keep getting this error in rails 1.1, does anybody know what > it means? My site will be working fine, i do some more > development, get a parse error, and then all of a sudden the > page 404''s with the following error > > > Session contains objects whose class definition isn''t available > Remember to require the classes for all objects kept in the session. > (Original exception: uninitialized constant BigDecimal [NameError]) > > Any ideas here ? Clearing all the sessions and cookies > brings everything back to normal.. not sure whats going on. > This is on Rails 1.1, Linux, Ruby 1.8.4, Postgres > > thanks > adam > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060405/badc6531/attachment-0001.html
Adam Denenberg wrote:> Thanks for the explanation. However my model and database (column > definitions) were not changed here. Anything else that would cause > this? > All that happened was i had a parse error in an rhtml page, fixed it, i > reloaded and then got this and wouldnt go away. > > adamThis looks relevant: http://wiki.rubyonrails.org/rails/pages/HowtoAvoidSessionRestoreError -- Posted via http://www.ruby-forum.com/.
hmm nice post, that does appear to be very relevant. On 4/5/06, Alan Francis <alancfrancis@gmail.com> wrote:> > Adam Denenberg wrote: > > Thanks for the explanation. However my model and database (column > > definitions) were not changed here. Anything else that would cause > > this? > > All that happened was i had a parse error in an rhtml page, fixed it, i > > reloaded and then got this and wouldnt go away. > > > > adam > > This looks relevant: > > http://wiki.rubyonrails.org/rails/pages/HowtoAvoidSessionRestoreError > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060405/5c241228/attachment.html
I''m not sure if this is correct or will help, but I ran into a problem after the 1.1 on my production server (FreeBSD 6.0, Apache2, fast_cgi) where I would get an "application error". It took me a while to figure out that the objects I was storing in the session objects were coming back nil when accessed within a view. I did the usual job of deleting the RUBY.Session objects in the temp directory, bounced the web server and the problem was still there. I started to think maybe there was an issue of scope with respect to the session objects. In my code I had previously stored things in the session by typing: session[:xyz]= "blah" and everything worked, then I upgraded to 1.1 and started getting the errors. I went in and refactored all the session[:xyz] references to @session[:xyz]= "blah" bounced the server and everything worked like a charm. The strange thing was that this only affected production. I could load the console or webrick and everything behaved as expected which is why I am not certain if the problem somehow magically got fixed between server bounces but it is worth trying if you are having the same problem. Regards, Chris Burnley
On Wed, 2006-04-05 at 17:15 -0700, Christopher Burnley wrote:> I''m not sure if this is correct or will help, but I ran into a > problem after the 1.1 on my production server (FreeBSD 6.0, Apache2, > fast_cgi) where I would get an "application error". It took me a > while to figure out that the objects I was storing in the session > objects were coming back nil when accessed within a view. I did the > usual job of deleting the RUBY.Session objects in the temp directory, > bounced the web server and the problem was still there. I started to > think maybe there was an issue of scope with respect to the session > objects. > > In my code I had previously stored things in the session by typing: > session[:xyz]= "blah" > and everything worked, then I upgraded to 1.1 and started getting the > errors. I went in and refactored all the session[:xyz] references to > @session[:xyz]= "blah" > bounced the server and everything worked like a charm. The strange > thing was that this only affected production. I could load the > console or webrick and everything behaved as expected which is why I > am not certain if the problem somehow magically got fixed between > server bounces but it is worth trying if you are having the same > problem.---- FWIW, I use session[:key] = "value" (probably too frequently) and the migration to rails 1.1 had no impact on me and I have refactored nothing. CentOS 4 httpd-2.0.52-22 (apache) mod_fastcgi 2.4.2 Caig
this is starting to feel very buggy. This time all I did was change one line of an rhtml file, reload the browser and I got the error. Maybe because I load my model into the session like @entry = User.find(3) @session[:user] = @entry when a user first logs in Its causing some funky behavior in rails ? I dont think adding a few lines of html to an rhtml file would make this popup b/c thats what happened this time. adam On 4/5/06, Craig White <craigwhite@azapple.com> wrote:> > On Wed, 2006-04-05 at 17:15 -0700, Christopher Burnley wrote: > > I''m not sure if this is correct or will help, but I ran into a > > problem after the 1.1 on my production server (FreeBSD 6.0, Apache2, > > fast_cgi) where I would get an "application error". It took me a > > while to figure out that the objects I was storing in the session > > objects were coming back nil when accessed within a view. I did the > > usual job of deleting the RUBY.Session objects in the temp directory, > > bounced the web server and the problem was still there. I started to > > think maybe there was an issue of scope with respect to the session > > objects. > > > > In my code I had previously stored things in the session by typing: > > session[:xyz]= "blah" > > and everything worked, then I upgraded to 1.1 and started getting the > > errors. I went in and refactored all the session[:xyz] references to > > @session[:xyz]= "blah" > > bounced the server and everything worked like a charm. The strange > > thing was that this only affected production. I could load the > > console or webrick and everything behaved as expected which is why I > > am not certain if the problem somehow magically got fixed between > > server bounces but it is worth trying if you are having the same > > problem. > ---- > FWIW, I use session[:key] = "value" (probably too frequently) and the > migration to rails 1.1 had no impact on me and I have refactored > nothing. > CentOS 4 > httpd-2.0.52-22 (apache) > mod_fastcgi 2.4.2 > > Caig > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060408/5f54ee75/attachment.html
Hi Adam, I think that perhaps what Craig was suggesting was that you replace @session[] with session[]. As I understand it, use of the @ is being deprecated to make local vs. instance vs. (what the heck is the right word to use for the type for session and params?). I was told this WRT @params, and I''d bet it''s true for @session too. hth, Bill ----- Original Message ----- From: Adam Denenberg To: rails@lists.rubyonrails.org Sent: 2006-04-08 9:13 AM Subject: Re: [Rails] Re: session error in rails 1.1 this is starting to feel very buggy. This time all I did was change one line of an rhtml file, reload the browser and I got the error. Maybe because I load my model into the session like @entry = User.find(3) @session[:user] = @entry when a user first logs in Its causing some funky behavior in rails ? I dont think adding a few lines of html to an rhtml file would make this popup b/c thats what happened this time. adam On 4/5/06, Craig White <craigwhite@azapple.com> wrote: On Wed, 2006-04-05 at 17:15 -0700, Christopher Burnley wrote: > I''m not sure if this is correct or will help, but I ran into a > problem after the 1.1 on my production server (FreeBSD 6.0, Apache2, > fast_cgi) where I would get an "application error". It took me a > while to figure out that the objects I was storing in the session > objects were coming back nil when accessed within a view. I did the > usual job of deleting the RUBY.Session objects in the temp directory, > bounced the web server and the problem was still there. I started to > think maybe there was an issue of scope with respect to the session > objects. > > In my code I had previously stored things in the session by typing: > session[:xyz]= "blah" > and everything worked, then I upgraded to 1.1 and started getting the > errors. I went in and refactored all the session[:xyz] references to > @session[:xyz]= "blah" > bounced the server and everything worked like a charm. The strange > thing was that this only affected production. I could load the > console or webrick and everything behaved as expected which is why I > am not certain if the problem somehow magically got fixed between > server bounces but it is worth trying if you are having the same > problem. ---- FWIW, I use session[:key] = "value" (probably too frequently) and the migration to rails 1.1 had no impact on me and I have refactored nothing. CentOS 4 httpd-2.0.52-22 (apache) mod_fastcgi 2.4.2 Caig _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails ------------------------------------------------------------------------------ _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060408/fe755de2/attachment.html
Thanks Bill I will give that a shot. I assume this means in the views too right ? adam On 4/8/06, Bill Walton <bill.walton@charter.net> wrote:> > Hi Adam, > > I think that perhaps what Craig was suggesting was that you replace > @session[] with session[]. As I understand it, use of the @ is being > deprecated to make local vs. instance vs. (what the heck is the right word > to use for the type for session and params?). I was told this WRT @params, > and I''d bet it''s true for @session too. > > hth, > Bill > > ----- Original Message ----- > *From:* Adam Denenberg <straightflush@gmail.com> > *To:* rails@lists.rubyonrails.org > *Sent:* 2006-04-08 9:13 AM > *Subject:* Re: [Rails] Re: session error in rails 1.1 > > this is starting to feel very buggy. This time all I did was change one > line of an rhtml file, reload the browser and I got the error. > > Maybe because I load my model into the session like > > @entry = User.find(3) > @session[:user] = @entry > > when a user first logs in Its causing some funky behavior in rails ? I > dont think adding a few lines of html to an rhtml file would make this popup > b/c thats what happened this time. > > adam > > On 4/5/06, Craig White <craigwhite@azapple.com> wrote: > > > > On Wed, 2006-04-05 at 17:15 -0700, Christopher Burnley wrote: > > > I''m not sure if this is correct or will help, but I ran into a > > > problem after the 1.1 on my production server (FreeBSD 6.0, Apache2, > > > fast_cgi) where I would get an "application error". It took me a > > > while to figure out that the objects I was storing in the session > > > objects were coming back nil when accessed within a view. I did the > > > usual job of deleting the RUBY.Session objects in the temp directory, > > > bounced the web server and the problem was still there. I started to > > > think maybe there was an issue of scope with respect to the session > > > objects. > > > > > > In my code I had previously stored things in the session by typing: > > > session[:xyz]= "blah" > > > and everything worked, then I upgraded to 1.1 and started getting the > > > errors. I went in and refactored all the session[:xyz] references to > > > @session[:xyz]= "blah" > > > bounced the server and everything worked like a charm. The strange > > > thing was that this only affected production. I could load the > > > console or webrick and everything behaved as expected which is why I > > > am not certain if the problem somehow magically got fixed between > > > server bounces but it is worth trying if you are having the same > > > problem. > > ---- > > FWIW, I use session[:key] = "value" (probably too frequently) and the > > migration to rails 1.1 had no impact on me and I have refactored > > nothing. > > CentOS 4 > > httpd-2.0.52-22 (apache) > > mod_fastcgi 2.4.2 > > > > Caig > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > ------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060408/4db94084/attachment.html
indeed, that is what I meant... see this link from wiki.rubyonrails.org http://wiki.rubyonrails.org/rails/pages/HowtoWorkWithSessions Craig On Sat, 2006-04-08 at 11:04 -0400, Adam Denenberg wrote:> Thanks Bill I will give that a shot. > > I assume this means in the views too right ? > > adam > > On 4/8/06, Bill Walton <bill.walton@charter.net> wrote: > Hi Adam, > > I think that perhaps what Craig was suggesting was that you > replace @session[] with session[]. As I understand it, use of > the @ is being deprecated to make local vs. instance vs. (what > the heck is the right word to use for the type for session and > params?). I was told this WRT @params, and I''d bet it''s true > for @session too. > > hth, > Bill > > ----- Original Message ----- > From: Adam Denenberg > To: rails@lists.rubyonrails.org > Sent: 2006-04-08 9:13 AM > Subject: Re: [Rails] Re: session error in rails 1.1 > > > this is starting to feel very buggy. This time all I did was > change one line of an rhtml file, reload the browser and I got > the error. > > Maybe because I load my model into the session like > > @entry = User.find(3) > @session[:user] = @entry > > when a user first logs in Its causing some funky behavior in > rails ? I dont think adding a few lines of html to an rhtml > file would make this popup b/c thats what happened this time. > > adam > > On 4/5/06, Craig White <craigwhite@azapple.com> wrote: > On Wed, 2006-04-05 at 17:15 -0700, Christopher Burnley > wrote: > > I''m not sure if this is correct or will help, but I > ran into a > > problem after the 1.1 on my production server > (FreeBSD 6.0, Apache2, > > fast_cgi) where I would get an "application error". > It took me a > > while to figure out that the objects I was storing > in the session > > objects were coming back nil when accessed within a > view. I did the > > usual job of deleting the RUBY.Session objects in > the temp directory, > > bounced the web server and the problem was still > there. I started to > > think maybe there was an issue of scope with respect > to the session > > objects. > > > > In my code I had previously stored things in the > session by typing: > > session[:xyz]= "blah" > > and everything worked, then I upgraded to 1.1 and > started getting the > > errors. I went in and refactored all the > session[:xyz] references to > > @session[:xyz]= "blah" > > bounced the server and everything worked like a > charm. The strange > > thing was that this only affected production. I > could load the > > console or webrick and everything behaved as > expected which is why I > > am not certain if the problem somehow magically got > fixed between > > server bounces but it is worth trying if you are > having the same > > problem. > ---- > FWIW, I use session[:key] = "value" (probably too > frequently) and the > migration to rails 1.1 had no impact on me and I have > refactored > nothing. > CentOS 4 > httpd-2.0.52-22 (apache) > mod_fastcgi 2.4.2 > > Caig > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > ______________________________________________________________ > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails