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

RetryErrors obscure actual errors - PubSub API #3905

Closed
ensonic opened this issue Aug 31, 2017 · 6 comments
Closed

RetryErrors obscure actual errors - PubSub API #3905

ensonic opened this issue Aug 31, 2017 · 6 comments
Assignees
Labels
api: core priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@ensonic
Copy link

ensonic commented Aug 31, 2017

Similar to #3083, #3900

2017-08-31T11:27:05.702393618Z   File "main.py", line 274, in start
2017-08-31T11:27:05.702404302Z     self.add_topic(topic, params)
2017-08-31T11:27:05.702413945Z   File "main.py", line 292, in add_topic
2017-08-31T11:27:05.702472288Z     self, self.robot_id, self.pubsub_client, self.network, topic, params)
2017-08-31T11:27:05.702501499Z   File "main.py", line 128, in __init__
2017-08-31T11:27:05.702572732Z     if not self.topic.exists():
2017-08-31T11:27:05.702583408Z   File "/usr/local/lib/python2.7/dist-packages/google/cloud/pubsub/topic.py", line 200, in exists
2017-08-31T11:27:05.702634134Z     api.topic_get(topic_path=self.full_name)
2017-08-31T11:27:05.702713982Z   File "/usr/local/lib/python2.7/dist-packages/google/cloud/pubsub/_gax.py", line 132, in topic_get
2017-08-31T11:27:05.702723634Z     topic_pb = self._gax_api.get_topic(topic_path)
2017-08-31T11:27:05.702729859Z   File "/usr/local/lib/python2.7/dist-packages/google/cloud/gapic/pubsub/v1/publisher_client.py", line 341, in get_topic
2017-08-31T11:27:05.702735747Z     return self._get_topic(request, options)
2017-08-31T11:27:05.702754679Z   File "/usr/local/lib/python2.7/dist-packages/google/gax/api_callable.py", line 428, in inner
2017-08-31T11:27:05.702802263Z     return api_caller(api_call, this_settings, request)
2017-08-31T11:27:05.70281738Z   File "/usr/local/lib/python2.7/dist-packages/google/gax/api_callable.py", line 416, in base_caller
2017-08-31T11:27:05.702884253Z     return api_call(*args)
2017-08-31T11:27:05.702898662Z   File "/usr/local/lib/python2.7/dist-packages/google/gax/api_callable.py", line 376, in inner
2017-08-31T11:27:05.703026405Z     return a_func(*args, **kwargs)
2017-08-31T11:27:05.703084222Z   File "/usr/local/lib/python2.7/dist-packages/google/gax/retry.py", line 127, in inner
2017-08-31T11:27:05.703115599Z     ' classified as transient', exception)
2017-08-31T11:27:05.703271957Z google.gax.errors.RetryError: GaxError(Exception occurred in retry method that was not classified as transient, caused by <_Rendezvous of RPC that terminated with (StatusCode.UNIMPLEMENTED, unknown service google.pubsub.v1.Publisher)>)
@lukesneeringer lukesneeringer added api: core gax priority: p2 Moderately-important priority. Fix may not be included in next release. labels Sep 1, 2017
@lukesneeringer
Copy link
Contributor

@jonparrott Dropping your name on this since your fixes to google.api.core will fix it.

@jlewi
Copy link

jlewi commented Sep 7, 2017

I hit the same problem with the Cloud Spanner API.

Specifically I was getting an INVALID_ARGUMENT trying to create an instance but no useful information about what was invalid. I ran the same command using gcloud and got a very helpful error message.

ERROR: (gcloud.spanner.instances.create) INVALID_ARGUMENT: Invalid CreateInstance request.
- '@type': type.googleapis.com/google.rpc.BadRequest
  fieldViolations:
  - description: 'Display name must be between 4-30 characters long. Got: Spanner
      instance used by jlewi@ for TensorBoard.'
    field: instance.display_name

I'm guessing the problem is in the gRPC layer and so all APIs will be affected. Would it make sense to change the title of the issue?

@theacodes
Copy link
Contributor

theacodes commented Sep 11, 2017

The new exception handling code will only raise a RetryError if retires retries are exhausted, otherwise, it will raise the real error.

Basically, this won't be an issue once we get gapic to use the new error code.

@robhaswell
Copy link

For near-future historians, this is how this programmer did meaningful error handling:

from google.gax.errors import RetryError
from grpc import StatusCode

try:
  leap_without_looking()
except RetryError as exc:
    if exc.cause.code() is not StatusCode.ALREADY_EXISTS:
        raise

@lukesneeringer lukesneeringer removed the gax label Nov 8, 2017
@chemelnucfin
Copy link
Contributor

@jonparrott May I ask if this is fixed now? I'm only asking because I think it might have been fixed...

@chemelnucfin chemelnucfin added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Jan 9, 2018
@theacodes
Copy link
Contributor

Yes gax is dead for pubsub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: core priority: p2 Moderately-important priority. Fix may not be included in 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

6 participants