Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exceptions thrown by displaying an error #1894

Merged
merged 1 commit into from
Oct 14, 2020

Conversation

robbkidd
Copy link
Contributor

@robbkidd robbkidd commented Oct 14, 2020

Description

Rails 5.1 deprecated using env in controllers in favor of using request.env. This change switches to that and removes some methods that are not currently used anywhere.

The result of the env calls being in place is that the exception show page rendering would itself cause an exception. Thus, all errors become 500 errors which heightens the suspicion of upstream proxies and load balancers. The application logs also get filled with stacktraces for simple non-matched route errors which no body has time for.

Related Issue

Somewhat related to #1891 and its increased 500 errors.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

Rails 5.1 deprecated using `env` in controllers in favor of using
`request.env`. This change switches to that and removes some methods
that are not currently used anywhere.

The result of the `env` calls being in place is that the exception show
page rendering would itself cause an exception. Thus, all errors become
500 errors which heightens the suspicion of upstream proxies and load
balancers. The application logs also get filled with stacktraces for
simple non-matched route errors which no body has time for.

Signed-off-by: Robb Kidd <rkidd@chef.io>
@robbkidd robbkidd added the Type: Bug Does not work as expected. label Oct 14, 2020
@robbkidd robbkidd self-assigned this Oct 14, 2020
@robbkidd robbkidd merged commit ee5b0f5 into master Oct 14, 2020
@robbkidd robbkidd deleted the robb/resolve-env-deprecation branch October 14, 2020 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant