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

Broken listing zones in google-cloud-compute with protobuf=5.28.0 #13070

Open
1 task done
racinmat opened this issue Sep 9, 2024 · 2 comments
Open
1 task done

Broken listing zones in google-cloud-compute with protobuf=5.28.0 #13070

racinmat opened this issue Sep 9, 2024 · 2 comments
Labels
external This issue is blocked on a bug with the actual product. priority: p2 Moderately-important priority. Fix may not be included in next release. status: blocked Resolving the issue is dependent on other work. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@racinmat
Copy link

racinmat commented Sep 9, 2024

Determine this is the right repository

  • I determined this is the correct repository in which to report this bug.

Summary of the issue

Context
I tried to list zones in a project using google-cloud-compute SDK and it's broken with the protobuf=5.28.0.
I have replicated this behavior with clean python environment.

Expected Behavior:
The code from https://cloud.google.com/python/docs/reference/compute/latest/google.cloud.compute_v1.services.zones.ZonesClient#google_cloud_compute_v1_services_zones_ZonesClient_list works.

Actual Behavior:

(gcp_bug) PS C:\Projects\aiops-library\mlops\experiments\google-cloud-compute-bug> python get_zones.py
Traceback (most recent call last):
  File "C:\Projects\aiops-library\mlops\experiments\google-cloud-compute-bug\get_zones.py", line 18, in <module>
    page_result = client.list(request=request)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\E10270\.conda\envs\gcp_bug\Lib\site-packages\google\cloud\compute_v1\services\zones\client.py", line 867, in list
    response = rpc(
               ^^^^
  File "C:\Users\E10270\.conda\envs\gcp_bug\Lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in __call__
    return wrapped_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\E10270\.conda\envs\gcp_bug\Lib\site-packages\google\api_core\grpc_helpers.py", line 76, in error_remapped_callable
    return callable_(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\E10270\.conda\envs\gcp_bug\Lib\site-packages\google\cloud\compute_v1\services\zones\transports\rest.py", line 394, in __call__
    raise core_exceptions.from_http_response(response)
google.api_core.exceptions.BadRequest: 400 GET https://compute.googleapis.com/compute/v1/projects/xxx/zones?project=: Invalid resource field value in the request.

It all works with protobuf==5.27.4.
So there must be something broken in https://github.com/protocolbuffers/protobuf/releases/tag/v28.0

API client name and version

google-cloud-compute==1.19.2

Reproduction steps: code

file: get_zones.py

from google.cloud import compute_v1

# Create a client
client = compute_v1.ZonesClient()

# Initialize request argument(s)
request = compute_v1.ListZonesRequest(
    project="xxx",
)

# Make the request
page_result = client.list(request=request)
print(page_result)

Reproduction steps: supporting files

no files needed

Reproduction steps: actual results

see the stack trace above

Reproduction steps: expected results

it prints the zones

OS & version + platform

Windows 10

Python environment

python 3.11.9

Python dependencies

(gcp_bug) PS C:\Projects\aiops-library\mlops\experiments\google-cloud-compute-bug> pip freeze                                                
cachetools==5.5.0
certifi==2024.8.30
charset-normalizer==3.3.2
google-api-core==2.19.2
google-auth==2.34.0
google-cloud-compute==1.19.2
googleapis-common-protos==1.65.0
grpcio==1.66.1
grpcio-status==1.62.3
idna==3.8
proto-plus==1.24.0
protobuf==4.25.4
pyasn1==0.6.0
pyasn1_modules==0.4.0
requests==2.32.3
rsa==4.9
urllib3==2.2.2
@racinmat racinmat added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Sep 9, 2024
@parthea parthea added priority: p2 Moderately-important priority. Fix may not be included in next release. external This issue is blocked on a bug with the actual product. status: blocked Resolving the issue is dependent on other work. and removed triage me I really want to be triaged. labels Sep 9, 2024
@parthea
Copy link
Contributor

parthea commented Sep 9, 2024

Hi @racinmat,

Thanks for reporting this issue. The issue has been fixed upstream in protocolbuffers/protobuf#18159. We'll keep this issue open until a new version of protobuf is available.

@racinmat
Copy link
Author

racinmat commented Sep 9, 2024

Root cause bug in python is protocolbuffers/protobuf#18045 for cross-reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external This issue is blocked on a bug with the actual product. priority: p2 Moderately-important priority. Fix may not be included in next release. status: blocked Resolving the issue is dependent on other work. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants