Open GoogleCodeExporter opened 9 years ago
I'm somewhat surprised this copies as many files as it does. Most shells have
a limit on the number of positional argument that they accept. So when I tried
to reproduce, I got:
$ ls | wc -l
62125
$ gcloud compute copy-files --zone us-central1-f *.xml my-inst4:tmp
-bash: /Users/jeffvaughan/google-cloud-sdk/bin/gcloud: Argument list too long
$ bash --version
bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)
Copyright (C) 2007 Free Software Foundation, Inc.
I would suggest tarring and gz compressing the the xml files (use `tar czf`)
and transferring one larger file. This should be both more reliable and
perform better. You can uncompress on the destination using `gcloud compute
ssh --command 'cd somewhere; tar xzf`.
Regardless, it's bad if gcloud + the environment is letting this be a silent
failure. Did you get an error messages?
Original comment by jeffvaug...@google.com
on 8 Jun 2015 at 5:45
I tarred the files in one tar.bz2 file and uploaded it using copy-files when I
had noticed the missing files. I'd expect copy-files to throw an error or
reject the command but that never happened. It logged the regular info messages
to stdout so it was hard to see if there's an error for over 62K files. It
would be great to add the limitations of positional arguments and this issue to
the documentation since it failed silently which is not good.
Original comment by khalid3ahmed
on 8 Jun 2015 at 7:03
I agree that failing silently is bad behavior. Are you not getting any output
from your shell about in this case? I've been able to reproduce: files don't
copy + an error from bash. I haven't been able to reproduce files don't + no
error.
What shell and os are you using?
Original comment by jeffvaug...@google.com
on 8 Jun 2015 at 7:15
I just spotted an error message that says: ERROR: (gcloud.compute.copy-files)
[/usr/bin/scp] exited with return code [1]. Unfortunately, I can not tell if
there are more error messages like this because it's beyond the scrollback
buffer size of tmux.
I'm using Bash, Debian 7
$ bash --version
GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
Original comment by khalid3ahmed
on 8 Jun 2015 at 7:39
Hmmm, do you know or could you check what the the exit code for gcloud overall
was? (I.e. from running `echo $?` after the copy?)
Original comment by jeffvaug...@google.com
on 9 Jun 2015 at 3:06
Original issue reported on code.google.com by
khalid3ahmed
on 6 Jun 2015 at 3:06