Cannot connect to first generation sql instance from app engine

59 views
Skip to first unread message

Oki Dwi Saputro

unread,
Oct 4, 2017, 9:13:36 AM10/4/17
to Google App Engine
Hello, 

I was unable to connect to my cloud sql from google app engine. The string connection set as said in https://cloud.google.com/sql/docs/mysql/connect-app-engine#gaev1-csqlv1.

I follow google bookshelf tutorial for deploying app engine. This error occur :
"sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')

And I think this is the cause :

"2017/10/04 03:52:43 couldn't connect to "worklist-181810:us-central:worklistdb2": googleapi: Error 400: This operation isn"t valid for this instance., invalidOperation

What should I do?

Shaharia Azam

unread,
Oct 4, 2017, 10:35:21 AM10/4/17
to Google App Engine
Hello Oki Dwi,
SQL instance and bookshelf apps are in same project?

Did you check that the instance is running?

And can you share your query here please as well as the full connection string. Which language you were using?

I guess, your connection strings are not valid.

Thanks,
Shaharia

George (Cloud Platform Support)

unread,
Oct 4, 2017, 12:20:45 PM10/4/17
to Google App Engine
Hello Oki, 

The error described by string ”2013, 'Lost connection to MySQL server during query'” is typical of network issues. It is described more in detail on the "B.5.2.3 Lost connection to MySQL server" documentation page for MySQL, where possible remedies are listed as well. A significant passage is: "Usually it indicates network connectivity trouble and you should check the condition of your network if this error occurs frequently. If the error message includes “during query,” this is probably the case you are experiencing."

Does the error occur again when you move to a different place and connect to the Internet through a different network?
Reply all
Reply to author
Forward
0 new messages