Alain,
On Monday, February 13, 2012 12:24:46 PM UTC-5, Alain Vongsouvanh wrote:
Unfortunately, a 503 means a temporary error in our backend which should resolve by itself over time.
You are right, 503 should resolve itself over time, but I will tell you my experience today.
I'm running my JSF web app via TomEE 1.6.0 snapshot (Tomcat 7.0.39), and dates are queued in an array, in my app, as endusers modify data related to certain dates (tour bus company software). To avoid too/so many updates to Google Calendar (since google calendar limits # of requests in a certain amount of time), as endusers are making tons of edits on calendar-based-data, I developed software that will strategically update google calendar with data via home-made timer software i developed within the app, and use of @Singleton @Schedule, and JMS (Apache ActiveMQ).
Anyway, the latest version of the google-calendar-update-software that I developed, in the web app, has been running pretty well for the last week or so; i have had to tweak the code numerous times to get it to run stable with google calendar API (v3) (delete events via retries and then add events to target date on the calendar). The many tweaks (over some # of months, off and on) has finally resulted in no 'duplicate events' on the calendar, since sometimes, dates are updated at different points in time (and at anytime in the future, for whatever reason).
So, today, I checked the server/error log to see how well the app was performing, and I saw 503 error code that occurred while event was being added to calendar, and then I saw that 2 different dates (3/1/2013 and 3/13/2013) had 'google-calendar-error', so those dates were re-added to queue (List<>), and @Schedule attempted to update google calendar with those dates (one-at-a-time), every 2 minutes. The error/server log only showed 503 error (json exception), once, in the log, but afters, the app just logged 'error' with no details. :(
So, since the 'error' was not correcting itself, I decided to shutdown the app server (tomee), and restart the app server, and then I opened Google-Calendar-Utililty page in the web app, which allows me to select dates, and google calendar will be updated with data related to the selected dates. So, I selected 3/1/2013, google calendar was updated successfully (without error 503), and then I selected 3/13/2013, and google calendar was updated successfully (without error 503).
I looked at audit trail in the app, and the data has not been changed that should have populated the 'addevent' request to google calendar.
However, if you manage to reproduce this error all the time, it would be really useful for us if you could post the request you send to the API so that we can look into it.
So, my next to-do tonight/now, is to log more details about the addEvent request as per what you mentioned above. maybe there was something terribly wrong with the request. I know I recently added eclipselink caching/query-hints/etc in/throughout the app, for performance reasons, maybe-just-maybe, the request either had a null value, or a bad 'location', as I do populate 'location' of the event, because my brothers love the Google Calendar feature that sends notification to Android devices and google calendar web-app notification that it is 'time to leave... to arrive at this location'. :)
Anyway, a big FYI... this error 503 occurred on a date that had many events. I may need to do what Kevin did/recommended in his last/latter response in this thread. Honestly, my addevent method is not doing any delete events. I delete events, first, in a loop with retries, until all events are deleted, and then I re-add events for the calendar date. The 'duplicate events' issue, that I mentioned earlier, always occurred on dates with many events, too. Today, I thought my app was running well, but enduser made some changes to data on a date with many events, the app attempted to update google calendar, accordingly, but error 503 was the result. I think this is the first time that I seen 503, and definitely the first time I seen my app, infinitely, attempt to update certain date(s) on calendar, result in error, and this behavior repeats every 2 minutes via @Schedule.
I am thinking of logging requests that resulted in error 503, and then 'not' re-add the 'date' back to the queue. Ultimately, it might be best for me to get a fresh new set of data and populate the 'addevent' request, accordingly, when error 503 occurs.
Thinking out loud. :)
Howard