dzy
dzy

Reputation: 171

The mb command requires a URL that specifies a bucket

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?

Upvotes: 6

Views: 3923

Answers (2)

Brandon Yarbrough
Brandon Yarbrough

Reputation: 38399

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.

Upvotes: 0

mhouglum
mhouglum

Reputation: 2593

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.

Upvotes: 4

Related Questions