08-21-2022 04:07
08-21-2022 04:07
Hello all,
I made a web app running on Heroku, retrieving 30 min of Intraday HeartRate every 15 minutes in UTC format. It works correctly all day. With a little trick, the data "around midnight" is retrieved in 2 batches at 00:15. "Yesterday's" 23:45 - 23:59 and "Today's" 00:00 - 00:15, and then merged.
For some reason, the Heroku app has been crashing at 23:00 or 11 PM UTC many nights consecutively, and it seems to be due to an "error 500 / Internal Server Error" from the Fitbit WebAPI. I should implement better error management, I know 🙂 Fortunately the web app restarts after a while.
Sending the indentical request later (see example below) returns data normally, but the request fails when sent at 11 PM UTC.
Looking back in the logs, there have been random error 500 events earlier at various timepoints, usually during night hours. But now it has happenend regularly at 11 PM. Any idea ?
Thanks !
08-22-2022 07:57
08-22-2022 07:57
Hi @lsandini
I'm going to send you a private message to collect some information from you.
Gordon
09-01-2022 14:27
09-01-2022 14:27
Looking through our logs, the 500 errors seemed to be coming from activity endpoints not heart rate. The activities endpoints were using the "5min" detail which is supported for heart rate, not activity. I believe the error is caused by bad syntax..
09-03-2022 23:53
09-03-2022 23:53
Thank you Gordon for your patience, time and effort.
Strangely the error disappeared on the 27.8 --> 31.8 and reappeared since then. No syntax change on our side.
We modified the code, requesting 1min-detail data for both activity and heartrate endpoints, and delayed the calls so that the requested period ends at least 5 min before the request timepoint. Same error last night at 11 PM UTC.
I guess I'll have to handle the 500 so that my app doesn't crash, and check when is the next successful call.