This may not be a problem. “This message is triggered when an existing connection is terminated improperly, which may look erroneous but is actually perfectly normal. Aborted connections happen because of unclean closure of connection(like when instances scale down and get terminated) or networking problem between the server and the client, but not because of the server.”

One thing I’d look at is whether your Django application is closing connections after using them. If a connection sits idle for a long time it’ll get killed by MySQL once the wait_timeout limit is reached. To get Django to close idle connections (instead of MySQL aborting them), set a CONN_MAX_AGE in your settings.py. Here’s the docs: https://docs.djangoproject.com/en/2.2/ref/databases/

Here’s a good resource on the error if you’re still having trouble debugging — https://www.percona.com/blog/2016/05/16/mysql-got-an-error-reading-communication-packet-errors/

Top writer in Technology | Backend Web Developer | bennettgarner.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store