0

I am trying to download multiple files from google cloud CLI using gsutil on Windows. The command, I used is

C:\Users\User>gsutil -m cp -r "gs://takeout-export-c98906c8-f41d-4702-a512-8a6affaffb1c/20220608T548213Z/Resource: -5623962341676446683" .
Copying gs://takeout-export-c98906c8-f41d-4702-a512-8a6affaffb1c/20220608T548213Z/Resource: -5623962341676446683/takeout-20220608T386412Z-001.zip...
[WinError 267] The directory name is invalid: '.\\Resource: -5623962341676446683'

CommandException: 1 file/object could not be transferred.

From the admin panel, I am able to access the folder 5623962341676446683 and its contents are present. The command is working fine for other folders. Can you please let me know probable reason for this error.

Thanks

Milind Deore
  • 2,887
  • 5
  • 25
  • 40
subbusam
  • 1
  • 1
  • Can you run the command with the debug flag `-d` to get more details about the error and update your post accordingly? `gsutil -d -m cp gs://` – someRandomDev Jun 15 '22 at 13:34
  • @someRandomDev, Thanks for your response. Got the following error message in debug. DEBUG: Exception stack trace: Traceback (most recent call last): raise CommandException('{count} file{pl}/object{pl} could ' gslib.exception.CommandException: CommandException: 1 file/object could not be transferred. CommandException: 1 file/object could not be transferred. – subbusam Jun 16 '22 at 05:39

1 Answers1

1

This is a known issue with files / folders containing colons (or a few other characters) on Windows machines, see issue logged here for details of a fix due for release soon.
Also see a previous answer here and (assuming none of the files in that bucket have invalid characters) try removing the colon from the downloaded folder with

gsutil -m cp -r "gs://takeout-export-c98906c8-f41d-4702-a512-8a6affaffb1c/20220608T548213Z/Resource: -5623962341676446683" "Resource -5623962341676446683"
PeteP
  • 541
  • 1
  • 3
  • 13
  • Thanks for the response. Tried removing the colon as suggested but it did not work. Got the following error. CommandException: No URLs matched: – subbusam Jun 16 '22 at 05:33
  • If you take the colon out of the gs:// URL then that would explain the new error. Can you try with the exact command from the answer and reply with the full error message please. – PeteP Jun 16 '22 at 09:37
  • Here an example as you requested: gsutil -m cp -r "takeout-export-597caf5b-33a6-40ab-93e6-5bfe0caa0cfe/20230704T101720Z/Resource: -5146311862594854620" "Resource -5146311862594854620" E:\Test CommandException: No URLs matched: takeout-export-597caf5b-33a6-40ab-93e6-5bfe0caa0cfe/20230704T101720Z/Resource: -5146311862594854620 CommandException: No URLs matched: Resource -5146311862594854620 CommandException: 2 files/objects could not be transferred. – Petar Enchev Jul 09 '23 at 05:46