Hi, my django application is suddenly 502'ing on most page loads and it’s unclear how to debug it.
It was working fine yesterday and earlier today. I am able to also log in from the shell and send error emails (that was previously a problem where old Webfaction settings didn’t have the port set.)
My setup is:
- App running Python 3.6.8 and Django 1.11.29
- vanilla uwsgi settings (but also tried bumping workers and threads up from 2 to 3)
- nameservers for website are on cloudflare and I’m cname-ing to my myapp.opalstacked.com domain (in all examples “myapp” is my actual account name)
- the app is also running on myapp.opalstacked.com (without cloudflare where I am not seeing this problem)
502s are tricky to debug, because I believe they usually mean the app server is taking too long and nginx or whatever is proxying it cut it off, so logs are limited…
But looking at ~/logs/apps/myapp/uwsgi.log I’m seeing several successful page loads and then the last thing before the 502 is a warning (in this example the /tetris/ page loads but the next is a failure):
[pid: 88735|app: 0|req: 3/15] 127.0.0.1 () {68 vars in 1145 bytes}
[Thu Dec 31 15:47:42 2020] GET /tetris/ => generated 8187 bytes i
n 10 msecs (HTTP/1.1 200) 4 headers in 150 bytes (1 switches on co
re 2)
[WARNING] unable to add HTTP_CF_CONNECTING_IP=73.47.4.56 to uwsgi
packet, consider increasing buffer size
[WARNING] unable to add HTTP_CF_REQUEST_ID=075c28419e0000259844afd
000000001 to uwsgi packet, consider increasing buffer size
Might this warning be related to the 502? I don’t fully understand what is and isn’t configurable in the uwsgi.ini file (this page didn’t help with this particular issue). Is there a way I can try increasing the buffer size?