Greetings!
This was escalated all the way up to me as I often get the more challenging questions that don't seem to have an obvious issue. First, thank you so much for providing such detailed logs and information. I'll cover my observations followed by some next steps.
Observations
I double-checked a few things to make sure that things were working as expected:
- The account hierarchy has not changed in years, so nothing is shifting in the account hierarchy that could cause this.
- The login customer ID is indeed in the account hierarchy of the client account.
- The email you're using backing your refresh token does indeed have access to the login customer ID, and there have been no recent changes that I've seen.
I did notice in our logs that when an error does happen, there seems to be something wrong with the access token coming in, and it happens in clumps. Over the last 2 days, I haven't seen a single error for that login customer ID and customer ID and refresh token together. So, whatever you were seeing before, it appears you may have already solved it.
When this error does occur, I see ~500 user permission denied error per minute for a sustained period. I also see that when this happened 2 days ago, there was 1 successful request at 7:28, and then it failed for an hour for every request. Then, another successful request at 8:28, and then it failed for 1 hour, and then another successful request at 9:28, and then failed for an hour with the pattern repeating itself. This leads me to believe that there is an access token generated once an hour that works, but the requests that happen afterwards are not using that access token. Since an access token lasts for one hour, I don't believe this is a coincidence that the pattern repeats itself once an hour.
Next Steps
Please check to see if this continues to be an issue as I see that for about 2 days requests look successful. Also, please check your code to see what could be causing the access token to be generated at the same time every hour, but not used. Hopefully, the pattern I've given you will point you in the right direction as to what may be happening there when you look through your code base. Pro tip: Be on the lookout for race conditions (if that applies to your code) as I've seen this pattern before when someone had a race condition in their code when making use of the access token.
Best,
 |
| Nadine Wang |
| Google Ads API Team |
|
|
| |

ref:_00D1U1174p._5004Q2bzTE2:ref