Skip to content

blob.make_public() not working #4078

@ndrbrt

Description

@ndrbrt
  1. OS type and version

macOS Sierra (10.12.6)

  1. Python version and virtual environment information python --version

venv - Python 3.6.1

  1. google-cloud-python version pip show google-cloud, pip show google-<service> or pip freeze

Name: google-cloud
Version: 0.26.1

  1. Stacktrace if available
Traceback (most recent call last):
[...]
File "<path-to-my-app>/views/__init__.py", line 64, in get_upload_url
    blob.make_public()
  File "<path-to-my-venv>/lib/python3.6/site-packages/google/cloud/storage/blob.py", line 1141, in make_public
    self.acl.all().grant_read()
  File "<path-to-my-venv>/lib/python3.6/site-packages/google/cloud/storage/acl.py", line 359, in all
    return self.entity('allUsers')
  File "<path-to-my-venv>/lib/python3.6/site-packages/google/cloud/storage/acl.py", line 314, in entity
    if self.has_entity(entity):
  File "<path-to-my-venv>/lib/python3.6/site-packages/google/cloud/storage/acl.py", line 265, in has_entity
    self._ensure_loaded()
  File "<path-to-my-venv>/lib/python3.6/site-packages/google/cloud/storage/acl.py", line 208, in _ensure_loaded
    self.reload()
  File "<path-to-my-venv>/lib/python3.6/site-packages/google/cloud/storage/acl.py", line 411, in reload
    found = client._connection.api_request(method='GET', path=path)
  File "<path-to-my-venv>/lib/python3.6/site-packages/google/cloud/_http.py", line 303, in api_request
    error_info=method + ' ' + url)
google.cloud.exceptions.NotFound: 404 Not Found (GET https://www.googleapis.com/storage/v1/b/<my-bucket>/o/<my-object>/acl)
  1. Steps to reproduce
  2. Code example
def example():
    storage_client = storage.Client()
    bucket = storage_client.bucket(bucket_name)
    blob = bucket.blob(blob_name)
    blob.make_public()
    upload_url = blob.create_resumable_upload_session()
    return upload_url

Everything works just fine without blob.make_public()

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions