App engine unable to access sql cloud engine(mysql)

270 views
Skip to first unread message

Sangram Sinha

unread,
Jan 30, 2022, 1:12:58 PM1/30/22
to Google App Engine
Recently I have deployed my django application via gcp but I am unable to access mysql database from the app. It was working fine on a different project but don't know what is wrong with my latest project. I gave all the API access and permissions for xx...@appspot.gserviceaccount.com but still it is throwing me the same error.

Error Message:

OperationalError at /(2002, "Can't connect to local MySQL server through socket '/cloudsql/aevolveai-app-beta:us-central1:mysql-uat2' (111)")

I have attached the full error message.
Let me know what could be the reason behind this and advise how to resolve this.
error_djangoapp_gcloud.pdf

sivara...@google.com

unread,
Jan 30, 2022, 3:12:35 PM1/30/22
to Google App Engine
Hi,

I have a found a similar issue and solution to overcome the issue here [1]. Hope this helps in resolving the situation.


Thanks,
Sivaranjani

Sangram Sinha

unread,
Jan 31, 2022, 6:32:35 AM1/31/22
to google-a...@googlegroups.com
Hi,

The link you provided gave information about how to run it locally. But I am trying to run in from gcloud. I have actually followed all the steps mentioned in the link. I have enabled all the APIs and given access to my service account and user account. But still it fails. I don't know why it is not able to connect through cloudsql socket.

Please advise if there is any other way to get access to mysql from app engine

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/n-cxwHtwdC0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/f8981a55-1d4a-42e4-b4f5-0cada0c1ad79n%40googlegroups.com.

sivara...@google.com

unread,
Jan 31, 2022, 10:26:54 AM1/31/22
to Google App Engine
Hi Sinhasangram

I am sorry to hear that. Could you please create a case with all the information including your project information here[1] and one of our team members will look into the issue for you.

Thanks,
Sivaranjani

rwabukumba

unread,
Jan 31, 2022, 1:02:41 PM1/31/22
to Google App Engine
Hi, 

I second Sivaranjani's opinion that opening a support case, with details of your set up, is the best next course of action. 

Please do confirm from which service (e.g App Engine Standard or Flex) you are trying to connect to the Cloud SQL instance.

In the meantime, I recommend consulting this documentation that contains our guide on how to connect to a Cloud SQL instance from App Engine Standard and from App Engine Flex as this info may prove useful in resolving the issue on your end.

Sangram Sinha

unread,
Feb 1, 2022, 2:36:43 PM2/1/22
to Google App Engine
Hi,

Thank you to both of you, I have opened a case as suggested.

Will let you guys know once it is fixed

Thanks for your help
Reply all
Reply to author
Forward
0 new messages