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

2
  • 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://<path_to_file_in_bucket> Commented Jun 15, 2022 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. Commented Jun 16, 2022 at 5:39

1 Answer 1

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" 
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the response. Tried removing the colon as suggested but it did not work. Got the following error. CommandException: No URLs matched:
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.
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.