python - Google Cloud Storage gives 'insufficient permissions' -


I am using:

  get_media (bucket = *, object = * , IfgenerationNotMatch = None, Generation = None, IfMetAgeneration Match = None, If Genation Match = None, If METGenNationName = None, Projection = None)  

Gives:

  Apiclient.errors.HttpError:  

code:

  service = build ('storage', 'v1') content = service.objects (). Get (bucket = item ['bucket'], object = item ['name']). Execute (http = http)  

Item from last (successful) call buckets.list This is why the service account Permission error for is so strange.

This is currently on my localhost, and my authentication is: Open

  (FILE_KEY, 'rb') as F: key = f.read () Credentials = SignedJet Encryption credentials (SERVICE_EMAIL_ADDRESS, key, scope = 'https: //www.googleapis.com/auth/devstorage.full_control'), http = httplib2.Http () http = Credential. Authorized (HT)  

Objects (and subsequently new test objects uploaded) are created with default ALL permissions. How does this service work for the account to get the file content?

Two things interfering here:

  1. List the objects in the bucket The READ permission is required on the bucket, while obtaining an object, even its metadata also requires READ permission on the object. It is possible that your service account has the first permission and not the second.
  2. Service accounts, by default, are not part of the project owner, editors or group of viewers, so they do not appear on default Bucket ACL or Object Default ACL.

Does your bucket ACL have a service account on it? What is the object Is the bucket's default object service service listed in ACL, so new objects are written that otherwise do not overlap, allow ACL service account to read it?

Also see.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -