I'm facing an issue I don't find any solution on the web, nor similar
problem.
When my application raise some 404, 403 or 401 error, sometime, this lead
to a "mysql server has gone away" error, randomly. There is no error on
the mysql logs. The application run in a docker container, mysql server on
one other. Even the "mysql_server_has_gone_away" connection engine didn't
patch correctly the stuff. I can't upgrade to newer django version,
because of some third party libraries that are not yet compatible.
--
Ticket URL: <https://code.djangoproject.com/ticket/34082>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "mysql_gone_away.log" added.
* version: 4.1 => 3.2
--
Ticket URL: <https://code.djangoproject.com/ticket/34082#comment:1>
* status: new => closed
* resolution: => invalid
Comment:
This ticket tracker isn't the place to get help. See
TicketClosingReasons/UseSupportChannels.
--
Ticket URL: <https://code.djangoproject.com/ticket/34082#comment:2>
Comment (by Peter Tillema):
Hi! I'm not sure if this is still relevant for you, but my application got
this problem as well. The normal application running fine (with nginx and
gunicorn/uvicorn), but whenever I hit a non-existing page a 500 error was
thrown. I tried to restart the mysql service, but then I got even worse
problems. So I enabled heavy logging in mysql and then I found out I
missed quotes around `'init_command': 'SET sql_mode=STRICT_TRANS_TABLES'`
so it wasn't a string, but an invalid identifier. Fixing that problem
solved everything magically, and now the 404 pages properly throw a 404.
Maybe this helps?
--
Ticket URL: <https://code.djangoproject.com/ticket/34082#comment:3>