I have a Django app on Google App Engine app which is connected to a Google Cloud SQL, using the App Engine authentication.
Most of the time everything works fine, but from time to time the following exception is raised:
OperationalError: (2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 38")
According to the docs, this error is returned when:
If Google Cloud SQL rejects the connection, for example, because the IP address your client is connecting from is not authorized.
This doesn't make much sense in my case, because the authentication is done by the App Engine server.
What might cause these sporadic errors?