Google Datastore returning “503 Backend Error”

2019-08-27 09:37发布

I'm sending the following request to the Google Datastore API, via the PHP client, and i'm getting a "503 Backend Error" without any other information. I tried the online client available here, but the error is the same. Maybe something is malformed on my request? The documentation wasn't very helpful:

    {
      "mode": "NON_TRANSACTIONAL",
      "mutation": {
        "upsert": [
          {
            "key": {
              "path": [
                {
                  "kind": "Log"
                }
              ]
            },
            "properties": {
              "event": {
                "indexed": false,
                "stringValue": "new_order"
              },
              "dataType": {
                "indexed": false,
                "stringValue": "test"
              }
            }
          }
        ]
      }
    }

Any ideas of what might be causing this behavior? Or how to enable more detailed feedback from the API?

1条回答
forever°为你锁心
2楼-- · 2019-08-27 09:47

When you perform POST https://www.googleapis.com/datastore/<APIversion>/datasets/<datasetId>/commit, make sure that if you created your project using the old Admin Console that your datasetId in the URL is the App Engine application ID, and that if you created your project using the Developer Console, that your datasetId is the project ID you see in the Developer Console.

Also, if you created your project through the new Developer Console, try toggling the API on and off.

Finally, check that you are completing the OAuth flow properly, all your client ID info makes sense, and that you are setting up the right scopes, etc...

查看更多
登录 后发表回答