[Django] #34082: "mysql server has gone away" on 404, 403 or 401

11 views
Skip to first unread message

Django

unread,
Oct 10, 2022, 4:29:20 PM10/10/22
to django-...@googlegroups.com
#34082: "mysql server has gone away" on 404, 403 or 401
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
williamchevremont |
Type: Bug | Status: new
Component: Database | Version: 4.1
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Hi,

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.

Django

unread,
Oct 10, 2022, 4:33:01 PM10/10/22
to django-...@googlegroups.com
#34082: "mysql server has gone away" on 404, 403 or 401
-------------------------------------+-------------------------------------
Reporter: williamchevremont | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by williamchevremont):

* Attachment "mysql_gone_away.log" added.

Django

unread,
Oct 10, 2022, 4:33:19 PM10/10/22
to django-...@googlegroups.com
#34082: "mysql server has gone away" on 404, 403 or 401
-------------------------------------+-------------------------------------
Reporter: williamchevremont | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.2

(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by williamchevremont):

* version: 4.1 => 3.2


--
Ticket URL: <https://code.djangoproject.com/ticket/34082#comment:1>

Django

unread,
Oct 10, 2022, 8:06:09 PM10/10/22
to django-...@googlegroups.com
#34082: "mysql server has gone away" on 404, 403 or 401
-------------------------------------+-------------------------------------
Reporter: williamchevremont | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* 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>

Django

unread,
Jan 2, 2023, 4:21:57 PM1/2/23
to django-...@googlegroups.com
#34082: "mysql server has gone away" on 404, 403 or 401
-------------------------------------+-------------------------------------
Reporter: williamchevremont | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages