#27567: Avoid crashes in tecnical exception page/emails when the database is
down
---------------------------------+-----------------------------------------
Reporter: Andreas Pelme | Owner: Andreas Pelme
Type: Bug | Status: assigned
Component: Error reporting | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by Andreas Pelme):
* status: new => assigned
* owner: (none) => Andreas Pelme
Old description:
> 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 `OperationalError`s. 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.
>
> I have created a patch that fixes this issue, I will add a link to the PR
> shortly.
New description:
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 `OperationalError`s. 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
--
--
Ticket URL: <https://code.djangoproject.com/ticket/27567#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/063.e6f522b880579dd3d039cd8322b46b17%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.