vinnylinux vinnylinux - 3 months ago 15
PHP Question

Google Datastore returning "503 Backend Error"

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?

Answer

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...

Comments