Getting notAuthorized error with cloud_sql_proxy locally

前端 未结 6 2377
挽巷
挽巷 2021-02-13 20:34

I\'m trying to setup a connection locally for 2nd generation cloud sql instance.

Call for the proxy is

./cloud_sql_proxy -dir=/cloudsql -instances=status         


        
6条回答
  •  天命终不由人
    2021-02-13 21:09

    TL;DR: If your error log contains Error during createEphemeral.., please read on.

    Solution that works for me is from Github Cloud-SQL-Proxy Issue Tracker.

    It seems that you may have encountered a bug in backend that is triggered when there is an old service account with the same name. Follow the steps below to solve your issue:

    1. Go to the Cloud Project IAM page (Left Menu > IAM & Admin > IAM)
    2. Look for the row with the robot account that is having the issue.
    3. It should say "Cloud SQL Client" on the role column.
    4. Click on it to open the dropdown
    5. Click on the 'Cloud SQL Client' role that is checked to uncheck it.
    6. Click the blue save button above.
    7. Verify that the service account is removed from the IAM page.
    8. Click the Add button above in the same page.
    9. Enter the service account email address and select the Cloud SQL Client role
    10. Click Add
    11. The service account should appear again in the the list.

    Credits to Chees, but points are mine :P. Hope it solves your issue.

提交回复
热议问题