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

No Sync to Garmin after activating ECG and 2FA #194

Closed
colonel302 opened this issue Dec 27, 2024 · 9 comments
Closed

No Sync to Garmin after activating ECG and 2FA #194

colonel302 opened this issue Dec 27, 2024 · 9 comments

Comments

@colonel302
Copy link

I have a problem to sync since 25.12. with Version 4.2.7. I get this error:

2024-12-27 14:27:21,538 - withings - INFO - Refresh Access Token
2024-12-27 14:27:21,689 - root - INFO - Fetching measurements from 2024-12-25 10:44 to 2024-12-27 23:59
2024-12-27 14:27:21,928 - withings - INFO - Get Measurements
2024-12-27 14:27:22,091 - root - INFO - 2024-12-27 08:06:02 This Withings metric contains no weight data or blood pressure. Not syncing...
2024-12-27 14:27:22,092 - root - INFO - 2024-12-27 08:06:02 This Withings metric contains no weight data or blood pressure. Not syncing...
2024-12-27 14:27:22,092 - root - INFO - 2024-12-27 08:06:02 This Withings metric contains no weight data or blood pressure. Not syncing...
2024-12-27 14:27:22,092 - root - INFO - 2024-12-26 08:03:43 This Withings metric contains no weight data or blood pressure. Not syncing...
2024-12-27 14:27:22,092 - root - INFO - 2024-12-26 08:03:43 This Withings metric contains no weight data or blood pressure. Not syncing...
2024-12-27 14:27:22,092 - root - INFO - 2024-12-26 08:03:43 This Withings metric contains no weight data or blood pressure. Not syncing...
2024-12-27 14:27:22,093 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/colonel/.local/bin/withings-sync", line 8, in
sys.exit(main())
^^^^^^
File "/home/colonel/.local/lib/python3.12/site-packages/withings_sync/sync.py", line 510, in main
sync()
File "/home/colonel/.local/lib/python3.12/site-packages/withings_sync/sync.py", line 469, in sync
gar_wg_state = sync_garmin(fit_data_weight)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/colonel/.local/lib/python3.12/site-packages/withings_sync/sync.py", line 157, in sync_garmin
garmin.login(ARGS.garmin_username, ARGS.garmin_password)
File "/home/colonel/.local/lib/python3.12/site-packages/withings_sync/garmin.py", line 38, in login
if hasattr(self.client, "username"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/colonel/.local/lib/python3.12/site-packages/garth/http.py", line 109, in username
return self.profile["userName"]
^^^^^^^^^^^^
File "/home/colonel/.local/lib/python3.12/site-packages/garth/http.py", line 101, in profile
self._profile = self.connectapi(
^^^^^^^^^^^^^^^^
File "/home/colonel/.local/lib/python3.12/site-packages/garth/http.py", line 171, in connectapi
resp = self.request(method, "connectapi", path, api=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/colonel/.local/lib/python3.12/site-packages/garth/http.py", line 129, in request
self.refresh_oauth2()
File "/home/colonel/.local/lib/python3.12/site-packages/garth/http.py", line 168, in refresh_oauth2
self.oauth2_token = sso.exchange(self.oauth1_token, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/colonel/.local/lib/python3.12/site-packages/garth/sso.py", line 146, in exchange
).json()
^^^^^^
File "/usr/lib/python3/dist-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@colonel302
Copy link
Author

BS: Ubuntu 24.04 LTS
Python: 3.12
Withings-Sync: 4.2.7.

@stynoo
Copy link
Contributor

stynoo commented Dec 27, 2024

Hello, if you are sure the username/password combination is still correct, try upgrading garth.

@colonel302
Copy link
Author

colonel302 commented Dec 27, 2024

Hi,
username/password works at the Garmin Connect.
Garth is @ 0.4.46 which is needed for withingssync 4.2.7. The Update to garth 0.5.2 shows the same error.

@colonel302
Copy link
Author

Good morning,
I think it is a problem with the permanent MFA which was enabled using ECG from Garmin.
Changeing to credentials via environment variables does not help.

@stynoo
Copy link
Contributor

stynoo commented Dec 28, 2024

Ah Garmin doing Garming things again...
So to get what happened correctly... This didn't suddenly stopped working, you added a new device with ECG functionality and Garmin is required by law to enable MFA/2FA when processing ECG data.
Garth should work with this, I am not sure why it goes wrong.

@colonel302
Copy link
Author

It seems so. Any ideas on how to get it working again? I have also deactivated the ECG function again. Unfortunately, I can no longer deactivate the 2FA in the profile. I have written to Garmin support about this.

@colonel302 colonel302 changed the title No Sync to Garmin since 25.12. No Sync to Garmin after activating ECG and 2FA Dec 29, 2024
@michaelknox
Copy link

I am seeing the same on my side. Again with the ECG function and most likely the 2FA. I'll send them a note as well.

@mlamberts78
Copy link

I had the same problem after activating ECG. I removed the .garmin_session in my homedirectory to re-authenticate to Garmin.
This will request a new securitycode.
For me it is working again after this.

@colonel302
Copy link
Author

I had the same problem after activating ECG. I removed the .garmin_session in my homedirectory to re-authenticate to Garmin. This will request a new securitycode. For me it is working again after this.

Thank you so much. This worked for me. After deleting I Was asked for mfa Code and the sync works.

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

4 participants