0

I'm getting 502s when I try to access any of the views that rely on auth (so /admin/login/, posting to my own /login/ page, etc). It's not occurring on any other views/requests.

Here's the nginx acess log:

GET /admin/login/ HTTP/1.1" 502 182 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0

Not much that's going to help me there. Here's an extract from the gunicorn log (the first line is a worker booting from when the last one died):

[2018-01-15 19:44:43 +0000] [4775] [INFO] Booting worker with pid: 4775
[2018-01-15 19:46:10 +0000] [4679] [CRITICAL] WORKER TIMEOUT (pid:4775)
[2018-01-15 19:46:10 +0000] [4775] [INFO] Worker exiting (pid: 4775)

What's causing me to lose workers and get 502s?

Edit: I'm using django 2.0.1, django-axes 4.0.1. I'm pretty sure this is an axes issue, but I don't know how to diagnose it.

Escher
  • 5,418
  • 12
  • 54
  • 101
  • Is this happening when requesting on localhost? or is this a remote ip request? – cowbert Jan 15 '18 at 21:20
  • Try enabling [DEBUG logging](https://docs.djangoproject.com/en/2.0/topics/logging/#examples) to get more information. – kichik Jan 15 '18 at 21:28

1 Answers1

0

Thanks to @kichik I enabled debug logging, and discovered that the views were throwing a "WSGIRequest has no attribute 'user'" exception due to me using middleware settings in pre-django2 format. This answer solved the issue.

Escher
  • 5,418
  • 12
  • 54
  • 101