My Business
3.3K members online now
3.3K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Error 500: "Internal error encountered."

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello.
Sometimes when I get list of account locations, I have this error:

"error": {
    "code": 500,
    "message": "Internal error encountered.",
    "errors": [
      {
        "message": "Internal error encountered.",
        "domain": "global",
        "reason": "backendError"
      }
    ],
    "status": "INTERNAL"
  }

Account:

accounts/116071422822387796596

This account contains more then 10000 locations. Sometimes I can get all locations and all work fine, sometimes I get this error.

I use similar code for request to API:

$locationsObjects = $service->accounts_locations->listAccountsLocations($accountId);
while ($locationsObjects->nextPageToken) {
    $locationsObjects = $service->accounts_locations->listAccountsLocations(
        $accountId,
        array('pageToken' => $locationsObjects->nextPageToken)
    );
}

Can you help me please?
1. What is a reason of this error?
2. Why is this error only sometimes?

3. Can I test similar queries with pageToken in Playground ?

https://mybusiness.googleapis.com/v3/accounts/116071422822387796596/locations?pageToken=ABHRLXUpRKbk49Take0Z-iYmTc4TzJvPrxi9yh2EEGE-dBugOG4PqbI

 

Thanks

1 Expert replyverified_user

Re: Error 500: "Internal error encountered."

Google Employee
# 2
Google Employee

Hi @Вячеслав Б,

 

  1. You most likely exceeded the Usage Limits of 5 queries per second (QPS) per project when making the GET request to list all locations for your large account. Please try to limit your API usage to 5 queries per second (QPS) per project when sending requests to avoid the 500 Internal Server Error.
  2. Because this 500 Internal Server Error may have been invoked when you exceeded your API Usage Limits.
  3. Yes you can use the OAuth 2.0 Playground for testing the GET request query to list the locations for the specified account with the pageSize and pageToken query parameters.

 

Thanks,

Shalini