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

Closed

Description

@tseaver

From this failed run:

____________________________ test_new_bucket_w_ubla ____________________________

storage_client = <google.cloud.storage.client.Client object at 0x7fea45c62510>
buckets_to_delete = [<Bucket: new-w-ubla-1630575370947>], blobs_to_delete = []

    def test_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.acl
        with pytest.raises(exceptions.BadRequest):
            bucket_acl.reload()

        bucket_acl.loaded = True  # Fake that we somehow loaded the ACL
        bucket_acl.all().grant_read()
        with pytest.raises(exceptions.BadRequest):
>           bucket_acl.save()

tests/system/test_bucket.py:711:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
google/cloud/storage/acl.py:546: in save
    self._save(acl, None, client, timeout=timeout)
google/cloud/storage/acl.py:510: in _save
    retry=None,
google/cloud/storage/client.py:454: in _patch_resource
    _target_object=_target_object,
google/cloud/storage/_http.py:78: in api_request
    return call()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <google.cloud.storage._http.Connection object at 0x7fea478ae390>
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 = None
api_version = None, expect_json = True, _target_object = None, timeout = 60

    def api_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.
        if data and isinstance(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,
        )

        if not 200 <= response.status_code < 300:
>           raise exceptions.from_http_response(response)
E           PreconditionFailed: 412 PATCH https://storage.googleapis.com/storage/v1/b/new-w-ubla-1630575370947?projection=full&prettyPrint=false: One or more users named in the policy do not belong to a permitted customer.

Activity

  1. added
    type: processA process-related concern. May include testing, release, or the like.
    on Sep 2, 2021
  2. tseaver commented on Sep 2, 2021

    @tseaver
    ContributorAuthor

    @frankyn, @andrewsg, @cojenco I can't see any reason for the error: has something on the back-end changed?

  3. added a commit that references this issue on Sep 2, 2021
    7cbcc5b
  4. added 2 commits that reference this issue on Oct 13, 2021
    e05151d
    11b92c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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