Cloud SQL Docker Proxy

146 views
Skip to first unread message

Louis-P. Lamoureux

unread,
May 27, 2020, 1:05:36 PM5/27/20
to Google Cloud SQL discuss

I am trying to connect to my Cloud SLQ (Postgres) instance from my local environment (OSX) using the Google Cloud SQL Docker Proxy as documented here. When running the proxy I get:

google: could not find default credentials.

Note that I am running gcloud on my local environment within the right project and having authenticated through the application-default login. I understand that in similar questions this is what solved the issue however this is not my case.

George (Cloud Platform Support)

unread,
May 27, 2020, 2:06:03 PM5/27/20
to Google Cloud SQL discuss
Hello Louis, 

You mention authentication by means of the application-default login. If you are trying to connect from your local environment, you need to create and use a service account, as documented on the page you linked to, sub-chapter Connecting a psql client using the proxy Docker image, paragraph 6. You must also have enabled the Cloud SQL Admin API.  

Louis-P. Lamoureux

unread,
May 27, 2020, 2:58:42 PM5/27/20
to google-cloud...@googlegroups.com
Thank you for your response George. 

I am indeed using the JSON key of a service account with attributed roles mentioned in the documentation (cloud sql admin). The Cloud SQL Admin API is also enabled.

Would you by any chance, have another lead ?

On Wed, May 27, 2020 at 2:06 PM 'George (Cloud Platform Support)' via Google Cloud SQL discuss <google-cloud...@googlegroups.com> wrote:
Hello Louis, 

You mention authentication by means of the application-default login. If you are trying to connect from your local environment, you need to create and use a service account, as documented on the page you linked to, sub-chapter Connecting a psql client using the proxy Docker image, paragraph 6. You must also have enabled the Cloud SQL Admin API.  

--
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-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/7f19c601-4346-4121-b04a-311e1ca443e5%40googlegroups.com.

Kurtis Van Gent

unread,
May 28, 2020, 11:31:25 AM5/28/20
to Google Cloud SQL discuss
I would suggest taking a look at the "Authorizing with the Cloud SQL proxy" page, which goes into detail on the different ways to pass credentials. 

If you are still having issues, I would suggest making sure to share the full command you are using to start the proxy, minus any instance names or other PII. 

Louis-P. Lamoureux

unread,
May 28, 2020, 11:40:12 AM5/28/20
to Google Cloud SQL discuss
Thank you. 

Specifying the absolute path of the key file solved my issue.

Louis
Reply all
Reply to author
Forward
0 new messages