Friday, August 3, 2018

[google-cloud-sql-discuss] Re: Couldn't connect to CloudSQL(accessNotConfigured)

Cloud SQL Proxy is built on the golang SDK. There is a standard way that all google cloud libraries load application credentials.
In this case it is likely related to your `$PWD/application_default_credentials.json`. You can fix the issue by running `gcloud auth application-default login`.

This will init the correct credentials into that file and you should be able to start the proxy with your user account and default credentials. Not with a service account.    

On Thursday, November 9, 2017 at 6:56:46 PM UTC-7, Fady (Google Cloud Platform) wrote:

Thank you for the information, and the troubleshooting steps. Following this help article, connecting a mysql client using the Cloud SQL Proxy requires enabling the Cloud SQL API and creating a service account with the " Role, Cloud SQL > Cloud SQL Client" privilege (least authority) before starting the proxy. " Alternatively, you can use the primitive Editor role by selecting Project > Editor, but the Editor role includes permissions across Google Cloud Platform."


On Thursday, November 9, 2017 at 6:41:42 PM UTC-5, Jiasheng Yang wrote:
Got it. It turns out to be that I cannot connect to CloudSQL through proxy.
I resolved that by creating a service account with owner access to this project and using -crendential_file when running the proxy.

On Wednesday, November 8, 2017 at 2:48:17 PM UTC-8, Jiasheng Yang wrote:
Hello all,

I was following the tutorial of running Django application on App Engine(https://cloud.google.com/python/django/appengine).
I downloaded the source code and followed this doc step by step but when I tried to "Run the app on your local computer", I got connection error from cloud_sql_proxy.
Error message like "couldn't connect to "django-mysite-185418:us-central1:instance-polls": ensure that the account has access to "django-mysite-185418:us-central1:instance-polls" (and make sure there's no typo in that name). Error during createEphemeral for django-mysite-185418:us-central1:instance-polls: googleapi: Error 403: Access Not Configured. Cloud SQL Administration API has not been used in project 563584335869 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/sqladmin.googleapis.com/overview?project=563584335869 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured".

To be specific, I couldn't connect with the CloudSQL database through mySql client. I got the same error message when executing "mysql --host 127.0.0.1 --user root --password" in console.

I'm pretty sure I have enable the Cloud SQL Admin API for long time in that project, and there's no typo in that name.

Any help would be treasured. Thanks a lot.

Jiasheng

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6aba7ef9-c3b0-40fc-9800-5de7bbd325a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment