flackdl / ifit-garmin-sync

Export iFit workouts to Garmin Connect
GNU General Public License v3.0
47 stars 10 forks source link

Not seeing any workouts from iFit #5

Closed wgtndan closed 3 years ago

wgtndan commented 3 years ago

Hi, Love what you've done here, but I've deployed in Heroku, configured login details for iFit and Garmin, hit the force button, but nothing further is happening... Unfortunately it keeps saying no workouts have been exported. I've checked this several times over a few hours, but I'm yet to see any change. Any ideas as to what could be going on? I don't seem to be able to find any logging output in Heroku that might help, is there any debug logging that can be enabled?

flackdl commented 3 years ago

To see the logs in Heroku, click the More button at the top right when you're logged into the dashboard.

image

Let me know what they say.

wgtndan commented 3 years ago

Ah, thanks for pointing that out! I've not made much use of Heroku as yet.

Looks like I've got auth issues with Garmin:

2021-06-07T00:46:16.953448+00:00 app[worker.1]: 2021-06-07 00:46:16,953 [CRITICAL] Login Failure: Authentification failed. 2021-06-07T00:46:16.954695+00:00 app[worker.1]: [2021-06-07 00:46:16,953: CRITICAL/ForkPoolWorker-8] Login Failure: Authentification failed. 2021-06-07T00:46:16.968159+00:00 app[worker.1]: [2021-06-07 00:46:16,957: ERROR/ForkPoolWorker-8] could not authenticate with garmin 2021-06-07T00:46:16.971489+00:00 app[worker.1]: [2021-06-07 00:46:16,971: ERROR/ForkPoolWorker-8] Task sync.tasks.sync[49675c7c-5eb8-40a8-8839-6f6332cd8928] raised unexpected: Exception('could not authenticate with garmin') 2021-06-07T00:46:16.971491+00:00 app[worker.1]: Traceback (most recent call last): 2021-06-07T00:46:16.971491+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/celery/app/trace.py", line 405, in trace_task 2021-06-07T00:46:16.971495+00:00 app[worker.1]: R = retval = fun(*args, *kwargs) 2021-06-07T00:46:16.971495+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/celery/app/trace.py", line 697, in __protected_call__ 2021-06-07T00:46:16.971495+00:00 app[worker.1]: return self.run(args, **kwargs) 2021-06-07T00:46:16.971496+00:00 app[worker.1]: File "/app/src/sync/tasks.py", line 17, in sync 2021-06-07T00:46:16.971497+00:00 app[worker.1]: return processor.process() 2021-06-07T00:46:16.971497+00:00 app[worker.1]: File "/app/src/sync/processor.py", line 47, in process 2021-06-07T00:46:16.971498+00:00 app[worker.1]: self._import(paths_exported) 2021-06-07T00:46:16.971498+00:00 app[worker.1]: File "/app/src/sync/processor.py", line 77, in _import 2021-06-07T00:46:16.971499+00:00 app[worker.1]: raise Exception('could not authenticate with garmin') 2021-06-07T00:46:16.971499+00:00 app[worker.1]: Exception: could not authenticate with garmin

I'll have another look at the credentials I'm using, but pretty sure the email/password I've entered are correct.

flackdl commented 3 years ago

Ok, so it seems it's not your fault at all. I'm using another package that actually sends the data to garmin and they're reporting authentication issues. See https://github.com/La0/garmin-uploader/issues/28. It looks like Garmin is trying to restrict access unfortunately. If you follow/watch that thread they may eventually come to a solution and then I can merge their work into this repository. Until then, we don't have a solution.

PeregrineFalcon commented 3 years ago

I've been following that other thread as well. I tried using the https://github.com/La0/garmin-uploader/archive/fix-cloudfare-errors.zip replacement for garmin-uploader. I can't verify that it is working yet.

The reason is that I'm getting, what appears to be, a separate error when trying to reach ifit. Did ifit change its Web API?

2021-06-18T14:59:51.605009+00:00 app[worker.1]: Traceback (most recent call last):
2021-06-18T14:59:51.605010+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/celery/app/trace.py", line 405, in trace_task
2021-06-18T14:59:51.605010+00:00 app[worker.1]:     R = retval = fun(*args, **kwargs)
2021-06-18T14:59:51.605011+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/celery/app/trace.py", line 697, in __protected_call__
2021-06-18T14:59:51.605011+00:00 app[worker.1]:     return self.run(*args, **kwargs)
2021-06-18T14:59:51.605012+00:00 app[worker.1]:   File "/app/src/sync/tasks.py", line 17, in sync
2021-06-18T14:59:51.605012+00:00 app[worker.1]:     return processor.process()
2021-06-18T14:59:51.605012+00:00 app[worker.1]:   File "/app/src/sync/processor.py", line 36, in process
2021-06-18T14:59:51.605013+00:00 app[worker.1]:     self._auth()
2021-06-18T14:59:51.605013+00:00 app[worker.1]:   File "/app/src/sync/processor.py", line 122, in _auth
2021-06-18T14:59:51.605014+00:00 app[worker.1]:     response.raise_for_status()
2021-06-18T14:59:51.605014+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/requests/models.py", line 943, in raise_for_status
2021-06-18T14:59:51.605014+00:00 app[worker.1]:     raise HTTPError(http_error_msg, response=self)
2021-06-18T14:59:51.605021+00:00 app[worker.1]: requests.exceptions.HTTPError: 504 Server Error: GATEWAY_TIMEOUT for url: https://www.ifit.com/web-api/login
PeregrineFalcon commented 3 years ago

I believe the fix is working from garmin-uploader. I've created a PR.

flackdl commented 3 years ago

@PeregrineFalcon thanks!