Application error after server reset

I was logged in my rails web app in firefox which is running on Ubuntu
(WEBRick). I restarted the server and tried to continue to use the app
and I get this:

Application error

Change this error message for exceptions thrown outside of an action
(like in Dispatcher setups or broken Ruby code) in public/500.html

This happened before, but now I know that it is related to the server
restart. It happened on the other machine too…
When I restart the firefox, I can login again - no problems.

What is this? Perhaps it is related to session state… maybe I should
catch that exception somewhere and clear the session variables and
present the login form? How is this solved in other applications.

Thank you for your time !

David

update:

when I run “rake tmp:clear” on server to clear sessions, logging in
works again on the client. So it really is something with sessions.

It seems that when ubuntu is restarted, webrick is forcefully closed and
the sessions remain on disk (they are stored there as far as I know)…
when all comes back, hmm. wait. it should continue to work if the state
was saved on disk… but it doesn’t … so rake tmp:clear solves the
problem, but I still don’t quite understand or know what is the best way
to solve this.

Thank you again

David K. wrote:

I was logged in my rails web app in firefox which is running on Ubuntu
(WEBRick). I restarted the server and tried to continue to use the app
and I get this:

sorry, forgot to mention that this doesn’t happen always when I restart
the server… I tried a few times now and it works like nothing happened
(user remains logged in - this is because sessions remain on disk). So
it’s even stranger… Now I cannot get the error back to examine it
further…

David, I remember similiar ‘problems’. Could it be that you restarted
server because you changed some code and objects in session dont have
equal structure anymore?

best,
Bojan

Thank you for the answer… No, I don’t think so, because I’m only saving
primitive types in session (int, string). hmm…

David K. wrote:

sorry, forgot to mention that this doesn’t happen always when I restart
the server… I tried a few times now and it works like nothing happened
(user remains logged in - this is because sessions remain on disk). So
it’s even stranger… Now I cannot get the error back to examine it
further…

David, I remember similiar ‘problems’. Could it be that you restarted
server because you changed some code and objects in session dont have
equal structure anymore?

best,
Bojan


Bojan M.
Informatika Mihelac, Bojan M. s.p. | www.informatikamihelac.com
-> tools, scripts, tricks from our code lab: http://source.mihelac.org

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs