# Mongrel Crashes in Production

**URL:** <https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257>\
**Category:** Mongrel\
**Created:** [March 18, 2008, 12:47pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257 "2008-03-18T12:47:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [March 18, 2008, 12:47pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/1 "2008-03-18T12:47:45Z")

</div>

I have been getting this error on the production server after rails was  
updated to 2.0.2 and moreover this worked perfectly in the development  
mode. This crash occurs when no one is using the app for an hour or so.  
This is the error that I get in the logs. (nohup.out file). The  
production log doesnt show anything unusual. Please help me out guys.  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/…/lib/mongrel/rails.rb:98:in  
`reload!': undefined method`reset\_application!’ for  
ActionController::Dispatcher:Class (NoMethodError)  
from  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/…/lib/mongrel/rails.rb:95:in  
`synchronize' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/rails.rb:95:in`reload!’  
from  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/…/lib/mongrel/rails.rb:165:in  
`reload!' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/rails.rb:178:in`setup\_rails\_signals’  
from  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/…/lib/mongrel/configurator.rb:303:in  
`call' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/configurator.rb:303:in`join’  
from  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/…/lib/mongrel

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [March 18, 2008, 3:48pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/2 "2008-03-18T15:48:19Z")

</div>

On Tue, Mar 18, 2008 at 8:47 AM, James G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I have been getting this error on the production server after rails was  
> updated to 2.0.2 and moreover this worked perfectly in the development  
> mode. This crash occurs when no one is using the app for an hour or so.  
> This is the error that I get in the logs. (nohup.out file). The  
> production log doesnt show anything unusual. Please help me out guys.  
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/…/lib/mongrel/rails.rb:98:in  
> `reload!': undefined method `reset\_application!’ for  
> ActionController::Dispatcher:Class (NoMethodError)  
> from

It seems you’re getting a restart/reload signal to the mongrel  
process, and it is trying to reload the Rails environment calling the  
reset\_application! method of ActionController::Dispatcher

There is no ActionController::Dispatcher, but there is a Dispatcher in  
the global namespace (::Dispatcher)?

I cannot test it since Windows don’t generate the HUP signal required  
for this, but I think I’m in the good path.

## HTH,

## Luis L. Multimedia systems

Human beings, who are almost unique in having the ability to learn from  
the experience of others, are also remarkable for their apparent  
disinclination to do so.  
Douglas Adams

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [May 21, 2008, 2:41pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/3 "2008-05-21T14:41:40Z")

</div>

The problem is that the method reset\_application! is no longer available  
in rails 2.0, but Mongrel 1.1.4 is still using it in  
lib/mongrel/rails.rb.

I think you should be able to fix this problem by commenting out the  
line

trap(“HUP”) { log “HUP signal received.”; reload! }

in /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb.

Till

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [May 21, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/4 "2008-05-21T16:14:52Z")

</div>

> > The problem is that the method reset\_application! is no longer available  
> > in rails 2.0, but Mongrel 1.1.4 is still using it in  
> > lib/mongrel/rails.rb.
> 
> Do we know if that needs a fix?

Surely it needs. My fix only is a hack. Probably reset\_application  
should be replaced with reload\_application, but I am not sure.

Till

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [May 21, 2008, 4:06pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/5 "2008-05-21T16:06:51Z")

</div>

On Wed, 21 May 2008 14:41:40 +0200  
Till M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The problem is that the method reset\_application! is no longer available  
> in rails 2.0, but Mongrel 1.1.4 is still using it in  
> lib/mongrel/rails.rb.

Do we know if that needs a fix?

–  
Zed A. Shaw

- Hate: [http://savingtheinternetwithhate.com/](http://savingtheinternetwithhate.com/)
- Good: [http://www.zedshaw.com/](http://www.zedshaw.com/)
- Evil: [http://yearofevil.com/](http://yearofevil.com/)

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [May 23, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/6 "2008-05-23T19:12:38Z")

</div>

This line is for the reload signal that always says “Might not work  
well” at startup, right? Did it used to work well? If nobody really  
uses it might be better to remove it; otherwise, we should try to get  
it to work well (which can be hellish with Rails’ dependency system).

Evan

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [May 23, 2008, 7:23pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/7 "2008-05-23T19:23:17Z")

</div>

On Fri, 23 May 2008 13:03:58 -0400  
“Evan W.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This line is for the reload signal that always says “Might not work  
> well” at startup, right? Did it used to work well? If nobody really  
> uses it might be better to remove it; otherwise, we should try to get  
> it to work well (which can be hellish with Rails’ dependency system).

It used to work OK, but it relies on the internal Rails reload  
mechanism used for development mode. It was intended to let you run  
your rails app in production and then hit it to kick it over rather  
than wait for a reload.

I’d say these days it’s not needed and it risks running into changes in  
how Rails operates. Probably worth dropping.

–  
Zed A. Shaw

- Hate: [http://savingtheinternetwithhate.com/](http://savingtheinternetwithhate.com/)
- Good: [http://www.zedshaw.com/](http://www.zedshaw.com/)
- Evil: [http://yearofevil.com/](http://yearofevil.com/)

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [May 23, 2008, 1:37pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/8 "2008-05-23T13:37:37Z")

</div>

I have tested out my fix and strangely, it did not work. I have now  
commented out the line containing reset\_application! in  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb.

Till

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [May 23, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/9 "2008-05-23T19:42:04Z")

</div>

Ok, good. That reload mechanism won’t work with most people’s  
Capistrano deploys anyway because the new app code is in a different  
working directory.

I’ll make a ticket to remove it for 1.2.

Evan

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [May 24, 2008, 7:38am UTC](https://www.ruby-forum.com/t/mongrel-crashes-in-production/132257/10 "2008-05-24T07:38:16Z")

</div>

> It used to work OK, but it relies on the internal Rails reload  
> mechanism used for development mode. It was intended to let you run  
> your rails app in production and then hit it to kick it over rather  
> than wait for a reload.

“It used to work OK” must refer to rails 1.2, since in rails 2.0, the  
method reset\_application! is simply not available, and therefore the  
reload NEVER works with rails 2.0.
