pkpio / fitbit-googlefit

Export Fitbit data to Google Fit. Unlike the alternatives such as fitnessyncer.com, this offers very fine intraday granularity (every minute/second data).
http://pkp.io/blog/fitbit-to-googlefit-sync/
GNU General Public License v3.0
491 stars 61 forks source link

Google API client error at first run #56

Closed cryptonightly closed 6 years ago

cryptonightly commented 6 years ago

Installed on Ubuntu 17.10. Authenticating Fitbit and Google went fine. Run app.py and it throws some errors. Here's the trace:

Traceback (most recent call last): File "/home/dave/fitbit-googlefit/remote.py", line 122, in CreateGoogleFitDataSource dataSourceId=self.convertor.GetDataSourceId(dataType)).execute() File "/home/dave/.local/lib/python3.5/site-packages/oauth2client/util.py", line 137, in positional_wrapper return wrapped(*args, **kwargs) File "/home/dave/.local/lib/python3.5/site-packages/googleapiclient/http.py", line 840, in execute raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: <HttpError 404 when requesting https://www.googleapis.com/fitness/v1/users/me/dataSources/raw%3Acom.google.step_count.delta%3A150600054579%3Afitbit%3Acharge-hr%3Aio.pkp.fbit-gfit?alt=json returned "DataSourceId not found: raw:com.google.step_count.delta:150600054579:fitbit:charge-hr:io.pkp.fbit-gfit">

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "app.py", line 110, in main() File "app.py", line 60, in main remote.CreateGoogleFitDataSource(dataType) File "/home/dave/fitbit-googlefit/remote.py", line 129, in CreateGoogleFitDataSource body=self.convertor.GetDataSource(dataType)).execute() File "/home/dave/.local/lib/python3.5/site-packages/oauth2client/util.py", line 137, in positional_wrapper return wrapped(*args, **kwargs) File "/home/dave/.local/lib/python3.5/site-packages/googleapiclient/http.py", line 840, in execute raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: <HttpError 409 when requesting https://www.googleapis.com/fitness/v1/users/me/dataSources?alt=json returned "Data Source: raw:com.google.step_count.delta:fitbit:charge-hr:io.pkp.fbit-gfit already exists">

Any idea what could be the problem? Thanks!

rtripodi commented 6 years ago

I am getting the same result on Windows:

googleapiclient.errors.HttpError: <HttpError 404 when requesting https://www.googleapis.com/fitness/v1/users/me/dataSources/raw%3Acom.google.step_count.delta%3A505231754316%3Afitbit%3Acharge-hr%3Aio.pkp.fbit-gfit?alt=json returned "DataSourceId not found: raw:com.google.step_count.delta:505231754316:fitbit:charge-hr:io.pkp.fbit-gfit">

and

googleapiclient.errors.HttpError: <HttpError 409 when requesting https://www.googleapis.com/fitness/v1/users/me/dataSources?alt=json returned "Data Source: raw:com.google.step_count.delta:fitbit:charge-hr:io.pkp.fbit-gfit already exists">

pkpio commented 6 years ago

Resolved in #58