[GH-ISSUE #944] make_public fails due to ACL being NULL on buckets/blobs that are pre-loaded into the docker container #150

Closed
opened 2026-03-03 12:08:44 +03:00 by kerem · 0 comments
Owner

Originally created by @marcguidancenl on GitHub (Oct 6, 2022).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/944

I get an ACL error when using make_public on data that is used to initialize the docker container.

this is the sample python code:

    os.environ["STORAGE_EMULATOR_HOST"] = "http://0.0.0.0:4443"

    client = storage.Client(
        credentials=AnonymousCredentials(),
        project="test-project",
    )

    # initial bucket/file for docker image
    bucket_name = "sample-bucket"
    blob_name = "some_file.txt"

    # test
    bucket = client.get_bucket(bucket_name)
    blob = bucket.blob(blob_name)
    blob.make_public()  #             <<<<< this errors on None not being iterable
    blob.make_private()  #             <<<<< this too

this gives TypeError: 'NoneType' object is not iterable in google/cloud/storage/acl.py", line 398
(as far as I can tell this is somewhere in response.go from aclListResponse to getAccessControlsListFromObject, where it somehow returns {"items":null} instead of {"items":[]} ??)

Doing the same thing with a bucket and blob created from code works (when #943 is applied)


Originally posted by @marcguidancenl in https://github.com/fsouza/fake-gcs-server/issues/941#issuecomment-1269647236

Originally created by @marcguidancenl on GitHub (Oct 6, 2022). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/944 I get an ACL error when using make_public on data that is used to initialize the docker container. this is the sample python code: ```python os.environ["STORAGE_EMULATOR_HOST"] = "http://0.0.0.0:4443" client = storage.Client( credentials=AnonymousCredentials(), project="test-project", ) # initial bucket/file for docker image bucket_name = "sample-bucket" blob_name = "some_file.txt" # test bucket = client.get_bucket(bucket_name) blob = bucket.blob(blob_name) blob.make_public() # <<<<< this errors on None not being iterable blob.make_private() # <<<<< this too ``` this gives `TypeError: 'NoneType' object is not iterable` in google/cloud/storage/acl.py", line 398 (as far as I can tell this is somewhere in `response.go` from aclListResponse to getAccessControlsListFromObject, where it somehow returns {"items":null} instead of {"items":[]} ??) Doing the same thing with a bucket and blob created from code works (when #943 is applied) --- _Originally posted by @marcguidancenl in https://github.com/fsouza/fake-gcs-server/issues/941#issuecomment-1269647236_
kerem 2026-03-03 12:08:44 +03:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#150
No description provided.