Skip to content

Random 501 errors when refreshing token #2276

Open

Description

@scleriot

Starting on Wednesday June 8th, we are getting randomly 501 errors when trying to refresh tokens:

{"error": {"code": 501, "status": "UNIMPLEMENTED", "message": "Operation is not implemented, or supported, or enabled."}}

Here is the code that generates this error:

$client = new \Google_Client();
$client->setApplicationName(config('google.APP_NAME'));
$client->setClientId(config('google.CLIENT_ID'));
$client->setClientSecret(config('google.CLIENT_SECRET'));
$client->setAccessType('offline');

$client->setAccessToken(TOKEN);

if ($client->isAccessTokenExpired()) {
      \Log::debug("access_token expired");
      $refresh_token = $client->getRefreshToken();
      $new_access = $client->fetchAccessTokenWithRefreshToken($refresh_token);

     // $new_access sometimes returns this error {"error": {"code": 501, "status": "UNIMPLEMENTED", "message": "Operation is not implemented, or supported, or enabled."}}
}

When we manually connect again the Google account (which generates and stores a new refresh token), the accounts refreshes correctly, and then after a few refresh fails again with a 501 error

Activity

  1. bshaffer commented on Jun 16, 2022

    @bshaffer
    Contributor

    Are you using Google Ads? If so, it could be related to this thread:

    With regards to your concern, it may be related to the release of our latest version v11, which was indeed released yesterday along with the deprecation of the previous release, v10.

    For further information about releases, deprecation and sunsets schedule, you can have a look here.

    It sounds like they released a new version of Ads, and so your error could potentially be coming from the Ads API rather than the token refreshing. It also sounds like the issue should already be resolved. Can you confirm if it's still happening?

  2. added
    type: questionRequest for information or clarification. Not an issue.
    on Jun 16, 2022
  3. scleriot commented on Jun 17, 2022

    @scleriot
    Author

    We are not using the Google Ads API (this issue happens when we refresh the token, which is API independant I guess?), but it might be the same issue impacting Google's infra?

    The issue is still happening randomly, during the night we again had accounts that could not refresh, with this 501 error

  4. bshaffer commented on Jul 18, 2022

    @bshaffer
    Contributor

    This is not an error message I've seen in the past, or am familiar with. This repo supports the client libraries only, and this appears to be a backend issue (the 5xx error is an error caused by the server), so there's not anything we can do. I know that's not a satisfying answer, so I'll keep digging. In the meantime, if you have a paid support plan with Google Cloud, you can open a support ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questionRequest for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions