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

Saving updates from fitbit giving 500 error when I save the updates

Hello,

 

I am able to get the response from the Fitbit API and even send an email to myself with the content of the request stream.

 

When I try to save this data to the database I see an error 500 in the Subscriber end point details page.

 

If I execute the same code using Postman it works. If I run the application locally and mock the data that is being posted it also works.

 

Does anyone have any ideas about what this could be?

 

Josh

Best Answer
0 Votes
6 REPLIES 6

Just to clarify: the subscriber details page says that your application returned a 500 error? If so, have you tried using Postman to immitate a Fitbit Subscriptions API notification request to your app in whatever environment you're seeing the 500? A 500 error would mean that your application failed to do something, which isn't something we can fix for you.

 

You could put Runscope Traffic Inspector between your app and the Fitbit Subscriptions API. Information is at https://dev.fitbit.com/docs/subscriptions-debugging/ . This will allow you to see the exact HTTP request sent by Fitbit and your applications exact HTTP response.

Best Answer
0 Votes

I did use postman to immitate the notification request. I will try to use runscope. I will post back what I find.

Best Answer
0 Votes

I see an error 500 in runscope but I don't see a reason. I just see the page returning.

Best Answer
0 Votes

So this confirms that your application is returning the 500 error to Fitbit. You'll need to debug your app's code to determine why it is returning a 500.

 

You can use Runscope's "replay" feature to retry the request to your application. It is easier than waiting for a new subscription notification from Fitbit.

Best Answer
0 Votes

I found my  problem. I am using the XML file as the return type and I had a case problem with the element names. When I emailed myself the document. the source of the email was all lower case and thus the problem.

 

Now I have it working on my side and everything is perfect. Yet when I log into the endpoint details I now am getting "SocketTimeoutException".

 

What do you think is causing that?

 

Josh

Best Answer
0 Votes

This means that your subscriber endpoint is taking longer than 3 seconds to close the connection and Fitbit aborted the request.

 

Your app needs to close the connection as soon as it receives the data. Your application should process the data received after closing the connection. If your programming language or framework cannot close the connection before processing the received data, your app will need to have a way to asynchronously process the data.

Best Answer
0 Votes