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 24
This repository was archived by the owner on Dec 31, 2023. It is now read-only.
Error listing zones #24
Copy link
Copy link
Closed
Labels
api: computeIssues related to the googleapis/python-compute API.Issues related to the googleapis/python-compute API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in 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
Environment details
- OS type and version:
- Python version: Python 3.8.7
- pip version: 21.0.1
google-cloud-computeversion: 0.2.0
Steps to reproduce
- Call list in zones client
Code example
from google.cloud import compute
client_zones = compute.ZonesClient()
client_zones.list(project='my-project') #errorStack trace
Traceback (most recent call last):
File "mypath/venv/lib/python3.8/site-packages/google/protobuf/json_format.py", line 524, in _ConvertFieldValuePair
raise ParseError(
google.protobuf.json_format.ParseError: Message type "google.cloud.compute.v1.Zone" has no field named "supportsPzs".
Available Fields(except extensions): ['availableCpuPlatforms', 'creationTimestamp', 'deprecated', 'description', 'id', 'kind', 'name', 'region', 'selfLink', 'status']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mypath/venv/lib/python3.8/site-packages/google/protobuf/json_format.py", line 574, in _ConvertFieldValuePair
self.ConvertMessage(item, sub_message)
File "mypath/venv/lib/python3.8/site-packages/google/protobuf/json_format.py", line 485, in ConvertMessage
self._ConvertFieldValuePair(value, message)
File "mypath/venv/lib/python3.8/site-packages/google/protobuf/json_format.py", line 599, in _ConvertFieldValuePair
raise ParseError(str(e))
google.protobuf.json_format.ParseError: Message type "google.cloud.compute.v1.Zone" has no field named "supportsPzs".
Available Fields(except extensions): ['availableCpuPlatforms', 'creationTimestamp', 'deprecated', 'description', 'id', 'kind', 'name', 'region', 'selfLink', 'status']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main2.py", line 20, in <module>
data = client_zones.list(project='magalu-cliente')
File "mypath/venv/lib/python3.8/site-packages/google/cloud/compute_v1/services/zones/client.py", line 470, in list
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
File "mypath/venv/lib/python3.8/site-packages/google/api_core/gapic_v1/method.py", line 145, in __call__
return wrapped_func(*args, **kwargs)
File "mypath/venv/lib/python3.8/site-packages/google/api_core/grpc_helpers.py", line 73, in error_remapped_callable
return callable_(*args, **kwargs)
File "mypath/venv/lib/python3.8/site-packages/google/cloud/compute_v1/services/zones/transports/rest.py", line 203, in list
return compute.ZoneList.from_json(response.content)
File "mypath/venv/lib/python3.8/site-packages/proto/message.py", line 369, in from_json
Parse(payload, instance._pb, ignore_unknown_fields=False) #checkpoint_alcides
File "mypath/venv/lib/python3.8/site-packages/google/protobuf/json_format.py", line 434, in Parse
return ParseDict(js, message, ignore_unknown_fields, descriptor_pool)
File "mypath/venv/lib/python3.8/site-packages/google/protobuf/json_format.py", line 454, in ParseDict
parser.ConvertMessage(js_dict, message)
File "mypath/venv/lib/python3.8/site-packages/google/protobuf/json_format.py", line 485, in ConvertMessage
self._ConvertFieldValuePair(value, message)
File "mypath/venv/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: Message type "google.cloud.compute.v1.Zone" has no field named "supportsPzs".
Available Fields(except extensions): ['availableCpuPlatforms', 'creationTimestamp', 'deprecated', 'description', 'id', 'kind', 'name', 'region', 'selfLink', 'status'].
Quick fix (maybe temporary)
Changing google/cloud/compute_v1/services/zones/transports/rest.py, line 203 from
return compute.ZoneList.from_json(response.content)to
return compute.ZoneList.from_json(response.content, ignore_unknown_fields=True)Metadata
Metadata
Assignees
Labels
api: computeIssues related to the googleapis/python-compute API.Issues related to the googleapis/python-compute API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in 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.