gcloud compute ssh fails

Eric picture Eric · May 1, 2015 · Viewed 16.7k times · Source

I'm using Windows Server 2008.

on issuing gcloud compute ssh instance-1 --zone us-central1-a I receive the error:

ERROR: (gcloud.compute.ssh) Could not fetch instance:
 - Invalid value 'EFOnline'. Values must match the following regular expression: '(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](?:[-
a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))'

To be clear, I did do a gcloud auth login and received a successful 'you are now authenticated' My project Name is EFOnline my instance name is : instance-1 us-central1-a (cut and paste there)

So why the weird regex error?? Thanks

Answer

Jeffrey Vaughan picture Jeffrey Vaughan · May 1, 2015

Google Cloud projects have both a name and an id.

Your project ID is the string that uniquely identifies your project to Google. Project IDs show up in URI paths to cloud resources, and have to be "good" strings to put in URIs. You can find the project id for your project at the "Overview" in http://console.developers.google.com/ page.

The project name is a human-readable string that can, for example, contain spaces and some special characters.

GCloud (and most of the GCP tooling) uses project ID.

So... please try the following: Look up your project id here: http://console.developers.google.com/ then run

$ gcloud config set project <id>
$ gcloud compute ssh instance-1 --zone us-central1-a

Also, we're working on fixing the error message.