Danny G
Danny G

Reputation: 3779

Getting 500 error consistently on Google Sheets API

I am using the Google Sheets API and consistently getting the following error. I am only getting it for a specific sheet with a specific service key. My other credential is working just fine. Also the load relatively load from what I can tell. I'm not railing the API or anything.

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

Upvotes: 3

Views: 11911

Answers (3)

Emmanuel Murairi
Emmanuel Murairi

Reputation: 401

A workaround for this can be having a central sheet to update data from the Google Sheet API, then reference the range of this data using a formula like IMPORTRANGE on the sheet you need to have your charts and analysis. This way, the sheet that is accessed by the API won't have any chart and wouldn't have any issue.

Upvotes: 0

Alexei Masterov
Alexei Masterov

Reputation: 462

This has to do with their internal timeout. If an operation that you are trying to complete is taking longer, it will bail. Until they fix this a solution may be to reduce the size of data to make the operation quicker. In my case, I update the spreadsheet in smaller chunks.

Upvotes: 3

Danny G
Danny G

Reputation: 3779

I have found the culprit here. It looks like I had to remove two sheets with Pivot Tables on them referencing a sheet I was trying to query. Once I did that all is well now.

Upvotes: 2

Related Questions