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

ListAccessibleCustomers is taking approx 60 min before giving exception if called with incorrect Refresh Token #595

Closed
AnuragKSinha opened this issue Mar 23, 2022 · 1 comment
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@AnuragKSinha
Copy link

Describe the bug:
When we are using an incorrect refresh token or expired refresh token it takes a lot of time before giving an exception(60 mins approx or even more) and hence causing a 504 TIMEOUT. Also, there is a limitation on the number of refresh tokens that we can create which is at max 50 refresh tokens at a time and if we create a new 51st refresh token then the oldest one will expire. And hence chances of getting into this issue is more likely.

Steps to Reproduce:

We tried calling listaccessiblecustomers . And we were expecting to get some invalid Exception in some ms or some secs so that we can log it for Error notification to our customers instead, after calling the API the call got stuck for almost 61 mins and then 504 TIMEOUT occurred.

Expected behavior:

we were expecting to get some invalid Exception in some ms or some secs so that we can log it for Error notification to our customers instead, after calling the API the call got stuck for almost 61 mins, and then 504 TIMEOUT occurred.

Client library version and API version:
Client library version:
Google Ads API version: v9
JDK version: 1.8

Request/Response Logs:

Anything else we should know about your project / environment:

@AnuragKSinha AnuragKSinha added bug Something isn't working triage labels Mar 23, 2022
@jradcliff
Copy link
Member

Hi,

The timeout issue you mentioned is due to #169, where we're coordinating on a fix with other dependency owners. In the meantime, if you want to proactively check if a refresh token is valid before issuing any requests, you could call refreshAccessToken() on the Credentials of the GoogleAdsClient. See the workaround in #169.

The 50 refresh tokens limit is per (GoogleAccount, ClientID) pair. Once you have a refresh token for such a pair, I'd recommend storing that refresh token securely somewhere, and then retrieving it from storage the next time you need to issue an API request on that user's behalf. That will be far more efficient and less cumbersome than obtaining a new refresh token every time.

Thanks,
Josh

@jradcliff jradcliff removed the triage label Mar 24, 2022
@jradcliff jradcliff self-assigned this Mar 24, 2022
@jradcliff jradcliff added the duplicate This issue or pull request already exists label Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants