Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

gcloud projects list is always empty

When i am trying to access projects in my google cloud account using 

gcloud projects list

always getting the following

+ gcloud projects listListed 0 items. 

So I can't complete the steps  - and i can't set the project 

and in this step

gcloud config set project $MY_PROJECT

I got 

+ gcloud config set project #My_PROJECT Updated property [core/project].
WARNING: You do not appear to have access to project [#My_PROJECT] or it does not exist.

The following is steps in my pipeline

- step:
name: Test google auth
image: google/cloud-sdk:latest
- echo $KEY_FILE | base64 --decode --ignore-garbage > ~/google-key.json
- gcloud auth activate-service-account --key-file ~/google-key.json
- gcloud projects list
- gcloud config set project $MY_PROJECT
- gcloud container clusters get-credentials $MY_CLUSTER --region $REGION
- docker

- Is there any missing steps? or prerequists to link bitbucket to my google account?

2 answers

1 accepted

0 votes
Answer accepted

If you successfully activate the service account as follows:

gcloud auth activate-service-account --key-file service-account-key.json

and you can see it as the ACTIVE one after executing the following:

gcloud auth list

and still, get ZERO items

Listed 0 items.

after executing the following:

gcloud projects list


Try to add your service account as a member of your Organization beside the project and assign it a Viewer role.

Hi @HosamEmam ,

Thank you for the feedback!

Have you encoded and configured a $KEY_FILE properly?

Encode the private key

Pipelines does not currently support line breaks in environment variables, so base-64 encode the private key by running:


$ base64 -w 0 < google-key.json

$ base64 < google-key.json

It is encoded well as after decoding, I tried to read the result and found it correct, i encoded using windows - as the following example

certutil -encode data.txt tmp.b64 && findstr /v /c:- tmp.b64 > data.b64

 And i tried it without encoding just plain text and the same issue

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

405 views 13 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you