Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

all gcloud compute commands fails - Invalid value for project: myproject

I'm just starting to play with Google Compute Engine. I can create instances using the web interface, but nothing works from the console:

gcloud compute instances create example-instance \
>     --machine-type n1-standard-1 \
>     --image debian-7 \
>     --zone europe-west1-b

ERROR: (gcloud.compute.instances.create) Failed to find image for alias [debian-7] in public image project [debian-cloud].
 - Invalid value for project: myproject

It looks like the image is available.

$ gcloud compute images list --project debian-cloud --no-standard-images
NAME                                              PROJECT      ALIAS              DEPRECATED STATUS
backports-debian-7-wheezy-v20150929               debian-cloud debian-7-backports            READY
beta-accounts-backports-debian-7-wheezy-v20150930 debian-cloud                               READY
beta-accounts-debian-8-jessie-v20150930           debian-cloud                               READY
debian-7-wheezy-v20150929                         debian-cloud debian-7                      READY
debian-8-jessie-v20150929                         debian-cloud debian-8                      READY

ERROR: (gcloud.compute.images.list) Some requests did not succeed: - Invalid value for project: myproject

I get an - Invalid value for project: myproject message for almost every gcloud command I try.

I can see myproject when I visit https://console.developers.google.com/project?authuser=1 And from the console:

$ gcloud config list project
[core]
project = myproject

What should I do to fix this?

like image 527
martins Avatar asked Dec 04 '22 02:12

martins


1 Answers

My mistake.

I mixed project_name and project_id.

 $ gcloud config set project PROJECT_ID  #(not project name)
like image 131
martins Avatar answered Jan 13 '23 09:01

martins