Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suddenly stopped syncing with Garmin Connect #183

Closed
rotmaus opened this issue Nov 27, 2024 · 13 comments
Closed

Suddenly stopped syncing with Garmin Connect #183

rotmaus opened this issue Nov 27, 2024 · 13 comments

Comments

@rotmaus
Copy link

rotmaus commented Nov 27, 2024

Withings Sync suddenly stops syncing with Garmin Connect. I can successfully connect to Withings, but it will not sync with garmin. I receive the following error message:
2024-11-27 13:09:52,622 - root - INFO - No TrainerRoad username or a new measurement - skipping sync Traceback (most recent call last): File "/opt/anaconda3/bin/withings-sync", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/anaconda3/lib/python3.12/site-packages/withings_sync/sync.py", line 510, in main sync() File "/opt/anaconda3/lib/python3.12/site-packages/withings_sync/sync.py", line 469, in sync gar_wg_state = sync_garmin(fit_data_weight) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.12/site-packages/withings_sync/sync.py", line 157, in sync_garmin garmin.login(ARGS.garmin_username, ARGS.garmin_password) File "/opt/anaconda3/lib/python3.12/site-packages/withings_sync/garmin.py", line 36, in login if hasattr(self.client, "username"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.12/site-packages/garth/http.py", line 109, in username return self.profile["userName"] ^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.12/site-packages/garth/http.py", line 104, in profile assert isinstance(self._profile, dict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError

@stynoo
Copy link
Contributor

stynoo commented Nov 27, 2024

Hello, fixed in #182 , wait for the merge.

@thebruge
Copy link

Thanks was just about to post the same, I made the manual changes to garmin.py from the upcoming changes and now I am able to upload again.

@longstone
Copy link
Collaborator

Hello, fixed in #182 , wait for the merge.

thanks for the fix, release is trough.

Thanks was just about to post the same, I made the manual changes to garmin.py from the upcoming changes and now I am able to upload again.

thanks for verifying.

V4.2.6 is released and should be able to get from ghcr and pypi.

@stynoo
Copy link
Contributor

stynoo commented Nov 27, 2024

Thx @longstone, the script itself shows version 4.2.6b0
.VERSION:v4.2.6-beta

No big deal, just fyi.

@derfelixxx
Copy link

I’ve pulled docker images master, latest, v4.2.5, v4.2.6 and v4.2.6-beta, but none seem to work as I still get the assertion error. Is there something else I can do?

@rotmaus
Copy link
Author

rotmaus commented Nov 27, 2024

I’ve pulled docker images master, latest, v4.2.5, v4.2.6 and v4.2.6-beta, but none seem to work as I still get the assertion error. Is there something else I can do?

I just added
garth.http.USER_AGENT = {"User-Agent": ("GCM-iOS-5.7.2.1")} to my garmin.py file and it works now

@derfelixxx
Copy link

How would I go about adding this? I’m assuming the file is somewhere in the image, but how can I edit it? Sorry for the noob question.

@rotmaus
Copy link
Author

rotmaus commented Nov 27, 2024

On my system it is located here
/opt/anaconda3/lib/python3.12/site-packages/withings_sync/garmin.py

@derfelixxx
Copy link

I was able to remove all images and the container and reinstalled with the docker run command from the install instructions. Seems to work fine now. Thanks everyone!

@longstone
Copy link
Collaborator

Thx @longstone, the script itself shows version 4.2.6b0
.VERSION:v4.2.6-beta

No big deal, just fyi.

Good find.

This should not be the case, in the pipeline it shows using the right version. I assume that somewhere the issue is with those pre releases. So if no one creates a release, I'll do it ASAP.

@stynoo
Copy link
Contributor

stynoo commented Nov 27, 2024

I did some more tests, it's only showing 4.2.6b0/beta in the :master image, not in the :latest, I am not sure what this version action is doing exactly, but there seems to be a logic error somewhere in the process.
Also not sure if this propagates as well to the pypi packages as I only tested the containers.

@brisnick
Copy link

How would I go about adding this? I’m assuming the file is somewhere in the image, but how can I edit it? Sorry for the noob question.

I just put it in this block:

HOME = os.getenv('HOME', '.')
GARMIN_SESSION = os.getenv('GARMIN_SESSION', HOME + '/.garmin_session')
garth.http.USER_AGENT = {"User-Agent": ("GCM-iOS-5.7.2.1")}

@longstone
Copy link
Collaborator

I did some more tests, it's only showing 4.2.6b0/beta in the :master image, not in the :latest, I am not sure what this version action is doing exactly, but there seems to be a logic error somewhere in the process. Also not sure if this propagates as well to the pypi packages as I only tested the containers.

I've downloaded the pacakges from pypi and there was the .VERSION file missing. This is now resolved with the latest version.

:master vs :latest looks like an issue, as the :master and :lastest should be in sync. However, I close this issue, as with https://github.com/jaroslawhartman/withings-sync/releases/tag/v4.2.7 it should work. (tested on my side with docker)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants