Thomas Hutton
Thomas Hutton

Reputation: 803

(gcloud.compute.scp) Could not fetch resource

I'm using Google Cloud for the first time and I'm trying to upload a test file to my root folder on my instance. However, I'm getting this error:

ERROR: (gcloud.compute.scp) Could not fetch resource:
 - Invalid value '[ua2r-website]'. Values must match the following regular expression: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?'

I'm in the path for that file. Here's my command:

gcloud compute scp [testtext.txt] [ua2r-website]:~/

I've double-checked the spelling and the punctuation of the VM instance, and I can't find a difference.

Upvotes: 1

Views: 7191

Answers (3)

Akash Sharma
Akash Sharma

Reputation: 93

You can also drag and drop the files from your local computer filesystem to the open unix shell of your where your project is.

Upvotes: 0

Ayman Salama
Ayman Salama

Reputation: 449

You need to use gcloud auth login gcloud auth login - authorize gcloud to access the Cloud Platform with Google user credentials

write the command

gcloud auth login

then you will get a link to click on from GCP. you will get a code from the link , copy it back to the VM. then you will be authorized to do the operation. Here is more details

https://cloud.google.com/sdk/gcloud/reference/auth/login

Upvotes: 2

Will Faris
Will Faris

Reputation: 199

Remove the ['s and ]'s

gcloud compute scp testtext.txt ua2r-website:~/

Upvotes: 1

Related Questions