ResumableUploadAbortException: 403 Insufficient Permission

20,015

Solution 1

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

Solution 2

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 

Solution 3

Are you using the default service account on the VM to access the bucket? That only has read scope by default. Try creating a VM with Read/Write scope.

Solution 4

When interacting with other Cloud Platform products, such as Google Cloud Storage (buckets), in non-interactive ways, such as from a VM instance, it's advisable to use scopes which in turn makes use of service accounts, the preferred way of authenticating VM / systems. Further reading can be found here.

Solution 5

let me put in a simpler steps if possible:

  1. From the console, stop the VM, edit access control and change "Storage" permission from READ to Write or full.
  2. Start the VM
  3. Flush the cache from the command line

    rm -r ~/.gsutil

This should be working.

Share:
20,015
superuserdo
Author by

superuserdo

CTO of Lux Nova |Creator of Wallfly

Updated on March 14, 2021

Comments

  • superuserdo
    superuserdo over 3 years

    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?