BetterErrors / better_errors

Better error page for Rack apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better Errors not working with Rack 2.0.7

csalvato opened this issue · comments

Thanks for maintaining this awesome gem! We use it daily!

Now, our problem:

We needed to update our sidekiq gem recently, and to do that we had to update to rack 2.0.7. We noticed that this caused better_errors to stop working:

image

We isolated this issue to upgrading Rack 2.0.7. If we do not update to Rack 2.0.7, better_error works fine. As soon as we update to that version (whether or not we update any other gems), it stops working.

I thought this might be an issue with Rack 2.0.7 directly and created a fresh Rails repo to test. At first I thought better errors wasn't working...but it turns out it is...

https://github.com/csalvato/better_errors_example

We must have a clash with another gem.

It sounds like the Rails repo you built works correctly? Could you provide a copy of the broken application's Gemfile? Anything we might use to narrow it down? It's also possible that it's caused by the order of the gems in the Gemfile. (I haven't seen such a problem yet, but it's theoretically possible.)

Thanks for your reply @RobinDaugherty!

Could you provide a copy of the broken application's Gemfile?

We're hesitant to share the Gemfile publicly, but I've sent it over to the email address listed in your profile.

Anything we might use to narrow it down?

In a fresh Rails repo I copied our Gemfile and Gemfile.lock files exactly (and created a skeleton config for any gems that required it). The gems in both bundles are exactly the same.

better_errors is working fine in the fresh Rails install, but not in our repo.

I'm thinking we may have some initializers/config that is possibly causing a problem. I don't have a great idea on where to start here aside from going through and disabling these files one by one and seeing if it gets fixed in our app's repo.

If you have any advice on how to best debug this, please let me know! We love better_errors and want to keep using it.

We just spent the better part of today debugging this. I stripped our entire app down to a single controller that raises an error, and we were able to isolate the problem down to our infrastructure configuration.

We found issue #270 in this repo, and applied the fix as stated here by @augnustin:

#270 (comment)

I'm still a bit confused as to why this was working fine in our repo until we updated to rack 2.0.7, since the issue is several years old 🤔

But at least our issue is resolved now!