Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests.system.test_bucket: test_new_bucket_with_autoclass failed #1106

Closed
flaky-bot bot opened this issue Aug 8, 2023 · 1 comment · Fixed by #1108
Closed

tests.system.test_bucket: test_new_bucket_with_autoclass failed #1106

flaky-bot bot opened this issue Aug 8, 2023 · 1 comment · Fixed by #1108
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@flaky-bot
Copy link

flaky-bot bot commented Aug 8, 2023

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: 663edc5
buildURL: Build Status, Sponge
status: failed

Test output
storage_client = 
buckets_to_delete = []
def test_new_bucket_with_autoclass(
    storage_client,
    buckets_to_delete,
):
    # Autoclass can be enabled/disabled via bucket create
    bucket_name = _helpers.unique_name("new-w-autoclass")
    bucket_obj = storage_client.bucket(bucket_name)
    bucket_obj.autoclass_enabled = True
    bucket = storage_client.create_bucket(bucket_obj)
    previous_toggle_time = bucket.autoclass_toggle_time
    buckets_to_delete.append(bucket)

    assert bucket.autoclass_enabled is True

    # Autoclass can be enabled/disabled via bucket patch
    bucket.autoclass_enabled = False
  bucket.patch()

tests/system/test_bucket.py:1062:


google/cloud/storage/bucket.py:1133: in patch
super(Bucket, self).patch(
google/cloud/storage/_helpers.py:345: in patch
api_response = client._patch_resource(
google/cloud/storage/client.py:482: in _patch_resource
return self._connection.api_request(
google/cloud/storage/_http.py:72: in api_request
return call()


self = <google.cloud.storage._http.Connection object at 0x7f76bface6d0>
method = 'PATCH', path = '/b/new-w-autoclass-1691508097531'
query_params = {'projection': 'full'}
data = '{"autoclass": {"enabled": false}}', content_type = 'application/json'
headers = None, api_base_url = None, api_version = None, expect_json = True
_target_object = <Bucket: new-w-autoclass-1691508097531>, timeout = 60
extra_api_info = 'gccl-invocation-id/90d8f41d-cbe6-41ec-88d3-5bedc0fd633c'

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,
    extra_api_info=None,
):
    """Make a request over the HTTP transport to the API.

    You shouldn't need to use this method, but if you plan to
    interact with the API using these primitives, this is the
    correct one to use.

    :type method: str
    :param method: The HTTP method name (ie, ``GET``, ``POST``, etc).
                   Required.

    :type path: str
    :param path: The path to the resource (ie, ``'/b/bucket-name'``).
                 Required.

    :type query_params: dict or list
    :param query_params: A dictionary of keys and values (or list of
                         key-value pairs) to insert into the query
                         string of the URL.

    :type data: str
    :param data: The data to send as the body of the request. Default is
                 the empty string.

    :type content_type: str
    :param content_type: The proper MIME type of the data provided. Default
                         is None.

    :type headers: dict
    :param headers: extra HTTP headers to be sent with the request.

    :type api_base_url: str
    :param api_base_url: The base URL for the API endpoint.
                         Typically you won't have to provide this.
                         Default is the standard API base URL.

    :type api_version: str
    :param api_version: The version of the API to call.  Typically
                        you shouldn't provide this and instead use
                        the default for the library.  Default is the
                        latest API version supported by
                        google-cloud-python.

    :type expect_json: bool
    :param expect_json: If True, this method will try to parse the
                        response as JSON and raise an exception if
                        that cannot be done.  Default is True.

    :type _target_object: :class:`object`
    :param _target_object:
        (Optional) Protected argument to be used by library callers. This
        can allow custom behavior, for example, to defer an HTTP request
        and complete initialization of the object at a later time.

    :type timeout: float or tuple
    :param timeout: (optional) The amount of time, in seconds, to wait
        for the server response.

        Can also be passed as a tuple (connect_timeout, read_timeout).
        See :meth:`requests.Session.request` documentation for details.

    :type extra_api_info: string
    :param extra_api_info: (optional) Extra api info to be appended to
        the X-Goog-API-Client header

    :raises ~google.cloud.exceptions.GoogleCloudError: if the response code
        is not 200 OK.
    :raises ValueError: if the response content type is not JSON.
    :rtype: dict or str
    :returns: The API response payload, either as a raw string or
              a dictionary if the response is valid JSON.
    """
    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,
        extra_api_info=extra_api_info,
    )

    if not 200 <= response.status_code < 300:
      raise exceptions.from_http_response(response)

E google.api_core.exceptions.ServiceUnavailable: 503 PATCH https://storage.googleapis.com/storage/v1/b/new-w-autoclass-1691508097531?projection=full&prettyPrint=false: We encountered an internal error. Please try again.

.nox/system-3-8/lib/python3.8/site-packages/google/cloud/_http/init.py:494: ServiceUnavailable

@flaky-bot flaky-bot bot added flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Aug 8, 2023
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Aug 8, 2023
@flaky-bot
Copy link
Author

flaky-bot bot commented Aug 8, 2023

Looks like this issue is flaky. 😟

I'm going to leave this open and stop commenting.

A human should fix and close this.


When run at the same commit (663edc5), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

@flaky-bot flaky-bot bot added the flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. label Aug 8, 2023
@cojenco cojenco self-assigned this Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant