gsutil: some directories with brackets don't upload

I’m getting a “CommandException: No URLs matched:” message when trying to upload a directory that has brackets in the name.

$ mkdir 'hello [foo]'
$ touch hello\ \[foo\]/bar
$ gsutil cp -r 'hello [foo]' gs://test5903495034959
CommandException: No URLs matched: hello [foo]
$ mv hello\ \[foo\] hello
$ gsutil cp -r 'hello' gs://test5903495034959
Copying file://hello/bar [Content-Type=application/octet-stream]...

About this issue

  • Original URL
  • State: open
  • Created 11 years ago
  • Reactions: 3
  • Comments: 18 (4 by maintainers)

Most upvoted comments

I think all commands that are performed on a bucket that require listing of objects will fail when there is a single object in the bucket with a symbol of *,?,[,] would be nice if one could ignore unsupported objects

So my command:

gsutil cp -A "gs://MASKED/*/MASKED" .  

Fails with:

CommandException: Cloud folder gs://MASKED/MASKED/ contains a wildcard; gsutil does not currently support objects with wildcards in their name.

And not a single file downloads even though there are thousands which does not have unsupported filenames

FWIW, “gsutil du -s gs://bucket/” also fails to produce a sum if it contains a file containing a wildcard.