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
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:
- Go to the Cloud Project IAM page (Left Menu > IAM & Admin > IAM)
- Look for the row with the robot account that is having the issue.
- It should say "Cloud SQL Client" on the role column.
- Click on it to open the dropdown
- Click on the 'Cloud SQL Client' role that is checked to uncheck it.
- Click the blue save button above.
- Verify that the service account is removed from the IAM page.
- Click the Add button above in the same page.
- Enter the service account email address and select the Cloud SQL Client role
- Click Add
- The service account should appear again in the the list.
Credits to Chees, but points are mine :P. Hope it solves your issue.