SystemStackError triggered by changing files while server is running? SystemStackError triggered by changing files while server is running? ruby-on-rails ruby-on-rails

SystemStackError triggered by changing files while server is running?


Debugging a stack level too deep error message in a rails app isn't easy, since the error could be because of a variety of reasons, and the error message isn't too helpful.

Some of the reasons leading to a stack level too deep error:

  1. Inconsistency in the gems & plugins and any other dependencies of the application.
  2. Code syntax error
  3. Inconsistency caused by applying db migrations erroneously.

If the error was happening on system boot up, then this tip would be very useful: http://www.datatravels.com/technotes/2012/07/11/awesome-debugging-for-rails-boot-stacklevel-too-de/

From the description, it looks like the app works fine for a while, and then starts crashing - so the above boot up case might not apply.

One way to go about figuring out the problem would to isolate the specific line/block of code that's causing the error by using printf debugging

Also, it might be worthwhile rolling back the changes and getting the system back to working state, and then put back the changes incrementally to isolate the root cause.

It is quite likely the bundle update did trigger the error in this case; so would be a good idea to check the newly added dependencies and see if they could be the culprit.