Closed
Bug 1883055
Opened 3 months ago
Closed 3 months ago
[traceback] AttributeError module 'django.middleware.csrf' has no attribute 'REASON_BAD_TOKEN'
Categories
(Socorro :: Webapp, defect, P2)
Socorro
Webapp
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: willkg, Assigned: willkg)
Details
Attachments
(1 file)
Sentry event: https://mozilla.sentry.io/issues/5027347663/events/2ebd7181b6844580ac5b56f62f31708e/
Traceback:
AttributeError: module 'django.middleware.csrf' has no attribute 'REASON_BAD_TOKEN'
File "django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "django/core/handlers/base.py", line 185, in _get_response
response = middleware_method(
File "__init__.py", line 126, in process_view
reason = django_csrf.REASON_BAD_TOKEN
Pretty sure this is related to us updating to Django 4.2. I bet the property is different now.
Grabbing this to look into.
Assignee | ||
Comment 1•3 months ago
|
||
I can reproduce this trivially in a local dev environment:
curl -X POST http://localhost:8000/
Assignee | ||
Comment 2•3 months ago
|
||
Assignee | ||
Comment 3•3 months ago
|
||
The problem was with django-session-csrf. That library isn't maintained anymore, so I opted to drop it.
Assignee | ||
Comment 4•3 months ago
|
||
Assignee | ||
Comment 5•3 months ago
|
||
Since I landed the fix, there have been no further errors. This is only a problem in our staging environment, so I'm going to close it out.
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•