Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the origin of a "SystemStackError (stack level too deep)" in Rails 3.2

I migrate from Rails 3.0 to 3.2.

I have an error when I attempt to display a page, with only this small stacktrace :

    SystemStackError in UserController#show

    stack level too deep
    SystemStackError (stack level too deep):
      activesupport (3.2.1) lib/active_support/callbacks.rb:415


      Rendered /home/barbacan/.rvm/gems/ruby-1.9.2-head/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (55.3ms)
      Rendered /home/barbacan/.rvm/gems/ruby-1.9.2-head/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (4.0ms)
      Rendered /home/barbacan/.rvm/gems/ruby-1.9.2-head/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (61.4ms)

Log is not verbose.

This problem occurs in callbacks : it's dynamic code, and it's hard to debug.

Do you know tools, or methods, that would help me to debug and find source of this problem ?

Thanks!

EDIT :

In Ruby/RoR, there is a way to list all methods called, as a listing?

like image 547
barbacan Avatar asked Feb 08 '12 11:02

barbacan


1 Answers

You can try using Pry and railscast at http://railscasts.com/episodes/280-pry-with-rails, then you can set a breakpoint at a likely location and step through manually.

like image 167
Nick Avatar answered Sep 27 '22 19:09

Nick