I’m desperate. A few hours ago I was checking my server because we are
running a survey for a new client and everything looked good for that
app but I noticed another Rails app was quite large (twice as normal)
so I decided it was time for a restart. Big mistake. Upon restart the
application gave me a 500 error. Checking the logs I found a stack
level too deep error that after hours I still haven’t been able to
figure out. I need help desperately to get this app back on track. Has
anybody had a problem like this before? It looks like AC’s helpers.rb
and layout.rb are playing ping-pong over inherited
(inherited_without_layout and inherited_without_helper) and after a
while the stack is full and ruby calls it quits. PLEASE, HELP! This is
an application for one of our biggest clients and I need to get it
going ASAP. If you have any ideas please throw them my way. And if you
are confident you can solve this problem quickly for a fee we can
definitely work it out. My cell is 801-816-1870 and you can call me
anytime. And I do mean anytime. I really need to get this back up.
Here’s the log:
stack level too deep
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/helpers.rb:124:in inherited_without_layout' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/layout.rb:183:ininherited_without_helper’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/helpers.rb:124:in inherited_without_layout' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/layout.rb:183:ininherited_without_helper’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/helpers.rb:124:in inherited_without_layout' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/layout.rb:183:ininherited_without_helper’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/helpers.rb:124:in inherited_without_layout' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/layout.rb:183:ininherited_without_helper’
### ### ### this last two lines repeat about 2200 times each in the
Thanks for replying. Here’s the start of app/controllers/application.rb:
The filters added to this controller will be run for all controllers
in the application.
Likewise will all the methods added be available for all controllers.
class ApplicationController < ActionController::Base
So the third line is just the declaration of the class. BTW, I have
not changed this file in weeks so I’m not too worried about its
contents. Nevertheless, if this is what it takes I will play with it
uncommenting things until I can figure out what is going on.
I have been googling this for so long now and I have been able to find
only one other iincident in the mailing list that has the exact same
error. I have tried to contact the guy that posted about it but I
haven’t herad back from him yet. Here’s the link:
I have even commented out all the code inside the
ApplicationController class and still gives me that error. The funny
thing is that even if I do ‘script/console’ I get:
[root@s78835 current]# script/console
Loading development environment.
/home/iflo/domains/infocenter.iflo.com/current/vendor/rails/actionpack/lib/action_controller/helpers.rb:123:in
`inherited_without_layout’:SystemStackError: stack level too deep
Something tells me that I royally screwed. Have you seen something
like this situation happen to you? Any ideas would help.
Something tells me that I royally screwed. Have you seen something
like this situation happen to you? Any ideas would help.
Have you checked that you’re actually running the copy of Ruby that you
think you’re running, and that the hashbang lines in dispatch.* point to
that copy of Ruby?
This sounds to me like something the the system has changed.
Did you upgrade Rails on your machine since the application was
launched? If so, you might want to go back and freeze Rails to the
version the application was developed with
What OS are you using? A search on ‘rails stack level too deep’ suggests
that not all Linux versions has played well with Rails at all times.
What plugins do you use? Some plugins lags behind the Rails release
schedule.
Have you tried starting the application with webrick or mongrel? If this
works it suggests your setup is not 100% ok.
Good luck
Kasper
Adrian M. wrote:
I’m desperate. A few hours ago I was checking my server because we are
I tried freezing to the latest (1.1.4) but I will try freezing back to
see if that fix it. Should have thought of that. UPDATE: went back one
by to to 1.1.0 and still got that same error but on 1.1.0 got another
one in rails/railties/lib/initializer: undefined method
cache_template_extensions. Here the same error I got every time I
started the console after freezing to another version:
vendor/rails/actionpack/lib/action_controller/helpers.rb:123:in
`inherited_without_layout’:SystemStackError: stack level too deep
I’m running it on Red Hat Enterprise Linux ES release 4 (Nahant Update
3) both in a production and testing server. It’s been running just
fine for over a year now. I must say this is the first time that I
can’t seem to be able to get it back up.
I have only a few plugins: acts_as_ordered_list and nested_set
I have tried running it with mongrel and get the same problem. Heck,
even trying script/console gets me the same error.
Thanks for replying. I have not changed much code in the last while
and it was running fine until I restarted it so I would say there are
no recursive calls. The funny thing is that it nevers gets to do any
of my code, it dies when calling the application controller which,
btw, I’ve cleared of all my code and still does this.
This is running apache just as proxy for lighttpd running 5 processes.
I wish I could try this in my own computer but it is a large set of 13
applications sharing the db/sessions/etc. Kida complex to replicate.
Although I do have a full mirror server, testing, that I’ve been
playing with trying to figure it out.
Have you tried creating a brand new rails application (eg: rails
testapp) and just seeing if that will work? If not, then I suggest
switching to another user on the system and trying to create and run
another new rails application.
I had a similarly inexplicable (although with a different error)
problem a few months ago and the steps above led me to the answer:
Running a new app as a different user solved the problem. I had a
.gem directory in my user directory which somehow had gotten
corrupted.
The problem is knowing exactly what made the code (be it in gems or
somewhere) go corrupt and when it happenned and then you know where to
get the backup from (what date). The system has been running for days
in production mode so it did not know there was a problem until it was
restarted.