I am using Google Cloud Storage and Google Compute Engine and am trying to upload to my bucket from my VM. My bucket has read/write permissions and so does anyone that has access to it. They are labeled as Owner. I can download from my bucket fine. When I try to upload to my bucket, this is the error I get. ResumableUploadAbortException: 403 Insufficient Permission
. I am unsure as to why this is the case? Any clues?
Change the Cloud API access scope of the VM to allow read/write on Storage. This is in the "Access scopes" section of the VM settings. Your VM needs to be stopped to do this.
0. Stop VM instance
1. Open VM instance details
2. Press "Edit"
3. Change Cloud API access scope--> "Allow full access to all cloud APIs"
https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#changeserviceaccountandscopes
IMPORTANT!!
Note per this comment on a related post that you may need to delete the credentials in ~/.gsutil
after definint the new scope.
# VM instance console
sudo rm -r ~/.gsutil
On the GCE instance run the following to set up: There is no need restart Compute Engine,
gcloud init
Output will be something like this.
Choose the account you would like to use to perform operations for this configuration:
[1] [email protected]
[2] Log in with a new account
Please enter your numeric choice: 1
Choose number 1 to use a service account. If this is a shared machine and you log in with your personal account, your credentials could be used by anyone else on the machine. For more detail Read here
If you have already initialize gcloud you do not want reinitialize.
gcloud auth login
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With