Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is this gcloud compute copy-files producing an error message?

When I execute the command

gcloud compute copy-files "C:\Users\fName lName\Desktop\testtext.txt" instancename:test.txt --zone europe-west1-a

I receive the error: "All sources must be local files when the destination is remote.".

Can anyone help me figure out what is wrong?

like image 361
Ross Manson Avatar asked Sep 09 '14 10:09

Ross Manson


2 Answers

In order to copy the file testtext.txt that you are specifying, you need to be in the path where that file is and specify its name while copying not the path.

Example: from your command line lets suppose you are in this path:

C:\Users\fName lName\Desktop\

Your command should be the following:

gcloud compute copy-files --zone europe-west1-b testtext.txt instancename:/PATH_where_you_want_the_file
like image 133
George Avatar answered Sep 29 '22 13:09

George


Thanks asking this! This appears to be a bug in gcloud that we're now tracking. The issue is that gcloud compute copy-files is interpreting the colon in C:\Users\fNam... as a part of a remote path. As suggested by George's answer, the work around is to avoid local paths containing the colon character.

like image 30
Jeffrey Vaughan Avatar answered Sep 29 '22 13:09

Jeffrey Vaughan