Copying file://kitten.png [Content-Type=image/png]... ServiceException: 401 Anonymous caller does not have storage.objects.create access to the Google Cloud Storage object. Permission 'storage.objects.create' denied on resource (or it may not exist).
Steps to recreate it.
Having this issue while trying to copy a file to a new cloud storage bucket.
- Download a cat image This will download the image for us.
wget https://cloud.google.com/storage/images/kitten.png
- Try to copy the image to my cloud storage bucket
gsutil cp kitten.png gs://gcp-ifeanyi-tutorial
Now, we run into the issue stated above.
Steps to Resolve
gcloud auth login
- Follow the prompt (Type Y for yes)
- Copy the link provided in your browser
- Select your google account and grant permission
After following the prompt you will be provided with a key that looks like this
4/9ANIR-c9k6BnlT ..........
- Copy the key and paste it in your google cloud console
- Try to run the previous command again
gsutil cp kitten.png gs://gcp-ifeanyi-tutorial
Top comments (0)