Thursday, June 22, 2017

[google-cloud-sql-discuss] googleapi: Error 403: Access Not Configured. Cloud SQL Administration API has not been used in project


I have a 2nd gen google cloud sql instance running in project A which I would like to connect to from a google compute engine instance in project B via the cloudsql-proxy.
The instructions for doing so are here:
https://cloud.google.com/sql/docs/mysql/connect-compute-engine#gce-connect-proxy

I believe that I have followed these instructions precisely and yet I still get this error:

2017/06/23 01:14:41 couldn't connect to "INSTANCE-CONNECTION-NAME": ensure that the account has access to "INSTANCE-CONNECTION-NAME" (and make sure there's no typo in that name). Error during createEphemeral for INSTANCE-CONNECTION-NAME: googleapi: Error 403: Access Not Configured. Cloud SQL Administration API has not been used in project 000000000 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/sqladmin.googleapis.com/overview?project=000000000 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured


there is no typo in the INSTANCE-CONNECTION-NAME

I HAVE enabled the Cloud SQL API (It no longer appears to be named "Cloud SQL Administrator API")

I HAVE waited for many minutes for the action to propagate to our systems and retry.


One thing I did find very strange about the instructions is that I was requested to create service account explicitly for the cloudsql-proxy and to generate a JSON key for it, but there were no instructions on actually using either of these.


I did ensure that the service account of the compute engine (in project B) was listing in project A with the credential of Cloud SQL > Cloud SQL Client. (Note: It was already in there with a role of Owner)


The command to start the proxy was simply this:

./cloud_sql_proxy -instances=<INSTANCE_CONNECTION_NAME>=tcp:3306


What do I need to do to make this work?

--
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/34ed1f62-4224-4890-875f-a686d194eec3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment