GoogleCloudPlatform / cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
Apache License 2.0
318 stars 59 forks source link

gcloud does not work in shell script #3063

Closed pmsuitehcl closed 2 years ago

pmsuitehcl commented 2 years ago

Running following command on MAC workstation in CLI works fine. If I run this command in my /Users/macuser, it works. I run it in any other directory, I get an error. gcloud source repos list --project $GCPPROJECT | awk '{print $1}' > repos.txt

Error: WARNING: Could not open the configuration file: [/Users/dkcmac/Documents/GitHub/.config/gcloud/configurations/config_default]. ERROR: (gcloud.source.repos.list) You do not currently have an active account selected. Please run:

$ gcloud auth login

to obtain new credentials.

If you have already logged in with a different account:

$ gcloud config set account ACCOUNT

to select an already authenticated account to use.

etanshaul commented 2 years ago

Hi @pmsuitehcl . Is this related to the Cloud Code IntelliJ integration? The issue appears to be gcloud (Cloud SDK) specific unless I missed something?

I wonder what running gcloud auth list from the directory where the gcloud source repos list command is failing returns?

Regardless, if not a Cloud Code issue, you'll get better support by filing this issue against cloud source repos: https://issuetracker.google.com/issues/new?component=187169&template=0

etanshaul commented 2 years ago

Hi @pmsuitehcl I'm going to close this issue. Feel free to follow up here if I misunderstood.