Short Version:
I've had a working Dev image for some time. I recently `gcloud components update` to get to a more current version, as well as adding some new testing tools (for IaC solutions like chef, ansible, etc. using tools like kitchen (ruby) or molecule (python)). I am now facing an issue where my cli commands return: `You do not currently have an active account selected.` after having gone through the authentication flow via `gcloud auth application-default login`.
Details:
I have a script I run to initialize the testing environment with env variables. Part of the script checks for `~/.config/gcloud/application-default-credentials.json` and runs `gcloud auth application-default login` if the file is missing or sufficiently old. This has been working perfectly until recently. My testing tools are giving back errors when trying to run compute commands against the API. To troubleshoot, I tried running `gcloud compute instances list` and got the error `You do not currently have an active account selected.`.
I'm at a loss as to what the problem might be. Any help or guidance is greatly appreciated.
Solved! Go to Solution.
I've been over the docs, including the pages you referenced, for hours and hours trying to understand/solve this problem to no avail.
Then I stumbled on this:
"These credentials are not used by the gcloud CLI. For more ways to set up ADC, see Set up Application Default Credentials."
So - at least in current versions of the CLI, the Application-default credentials are ignored for CLI commands, but work for API commands that use the installed google python libraries. 😕
This was not presented very well in the documentation.