Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

504 errors for Activities time series

I keep getting 504 Gateway time out errors for two specific resource paths: activities/activityCalories and activities/tracker/activityCalories. All others return almost instantly, even when retrieving more than a year of dates. For these other two, all retrievals have a noticeable lag of a couple seconds. They work until the dates are extended back to early June 2018. The specific date that triggers the 504 varies but is typically early June. It looks like similar lags have happened with activityCalories in the past. Is there a solution?

Best Answer
8 REPLIES 8

Hi @JPSnow

 

Are you still getting the 504 Gateway error messages?   If so, would you provide the API endpoint you're executing and is failing?

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes
Hey, 
Just came across this thread and I'm getting the same response from the activities/activityCalories endpoint on the API.  See below:
 
Jun 23, 2020, 3:42:00 PM - Gateway Timeout
 
The last time I was able to get data from the endpoint was 11th April 2020 so I know my codebase works but it seems the endpoint is returning a 504 like @JPSnow experiences.  Any help would be much appreciated @Gordon-C .
Best Answer
0 Votes

Hi @frogosteve ,

 

I believe the problem is related to the period length you've supplied in the endpoint.  By specifying "1y", the query is timing out.   I'll check to see why we are timing out.   In the meantime, I'd recommend you reduce the period to a smaller length of time, and execute the endpoint multiple times, adjusting the date each time, to get the year's worth of data.   I wasn't able to get 6m to work, but 1m and 3m did.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer

@frogosteve Did you get it to work? I updated all my stats this morning and was able to get multiple variables from the endpoint. OTOH, UA is a mess the past few days and I can’t get anything there.  

Best Answer
0 Votes

Hey @JPSnow ,

 

I just tried your suggestion to get the data out with a restricted time variable.  Only one I could get working was 1m and all the others failed with the same Gateway Timeout error.  Seems either it's a deprecated feature (maybe) or something funky happening in the API backend.     Some data is always better than nothing. 

 

Summary

     -  Failed
     -  Exception: Request failed for https://api.fitbit.com returned code 504. Truncated server response: Gateway Timeout
    - Failed
    - Exception: Request failed for https://api.fitbit.com returned code 504. Truncated server response: Gateway Timeout
    - Failed
    - Exception: Request failed for https://api.fitbit.com returned code 504. Truncated server response: Gateway Timeout

 

 

Best Answer
0 Votes

Also another quick update all the other activity endpoints work for the 1y variable but the activityCalories doesn't for some reason.

 

For example Distance will return the years worth of data.

 
Best Answer

Hi @frogosteve ...  Thank you for the additional information.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer

Hi @JPSnow and @frogosteve 

 

I've filed a defect to engineering to investigate the problem.  When I have more information, I'll reply to the forum post.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer