Pedro Henrique Cardoso
Pedro Henrique Cardoso

Reputation: 460

GCP gsutil set cors: No such file or directory

I've created a bucket and uploaded the cors.json file to it to set the bucket's cors policy. But when I run the command:

gsutil cors set cors.json gs://my_bucket

All I receive back is the message: No such file or directory.

Even when I run the command

gsutil ls gs://my_bucket

I get the file back:

gs://my_bucket/cors.json

Can someone help me to understand why the command gsutil cors set cors.json gs://my_bucket is finding my file?

Upvotes: 0

Views: 1820

Answers (1)

Pedro Henrique Cardoso
Pedro Henrique Cardoso

Reputation: 460

The problem is that I've created the cors.json file within the bucket, while it needed to be outside of it. So I just upload the file to the current path in the terminal and it worked fine.

Google's documentation says only to create a file, I think it should be more explicit.

Upvotes: 2

Related Questions