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

Transcoding error information missing in version 2.9.0 #440

Closed
parthea opened this issue Sep 13, 2022 · 1 comment
Closed

Transcoding error information missing in version 2.9.0 #440

parthea opened this issue Sep 13, 2022 · 1 comment
Assignees
Labels
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

@parthea
Copy link
Collaborator

parthea commented Sep 13, 2022

A regression was introduced in PR #428 where information is missing in the transcoding error message here.

Using the following code for google-cloud-compute

from google.cloud import compute_v1

project = "project-XXX"
zone = "us-central1-a"

instance_groups_list_instances_request_resource = compute_v1.InstanceGroupsListInstancesRequest()
instance_groups_list_instances_request_resource.instance_state = "RUNNING"
instance_groups_client = compute_v1.InstanceGroupsClient()

instance_groups_list = instance_groups_client.list_instances(project=project, zone=zone,  instance_groups_list_instances_request_resource=instance_groups_list_instances_request_resource)

for instance in instance_groups_list:
    print(instance.name, instance.labels)

Using google-api-core==2.8.2, the error message is

ValueError: Request {'zone': 'us-central1-a', 'project': 'project-XXX', 'instance_groups_list_instances_request_resource': {'instance_state': 'RUNNING'}, 'instance_group': ''} does not match any URL path template in available HttpRule's ['/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/listInstances']

Using google-api-core==2.9.0, the error message is

Request {} does not match any URL path template in available HttpRule's ['/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/listInstances']
@parthea parthea added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Sep 13, 2022
vam-google added a commit to vam-google/python-api-core that referenced this issue Sep 13, 2022
This fixes googleapis#441 and googleapis#440. Also, with this change we stop outputting the whole request message in transcodding erro message to prevent leaking any confidential information from a request message in a form of an error in a log message.
parthea pushed a commit that referenced this issue Sep 14, 2022
* fix: Improve transcodding error message

This fixes #441 and #440. Also, with this change we stop outputting the whole request message in transcodding erro message to prevent leaking any confidential information from a request message in a form of an error in a log message.

* reformat code with black
parthea pushed a commit that referenced this issue Sep 14, 2022
* fix: Improve transcodding error message

This fixes #441 and #440. Also, with this change we stop outputting the whole request message in transcodding erro message to prevent leaking any confidential information from a request message in a form of an error in a log message.

* reformat code with black
@parthea
Copy link
Collaborator Author

parthea commented Sep 14, 2022

Fixed in 538df80

@parthea parthea closed this as completed Sep 14, 2022
vam-google added a commit that referenced this issue Sep 14, 2022
* fix: Improve transcodding error message

This fixes #441 and #440. Also, with this change we stop outputting the whole request message in transcodding erro message to prevent leaking any confidential information from a request message in a form of an error in a log message.

* reformat code with black

Co-authored-by: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

No branches or pull requests

2 participants