GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — storage: some acl methods fail on empty (private) acl · Issue #652 · googleapis/google-cloud-python

storage: some acl methods fail on empty (private) acl #652

New issue
Copy link
New issue
Copy link
Closed
#682
Closed
storage: some acl methods fail on empty (private) acl#652
#682
Copy link
Assignees
tseaver
Labels
api: storageIssues related to the Cloud Storage API.
Milestone
Storage Stable

Description

@pdknsk
pdknsk
opened on Feb 16, 2015
Issue body actions

Easiest to set this up with gsutil. Please notice the verbose message.

$ gsutil defacl set private gs://bucket
Setting default object ACL on gs://bucket/...
$ gsutil defacl get gs://bucket
No default object ACL present for gs://bucket. This could occur if the default object ACL is private, in which case objects created in this bucket will be readable only by their creators.
[]

In particular acl.reload and acl.save don't work, probably others too.

>>> acl = storage.acl.DefaultObjectACL(bucket)
>>> acl.get_entities()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python2.7/site-packages/gcloud/storage/acl.py", line 358, in get_entities
    self._ensure_loaded()
  File "/home/user/.local/lib/python2.7/site-packages/gcloud/storage/acl.py", line 192, in _ensure_loaded
    self.reload()
  File "/home/user/.local/lib/python2.7/site-packages/gcloud/storage/acl.py", line 409, in reload
    for entry in found['items']:
KeyError: 'items'
>>> acl.get_entities()
[]
>>> acl.reload()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python2.7/site-packages/gcloud/storage/acl.py", line 409, in reload
    for entry in found['items']:
KeyError: 'items'
>>> acl.save()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python2.7/site-packages/gcloud/storage/acl.py", line 453, in save
    for entry in result[self._URL_PATH_ELEM]:
KeyError: 'defaultObjectAcl'

This works fine if the default ACL is set to project-private rather than private.

Activity

  1. dhermes commented on Feb 17, 2015

    @dhermes
    dhermes
    on Feb 17, 2015
    Contributor
    More actions

    @pdknsk Thanks again for the great report!

    I don't fully understand the meaning of private

    It seems this is fixed easily by replacing found['items'] with found.get('items', []) and replacing result[self._URL_PATH_ELEM] with result.get(self._URL_PATH_ELEM, []).


    Clarification: Are you authorized as yourself via gsutil when setting private?

    Are you authorized as a service account when using gcloud-python?

  2. dhermes
    added
    api: storageIssues related to the Cloud Storage API.
    on Feb 18, 2015
  3. dhermes
    modified the milestone: Storage Stable on Feb 18, 2015
  4. pdknsk commented on Feb 19, 2015

    @pdknsk
    pdknsk
    on Feb 19, 2015
    Author
    More actions

    It's a predefined ACL. I use the same owner account for both, set up with gcloud auth.

  5. dhermes commented on Feb 19, 2015

    @dhermes
    dhermes
    on Feb 19, 2015
    Contributor
    More actions

    @pdknsk Do you use gcloud auth with a user account (e.g. [email protected]) and then use a service account with gcloud-python?

  6. pdknsk commented on Feb 19, 2015

    @pdknsk
    pdknsk
    on Feb 19, 2015
    Author
    More actions

    Nope, it's a user account in both cases.

  7. tseaver
    self-assigned this
    on Feb 26, 2015
  8. tseaver
    closed this as completedin #682on Feb 26, 2015
  9. tseaver
    added a commit that references this issue on Feb 26, 2015

    Merge pull request #682 from tseaver/652-handle_empty_acls

    51e286f
  10. parthea
    added a commit that references this issue on Aug 21, 2025

    chore: [autoapprove] bump cryptography from 41.0.3 to 41.0.4 (#652)

    b7b7586
  11. parthea
    added 2 commits that reference this issue on Sep 16, 2025

    chore: [autoapprove] bump cryptography from 41.0.3 to 41.0.4 (#652)

    8232209

    build(deps): [autoapprove] bump cryptography from 41.0.0 to 41.0.2 (#652

    446f479
  12. parthea
    added 3 commits that reference this issue on Nov 22, 2025

    chore(deps): update dependency apache-beam to v2.41.0 (#652)

    1d04a18

    chore: Update gapic-generator-python to v1.6.1 (#652)

    d802857

    fix: refactor global cache to address concurrency and fault tolerance…

    80edb65
  13. parthea
    added 4 commits that reference this issue on Mar 6, 2026

    chore(deps): update dependency google-cloud-bigquery to v2.16.1 (#652)

    6a1951b

    fix: bump version number after 2.2.1b1 release (#652)

    b19525a

    tests: Add tests back that were removed in PR #652 (#664)

    4aaab48

    feat: add isolation level support and sample (#652)

    9bd80da
  14. parthea
    added a commit that references this issue on Sep 8, 2026

    docs: migrate code from googleapis/python-bigquery (#18303)

    23f9a74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

    Milestone

    • Storage Stable

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.