This repository was archived by the owner on Dec 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
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-client
version: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!
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.