Skip to content

Google cloud python API returns None for blob.owner attribute #136

@jorvis

Description

@jorvis

I have created a Google bucket with "Fine-grained access control" and a few users have uploaded files to it. Using the python API I can't seem to get any information on who uploaded each. The blob.owner property just returns None:

sclient = storage.Client(project=GCLOUD_PROJECT)
bucket = storage.bucket.Bucket(client=sclient, name=GCLOUD_BUCKET)
blob = bucket.get_blob('foo.bar')
blob.reload()
print(blob.owner)

I'm calling reload() there because the documentation states it's required to pull some attributes from the server. All other properties I try print fine (size, updated, etag, md5_hash, etc.).

How can I recover the uploader identification?

Environment details

  • OS type and version: Ubuntu 18.04
  • Python version: 3.7.0
  • pip version: 18.1
  • google-cloud-storage version: 1.20.0

Steps to reproduce

  1. Place file in google bucket
  2. Attempt to use API to get owner information from the blob

Code example

    bucket = storage.bucket.Bucket(client=sclient, name=GCLOUD_BUCKET)
    blob = bucket.get_blob('foo.bar')
    blob.reload()
    print(blob.owner)

Stack trace

Doesn't error - just returns None

Metadata

Metadata

Labels

api: storageIssues related to the googleapis/python-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions