1
votes

When I use the Google calendar API to create a new Calendar, I randomly get "Backend Error". Do you have any idea why ? Have you experienced the same behavior ?

First request :

POST https://www.googleapis.com/calendar/v3/calendars Authorization: Bearer ya29.UQEd-xxx Content-Type: application/json; charset=utf-8

{"summary":"My new calendar name"}

Google answer (around 20 seconds later):

{ "error": { "errors": [ { "domain": "global", "reason": "backendError", "message": "Backend Error" } ] "code": 503, "message": "Backend Error" } }

The calendar is not created

Another request :

POST https://www.googleapis.com/calendar/v3/calendars Authorization: Bearer ya29.UQEd-yyy Content-Type: application/json; charset=utf-8

{"summary":"My new calendar name"}

Google answer (around 5 seconds later) : 200 The calendar is created

3
When you are trying to create a calendar using calendar API, first time you got 503 and later it was succeed? Are you trying to create calendar for the same project in both the requests? - SGC
It succeed sometimes : sometimes at the first request, sometimes after few try in the same project. - Tom

3 Answers

5
votes

503 Service Unavailable
The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.

503 is a standard HTTP error that happens sometimes. Google ops probably has a graph somewhere showing the frequency of the errors and depending on their priorities may be working to fix it. You should catch the error and either give a human the chance to retry or implement exponential backoff.

Google Apps Calendar Resource API Limits and Quotas
For all errors that are time based (maximum of N things for N seconds per thread), especially the 503 status code errors, we recommend your code catch the exception and, using an exponential backoff algorithm, wait for a small delay before retrying the failed call.

0
votes

https://twitter.com/googlecalendar/with_replies Yes google calendar services are currently unavailable. Confirmed from twitter.

0
votes

For people visiting this in the future, I think that a 503 error can also be thrown when there are an insane number of events and Google Calendar simply chokes on them. I had a event that somehow got duplicated 18k times on a single day and event trying to use events.list with a maxResults of 1 resulted in a 503 error.