Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#27567 closed Bug (fixed)

Technical exception page/emails crash when the database is down

Reported by: Andreas Pelme Owned by: Andreas Pelme
Component: Error reporting Version: 1.10
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Andreas Pelme)

The technical 500 debug view and admin email shows the currently logged in user.

However, if the database is shutting down or is unavailable, anything that involves the ORM raises OperationalErrors. Turning request.user into a string in the template rendering will cause and exception which will cause the rendering to crash. Crashes in the error reporting itself cause hard to debug problem which can be hard to follow (especially for beginners).

I propose that we should catch exceptions when retrieving the user details and state that the user could not be shown while still showing everything else.

PR: https://github.com/django/django/pull/7656

Change History (5)

comment:1 Changed 3 years ago by Andreas Pelme

Description: modified (diff)
Owner: set to Andreas Pelme
Status: newassigned

comment:2 Changed 3 years ago by Claude Paroz

Triage Stage: UnreviewedAccepted
Version: 1.10master

comment:3 Changed 3 years ago by Tim Graham

Severity: NormalRelease blocker
Summary: Avoid crashes in tecnical exception page/emails when the database is downTechnical exception page/emails crash when the database is down
Version: master1.10

This qualifies for a backport to 1.10 since it's a bug in a new feature (#25037).

comment:4 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 373140b0:

Fixed #27567 -- Fixed crash in the debug view when request.user errors.

comment:5 Changed 3 years ago by Tim Graham <timograham@…>

In f1f4a7f5:

[1.10.x] Fixed #27567 -- Fixed crash in the debug view when request.user errors.

Backport of 373140b07aa452946ccb6d5b0317fa09ed5bbdc2 from master

Note: See TracTickets for help on using tickets.
Back to Top