Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

'test_new_bucket_w_ubla' flakes w/ 412 PreconditionFailed #577

Description

@tseaver

From this failed run:

____________________________test_new_bucket_w_ubla____________________________storage_client=<google.cloud.storage.client.Clientobjectat0x7fea45c62510>buckets_to_delete= [<Bucket: new-w-ubla-1630575370947>], blobs_to_delete= []
deftest_new_bucket_w_ubla(
storage_client, buckets_to_delete, blobs_to_delete,
):
bucket_name=_helpers.unique_name("new-w-ubla")
bucket=storage_client.bucket(bucket_name)
bucket.iam_configuration.uniform_bucket_level_access_enabled=True_helpers.retry_429_503(bucket.create)()
buckets_to_delete.append(bucket)
bucket_acl=bucket.aclwithpytest.raises(exceptions.BadRequest):
bucket_acl.reload()
bucket_acl.loaded=True# Fake that we somehow loaded the ACLbucket_acl.all().grant_read()
withpytest.raises(exceptions.BadRequest):
>bucket_acl.save()
tests/system/test_bucket.py:711:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
google/cloud/storage/acl.py:546: insaveself._save(acl, None, client, timeout=timeout)
google/cloud/storage/acl.py:510: in_saveretry=None,
google/cloud/storage/client.py:454: in_patch_resource_target_object=_target_object,
google/cloud/storage/_http.py:78: inapi_requestreturncall()
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self=<google.cloud.storage._http.Connectionobjectat0x7fea478ae390>method='PATCH', path='/b/new-w-ubla-1630575370947'query_params= {'projection': 'full'}
data='{"acl": [{"role": "READER", "entity": "allUsers"}]}'content_type='application/json', headers=None, api_base_url=Noneapi_version=None, expect_json=True, _target_object=None, timeout=60defapi_request(
self,
method,
path,
query_params=None,
data=None,
content_type=None,
headers=None,
api_base_url=None,
api_version=None,
expect_json=True,
_target_object=None,
timeout=_DEFAULT_TIMEOUT,
):
"""Make a request over the HTTP transport to the API. ... """url=self.build_api_url(
path=path,
query_params=query_params,
api_base_url=api_base_url,
api_version=api_version,
)
# Making the executive decision that any dictionary# data will be sent properly as JSON.ifdataandisinstance(data, dict):
data=json.dumps(data)
content_type="application/json"response=self._make_request(
method=method,
url=url,
data=data,
content_type=content_type,
headers=headers,
target_object=_target_object,
timeout=timeout,
)
ifnot200<=response.status_code<300:
>raiseexceptions.from_http_response(response)
EPreconditionFailed: 412PATCHhttps://storage.googleapis.com/storage/v1/b/new-w-ubla-1630575370947?projection=full&prettyPrint=false: Oneormoreusersnamedinthepolicydonotbelongtoapermittedcustomer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: storageIssues related to the googleapis/python-storage API.type: processA process-related concern. May include testing, release, or the like.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions