This repository was archived by the owner on Dec 31, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 31, 2023. It is now read-only.
An error was reported getting the regions list (Invalid enum value SERVICE_ATTACHMENTS) #111
Copy link
Copy link
Closed
Labels
api: computeIssues related to the googleapis/python-compute API.Issues related to the googleapis/python-compute API.externalThis issue is blocked on a bug with the actual product.This issue is blocked on a bug with the actual product.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
- Search the issues already opened: https://github.com/googleapis/google-api-python-client/issues
- Search StackOverflow: https://stackoverflow.com/questions/tagged/google-cloud-platform+python
If you are still having issues, please be sure to include as much information as possible:
Environment details
- OS type and version:
- Python version:
Python 3.8.6 - pip version:
pip 20.2.1 google-api-python-clientversion:Version: 2.18.0
Steps to reproduce
- Create RegionsClient
- Get regions list
Code example
# example
regions_client = RegionsClient.from_service_account_info(info=info)
regions_client.list(project=project_id)Stack trace
# example
Traceback (most recent call last):
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/Users/jiangjiebai/Bai/Project/Jumpserver/jumpserver/apps/xpack/plugins/cloud/api.py", line 35, in get
validity, error = account.is_valid(return_tuples=True)
File "/Users/jiangjiebai/Bai/Project/Jumpserver/jumpserver/apps/xpack/plugins/cloud/models.py", line 60, in is_valid
return self.provider_instance.is_valid(return_tuples=return_tuples)
File "/Users/jiangjiebai/Bai/Project/Jumpserver/jumpserver/apps/xpack/plugins/cloud/providers/gcp.py", line 33, in is_valid
return self.get_regions()
File "/Users/jiangjiebai/Bai/Project/Jumpserver/jumpserver/apps/xpack/plugins/cloud/providers/gcp.py", line 29, in get_regions
regions = self.regions_client.list(project=self.project)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/google/cloud/compute_v1/services/regions/client.py", line 467, in list
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/google/api_core/gapic_v1/method.py", line 142, in __call__
return wrapped_func(*args, **kwargs)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/google/api_core/grpc_helpers.py", line 66, in error_remapped_callable
return callable_(*args, **kwargs)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/google/cloud/compute_v1/services/regions/transports/rest.py", line 202, in list
return compute.RegionList.from_json(
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/proto/message.py", line 374, in from_json
Parse(payload, instance._pb, ignore_unknown_fields=ignore_unknown_fields)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/google/protobuf/json_format.py", line 434, in Parse
return ParseDict(js, message, ignore_unknown_fields, descriptor_pool)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/google/protobuf/json_format.py", line 454, in ParseDict
parser.ConvertMessage(js_dict, message)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/google/protobuf/json_format.py", line 485, in ConvertMessage
self._ConvertFieldValuePair(value, message)
File "/Users/jiangjiebai/.virtualenv/corePy3.8/lib/python3.8/site-packages/google/protobuf/json_format.py", line 597, in _ConvertFieldValuePair
raise ParseError('Failed to parse {0} field: {1}.'.format(name, e))
google.protobuf.json_format.ParseError: Failed to parse items field: Failed to parse quotas field: Invalid enum value SERVICE_ATTACHMENTS for enum type google.cloud.compute.v1.Quota.Metric...
I checked v2.18.0 to add SERVICE_ATTACHMENTS option in file (compute.v1.json), but switch to V2.17.0 also reported the same error
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: computeIssues related to the googleapis/python-compute API.Issues related to the googleapis/python-compute API.externalThis issue is blocked on a bug with the actual product.This issue is blocked on a bug with the actual product.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
[-]An error was reported getting the regions list[/-][+]An error was reported getting the regions list (Invalid enum value SERVICE_ATTACHMENTS)[/+]busunkim96 commentedon Aug 30, 2021
Hi @baijiangjie,
Thank you for filing an issue.
From the code sample and stack trace you provided it looks like you're using
google-cloud-computeso I've transferred the issue to this repository.I'm able to reproduce the error locally with this sample and the latest version of
google-cloud-compute:I looked through the generated docstrings and https://googleapis.dev/python/compute/latest/compute_v1/types.html#google.cloud.compute_v1.types.Quota.Metric does not have
SERVICE_ATTACHMENTS. The discovery doc does have this enum value.@vchudnov-g @software-dov This looks like an instance of the unknown enum responses bug.
busunkim96 commentedon Aug 30, 2021
Triaged as P1 since it makes the function unusable until a new version of the library is released.
busunkim96 commentedon Sep 9, 2021
@vchudnov-g @vam-google Are there any plans to update the compute protos in https://github.com/googleapis/googleapis-discovery?
vchudnov-g commentedon Sep 9, 2021
@vam-google We should do that right away so we can re-generate updated libraries. We were already planning on having updated libraries by Monday in most languages.
vam-google commentedon Sep 10, 2021
@busunkim96 I'm working on regenerating compute protos right now. The clients generated from new protos should not have this problem anymore.
busunkim96 commentedon Sep 14, 2021
Marking as
externalsince the immediate fix is to re-generate the protos and the long-term fix is to fix the generator.vam-google commentedon Nov 22, 2021
This should have been fixed by #147