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

Infinite loop when using invalid refresh_token #99

Closed
evgeniy-b opened this issue Apr 29, 2019 · 7 comments
Closed

Infinite loop when using invalid refresh_token #99

evgeniy-b opened this issue Apr 29, 2019 · 7 comments
Labels
duplicate This issue or pull request already exists

Comments

@evgeniy-b
Copy link

When the refresh token is invalid, client goes into an infinite loop instead of raising exceptions:

[3] pry(main)> client.service(:Customer).list_accessible_customers

W, [2019-04-29T15:28:27.286127 #41]  WARN -- : CID: N/A, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v1.services.CustomerService/ListAccessibleCustomers, IsFault: yes
I, [2019-04-29T15:28:27.286886 #41]  INFO -- : Outgoing request: Headers: {"x-goog-api-client":"gl-ruby/2.6.3 gapic/1.1.1 gax/1.5.0 grpc/1.20.0","developer-token":"hidden"} Payload: {}
I, [2019-04-29T15:28:27.287015 #41]  INFO -- : Incoming response (errors):
Could not parse error details due to a malformed server response trailer.
W, [2019-04-29T15:28:27.488532 #41]  WARN -- : CID: N/A, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v1.services.CustomerService/ListAccessibleCustomers, IsFault: yes
I, [2019-04-29T15:28:27.488826 #41]  INFO -- : Outgoing request: Headers: {"x-goog-api-client":"gl-ruby/2.6.3 gapic/1.1.1 gax/1.5.0 grpc/1.20.0","developer-token":"hidden"} Payload: {}
I, [2019-04-29T15:28:27.489125 #41]  INFO -- : Incoming response (errors):
Could not parse error details due to a malformed server response trailer.
W, [2019-04-29T15:28:27.625463 #41]  WARN -- : CID: N/A, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v1.services.CustomerService/ListAccessibleCustomers, IsFault: yes
I, [2019-04-29T15:28:27.625792 #41]  INFO -- : Outgoing request: Headers: {"x-goog-api-client":"gl-ruby/2.6.3 gapic/1.1.1 gax/1.5.0 grpc/1.20.0","developer-token":"hidden"} Payload: {}
I, [2019-04-29T15:28:27.626775 #41]  INFO -- : Incoming response (errors):
Could not parse error details due to a malformed server response trailer.
@mcloonan
Copy link
Member

I'm also able to reproduce. I think this is an issue with the underlying gax library, since we just pass the refresh token along there. I'll check with that team to see what we can do.

@evgeniy-b
Copy link
Author

Thanks!
Also would be great to be able to have more authentication options than only refresh_token (without monkey-patching). For example, using simply access token.

@mcloonan
Copy link
Member

What is the use case where you'd want to provide your own access token? Access tokens are only good for an hour, and require a refresh token to generate, so it seems like the convenience of letting the library handle it for you would be pretty appealing.

@evgeniy-b
Copy link
Author

In our case we have one service responsible for storing/refreshing tokens and many other services using access tokens. So each service doesn't have to store all the secrets, handle errors and also access tokens are requested just once per hour.
It would be great not to limit the authorization options solely to refresh token since they are already there.

@mcloonan
Copy link
Member

That sounds reasonable. I think we can expose an interface to allow you to define your own credentials to be passed to the service. I'll open a new issue for that feature request, and we can leave this one for the infinite loop.

@qnm
Copy link

qnm commented Nov 2, 2020

Any updates on this? Any workarounds? I experienced it recently.

My intention is to use this in a worker queue, and if it loops infinitely I will be unable to to resolve it without intervention.

@mcloonan
Copy link
Member

Going to close this as a duplicate of issue #246 since that one has more specific information.

@mcloonan mcloonan added the duplicate This issue or pull request already exists label Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants