# Application error after server reset

**URL:** <https://www.ruby-forum.com/t/application-error-after-server-reset/81826>\
**Category:** Rails\
**Created:** [January 15, 2007, 3:01pm UTC](https://www.ruby-forum.com/t/application-error-after-server-reset/81826 "2007-01-15T15:01:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [January 15, 2007, 3:01pm UTC](https://www.ruby-forum.com/t/application-error-after-server-reset/81826/1 "2007-01-15T15:01:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [January 15, 2007, 3:24pm UTC](https://www.ruby-forum.com/t/application-error-after-server-reset/81826/2 "2007-01-15T15:24:39Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [January 15, 2007, 4:21pm UTC](https://www.ruby-forum.com/t/application-error-after-server-reset/81826/3 "2007-01-15T16:21:21Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [January 16, 2007, 11:35am UTC](https://www.ruby-forum.com/t/application-error-after-server-reset/81826/4 "2007-01-16T11:35:01Z")

</div>

> 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…

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [January 15, 2007, 7:09pm UTC](https://www.ruby-forum.com/t/application-error-after-server-reset/81826/5 "2007-01-15T19:09:26Z")

</div>

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](http://www.informatikamihelac.com)  
 → tools, scripts, tricks from our code lab: [http://source.mihelac.org](http://source.mihelac.org)
