The mb command requires a URL that specifies a bucket
Asked Answered
S

2

6

I'm attempting to use the mb command to create a bucket on Google Cloud Storage but am getting

CommandException: The mb command requires a URL that specifies a bucket.

The odd part is that while

gsutil mb gs://foo/bar1 

returns this error,

gsutil ls gs://foo/bar2 

correctly lists files in gs://foo/bar2. I don't see how gs://foo/bar2 can be a valid URL while gs://foo/bar1 isn't. Is anyone able to shed some light here?

Sweetscented answered 5/11, 2018 at 5:16 Comment(0)
E
4

gs://foo/bar1 is a URL that specifies an object, bar1, within a bucket, foo. The gsutil mb command requires a URL signifying a bucket, e.g. gs://foo. The gsutil ls command can accept both bucket and object URLs.

Elicia answered 5/11, 2018 at 6:51 Comment(0)
S
0

gsutil mb makes a bucket. "gs://foo" specifies a bucket, specifically the bucket 'foo'. "gs://foo/bar1" specifies an object rather than just a bucket. "foo/bar1" isn't a bucket.

Sharilyn answered 6/11, 2018 at 5:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.