0
votes

I'm trying to download a .zip which is actually a backup of an application and I need to download it to my local system (MacBook), so I have connected to the instance via SSH, and then I ran this command as:

gcloud compute scp USER@INSTANCE:~/PATH_TO_LIVE_FILE /LOCAL_DIR

However, it's giving me the following error:

scp: /home/abdul/var/atlassian/application-data/jirasoftware/export/Jiraback_pythonest.zip: No such file or directory

ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [1].

But the file is there, I have checked it by even logging into that directory. I've tried Google's SSH client from the browser and its "Download File" option but it's still not working.

What can be wrong?

1
If you login to the compute engine and become the user that you are running SCP against, can you reach the target file? I'm thinking it might be a file or directory permission. Also run "ls /home/abdul/var/atlassian/application-data/jirasoftware/export/Jiraback_pythonest.zip" and make sure that doesn't show any errors/issues.Kolban
yes, I can see the file bit it's color is "read" mean I can it's name in red color, it it showing that something wrong with permissions.Abdul Rehman
Just to be sure, and I doubt it, but you aren't confusing the Compute Engine instance with the Cloud Shell, are you?Maxim
No, I’m not confused b/w CE Instance & cloud shell.Abdul Rehman

1 Answers

0
votes

I've tried to recreate your issue with my test instance following this documentation:

  1. create test instance
  2. ssh to instance via UI
  3. create test file

    user@instance-1:~$ touch test.txt
    user@instance-1:~$ echo test > test.txt
    user@instance-1:~$ ls -l | grep test
    -rw-r--r-- 1 user user 5 Jan 15 08:10 test.txt
    user@instance-1:~$ cat test.txt         
    test
    
  4. copy file to my local linux machine:

    $ gcloud compute scp seriir@instance-1:/home/user/test.txt ~/ --zone us-central1-a 
    Updating project ssh metadata...⠹Updated [https://www.googleapis.com/compute/v1/projects/test-prj].
    Updating project ssh metadata...done.                 
    Warning: Permanently added 'compute.6744042415812998745' (ECDSA) to the list of known hosts.
    test.txt                                            100%    5     0.0KB/s   00:00
    
  5. check at the local machine

    $ cat test.txt         
    test
    

It works on my test file.

At first, I advise to copy some test file from your VM to your local machine. If you have no problem with it, then try to copy your .zip file to another folder at VM and try gcloud compute scp command again.

Please update your post with full listing of your commands and outputs and also with ls -l of /home/abdul/var/atlassian/application-data/jirasoftware/export/Jiraback_pythonest.zip.