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

Add RefreshError to retryable errors #312

Closed
baeminbo opened this issue Nov 24, 2021 · 4 comments
Closed

Add RefreshError to retryable errors #312

baeminbo opened this issue Nov 24, 2021 · 4 comments
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@baeminbo
Copy link

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.

Is your feature request related to a problem? Please describe.
RefreshError can be raised if GCE metadata server returns 500 error for service account token. But, we currently retry only for TransportError at retry.py.

This makes GCP libraries depending on the default retry fail by the transient auth error.

Describe the solution you'd like
Add auth_exceptions.RefreshError to if_transient_error.

Describe alternatives you've considered
Core API users can use a custom retry that handles RefreshError as retryable.

Additional context
See this screenshot of a RefreshError example that happened at GCS API in a Dataflow job.

@parthea parthea added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Nov 24, 2021
@tswast
Copy link
Contributor

tswast commented Nov 30, 2021

Duplicate of #223 ?

@baeminbo
Copy link
Author

baeminbo commented Dec 1, 2021

IIUC, #223 is about Unauthenticated by 401 from metadata server, which is caused by time sync. But, this is an issue with 500 error from metadata server. So, I think they are different issues.

@liu-du
Copy link

liu-du commented Jan 31, 2022

Hi,

I'm experiencing the same transient issues recently but in my case metadata server returns 404 not found. The error is:
google.auth.exceptions.RefreshError: ("Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=REDACTED&format=full from the Google Compute Engine metadata service. Status: 404 Response:\nb'Not Found\n'", <google.auth.transport.requests._Response object at 0x7f44b3dcf8d0>)

@parthea
Copy link
Collaborator

parthea commented Sep 1, 2023

Retry logic was added in googleapis/google-auth-library-python#1113. In the case of the 500 errors, there is an open question in googleapis/google-auth-library-python#984 requesting more information about how often they are occurring. Please open a new issue in https://github.com/googleapis/google-auth-library-python as that is where the retry logic should be improved.

@parthea parthea closed this as completed Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants