I'm working on an application upgraded to Rails 5.1, when an Internal Server Error occurs I get the exception message, but no stacktrace. For example:
Completed 500 Internal Server Error in 25ms (ActiveRecord: 13.5ms)
NoMethodError - undefined method `performer' for #<AssignSiteToStudy::Form>
Did you mean? performer_id:
There is no further information either in stdout or the development log file.
After some investigation it seems the that the problem occurs in the better_errors gem, specifially Rails.backtrace_cleaner.clean
removes all lines of the backtrace:
# better_errors-2.5.0/lib/better_errors/middleware.rb:
def backtrace_frames
if defined?(Rails) && defined?(Rails.backtrace_cleaner)
Rails.backtrace_cleaner.clean @error_page.backtrace_frames.map(&:to_s)
else
@error_page.backtrace_frames
end
end
Update: The actual error occurs with in an engine which is located outside the Rails root. It is referenced in Gemfile using path
, e.g. gem "my_engine", path: '~/dev/my_engine
.