cloud-sql-proxy icon indicating copy to clipboard operation
cloud-sql-proxy copied to clipboard

Upgrading from 1.14 to 1.16 causes authError, Message: Invalid Credentials

Open carlos-cubas opened this issue 6 years ago • 27 comments

Recently I upgraded cloud-sql-proxy to 1.16 and spent most of my day figuring out what portion of my configuration i had screwed up. Rolling back to 1.14 resolves the problem... Here is what is shown in the logs:

E 2019-12-30T19:01:10.104576468Z Reason: authError, Message: Invalid Credentials
E 2019-12-30T19:01:10.104570780Z More details:
E 2019-12-30T19:01:10.104557726Z 	googleapi: Error 401: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
E 2019-12-30T19:01:10.104518343Z 2019/12/30 19:01:10 errors parsing config:

Perhaps there's some config parsing change introduced? This issue appears similar to #301

carlos-cubas avatar Dec 30 '19 19:12 carlos-cubas

Marking this bug as closed - while there has been some good discussion, but I think most of it is tangential to the original issue (which I think has been resolved)

kurtisvg avatar Apr 08 '20 16:04 kurtisvg

We have been getting this error lately in our case we are using a service account key for authentication and the issue happens randomly. In our case we are using the proxy on a Golang API so we are not relying on the proxy as a sidecar container and instead we are directly using the proxy Go package to communicate with CloudSQL.

github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/mysql
2020/06/12 20:18:50 failed to refresh the ephemeral certificate for [INSTANCE]
before expiring: googleapi: Error 401: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential.
See https://developers.google.com/identity/sign-in/web/devconsole-project.
More details:
Reason: authError, Message: Invalid Credentials

Hi @alejandro-delgado-garcia - please open a new issue as this is a different issue that just happens to be throwing the same error.

kurtisvg avatar Jun 12 '20 21:06 kurtisvg

@kurtisvg 1.16 also breaks essential workflows of using gcloud auth login to have credentials to use the proxy locally.

lozandier avatar Dec 01 '20 14:12 lozandier

@lozandier I don't think the v1.15 docker image even has gcloud installed, so I'm not really sure what you mean by "essential workflow". Regardless, it also sounds like a different issue than this one, so I'd suggest opening a new issue with more information on what you would like supported since this one is closed.

kurtisvg avatar Dec 01 '20 17:12 kurtisvg

I got same error . so, the recomend solution for production situations is adding --skip_failed_instance_config ? even thought, there is no --skip_failed_instance_config on the GCP document.

SpaceNet avatar Jan 06 '21 08:01 SpaceNet

I got same error . so, the recomend solution for production situations is adding --skip_failed_instance_config ? even thought, there is no --skip_failed_instance_config on the GCP document.

solved. It's my bad. I did not set serviceAccount on deployment yaml.

just needed setting KSA ( I'm using 1.17, not 1.16 )

    spec:
      serviceAccountName: <YOUR-KSA-NAME>

SpaceNet avatar Jan 06 '21 09:01 SpaceNet