Skip to content
New issue

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

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

Already on GitHub? # to your account

Bad response during GC upload: 200 #171

Open
ff-ahumberston opened this issue Jun 26, 2024 · 6 comments
Open

Bad response during GC upload: 200 #171

ff-ahumberston opened this issue Jun 26, 2024 · 6 comments

Comments

@ff-ahumberston
Copy link

I appear to be receiving an error (Bad response during GC upload: 200) when attempting to run the script (latest version)

Snipped verbose log output below:

2024-06-26 16:35:28,701 - root - DEBUG - attempting to upload fit file...
2024-06-26 16:35:28,719 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): sso.garmin.com
2024-06-26 16:35:29,099 - urllib3.connectionpool - DEBUG - https://sso.garmin.com:443 "GET /sso/signin?service=https%3A%2F%2Fconnect.garmin.com%2Fmodern&clientId=GarminConnect&gauthHost=https%3A%2F%2Fsso.garmin.com%2Fsso&consumeServiceTicket=false HTTP/1.1" 200 None
2024-06-26 16:35:30,258 - urllib3.connectionpool - DEBUG - https://sso.garmin.com:443 "POST /sso/#?service=https%3A%2F%2Fconnect.garmin.com%2Fmodern&clientId=GarminConnect&gauthHost=https%3A%2F%2Fsso.garmin.com%2Fsso&consumeServiceTicket=false HTTP/1.1" 200 None
2024-06-26 16:35:30,266 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): connect.garmin.com
2024-06-26 16:35:30,528 - urllib3.connectionpool - DEBUG - https://connect.garmin.com:443 "GET /modern HTTP/1.1" 302 0
2024-06-26 16:35:31,295 - urllib3.connectionpool - DEBUG - https://sso.garmin.com:443 "GET /sso/#?service=https%3A%2F%2Fconnect.garmin.com%2Fmodern%2F&webhost=https%3A%2F%2Fconnect.garmin.com&gateway=true&generateExtraServiceTicket=true&generateTwoExtraServiceTickets=true&clientId=CAS_CLIENT_DEFAULT HTTP/1.1" 302 0
2024-06-26 16:35:31,948 - urllib3.connectionpool - DEBUG - https://connect.garmin.com:443 "GET /modern/?ticket=ST-252815-TVIe4rB0pzbo25taUO3D-cas HTTP/1.1" 302 0
2024-06-26 16:35:32,962 - urllib3.connectionpool - DEBUG - https://connect.garmin.com:443 "GET /modern/ HTTP/1.1" 200 None
2024-06-26 16:35:32,975 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): connect.garmin.com
2024-06-26 16:35:32,978 - urllib3.connectionpool - DEBUG - http://connect.garmin.com:80 "GET /modern HTTP/1.1" 301 167
2024-06-26 16:35:33,199 - urllib3.connectionpool - DEBUG - https://connect.garmin.com:443 "GET /modern HTTP/1.1" 200 None
2024-06-26 16:35:33,203 - garmin - INFO - Garmin Connect User Name: <username>
2024-06-26 16:35:33,274 - urllib3.connectionpool - DEBUG - https://connect.garmin.com:443 "POST /modern/proxy/upload-service/upload/.fit HTTP/1.1" 200 2
2024-06-26 16:35:33,275 - garmin - ERROR - Bad response during GC upload: 200
2024-06-26 16:35:33,277 - root - INFO - Fit file with weight information uploaded to Garmin Connect

Can anybody shed any light on to this ?

@Chrominator
Copy link
Contributor

Got the same issue from June 24 also.

@JackLondon002
Copy link

JackLondon002 commented Nov 26, 2024

Same. Started on 22 Nov.

2024-11-26 20:57:54,718 - root - DEBUG - raw_data=[<withings_sync.withings2.WithingsMeasure object at 0xb540ce68>]
2024-11-26 20:57:54,721 - root - DEBUG - type=weight
2024-11-26 20:57:54,723 - root - DEBUG - last_dt: 2024-11-26 20:56:54 last_weight: None
2024-11-26 20:57:54,725 - root - DEBUG - Generating fit data...
2024-11-26 20:57:54,739 - root - INFO - No blood pressure data to sync for FIT file
2024-11-26 20:57:54,741 - root - DEBUG - Fit data generated...
2024-11-26 20:57:54,743 - root - DEBUG - Generating json data...
2024-11-26 20:57:54,745 - root - DEBUG - Json data generated...
2024-11-26 20:57:54,748 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
2024-11-26 20:57:54,751 - root - DEBUG - attempting to upload fit file...
2024-11-26 20:57:54,788 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): connectapi.garmin.com:443
2024-11-26 20:57:55,196 - urllib3.connectionpool - DEBUG - https://connectapi.garmin.com:443 "GET /userprofile-service/socialProfile HTTP/1.1" 200 None
Traceback (most recent call last):
File "/home/pi/.local/bin/withings-sync", line 8, in
sys.exit(main())
File "/home/pi/.local/lib/python3.9/site-packages/withings_sync/sync.py", line 510, in main
sync()
File "/home/pi/.local/lib/python3.9/site-packages/withings_sync/sync.py", line 469, in sync
gar_wg_state = sync_garmin(fit_data_weight)
File "/home/pi/.local/lib/python3.9/site-packages/withings_sync/sync.py", line 157, in sync_garmin
garmin.login(ARGS.garmin_username, ARGS.garmin_password)
File "/home/pi/.local/lib/python3.9/site-packages/withings_sync/garmin.py", line 36, in login
if hasattr(self.client, "username"):
File "/home/pi/.local/lib/python3.9/site-packages/garth/http.py", line 109, in username
return self.profile["userName"]
File "/home/pi/.local/lib/python3.9/site-packages/garth/http.py", line 104, in profile
assert isinstance(self._profile, dict)
AssertionError

@marksh
Copy link

marksh commented Nov 26, 2024

I'm getting the AssertionError today also.

@JackLondon002
Copy link

JackLondon002 commented Nov 26, 2024

No luck with the .garmin_session folder

short version. Maybe it is something on garmins side? They had an outage a couple of days ago.

2024-11-26 21:52:39,142 - withings - INFO - Refresh Access Token
2024-11-26 21:52:39,576 - root - INFO - Fetching measurements from 2024-11-26 21:50 to 2024-11-26 23:59
2024-11-26 21:52:40,012 - withings - INFO - Get Measurements
2024-11-26 21:52:40,424 - root - INFO - No blood pressure data to sync for FIT file
2024-11-26 21:52:40,427 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
Traceback (most recent call last):
File "/home/pi/.local/bin/withings-sync", line 8, in
sys.exit(main())
File "/home/pi/.local/lib/python3.9/site-packages/withings_sync/sync.py", line 510, in main
sync()
File "/home/pi/.local/lib/python3.9/site-packages/withings_sync/sync.py", line 469, in sync
gar_wg_state = sync_garmin(fit_data_weight)
File "/home/pi/.local/lib/python3.9/site-packages/withings_sync/sync.py", line 157, in sync_garmin
garmin.login(ARGS.garmin_username, ARGS.garmin_password)
File "/home/pi/.local/lib/python3.9/site-packages/withings_sync/garmin.py", line 36, in login
if hasattr(self.client, "username"):
File "/home/pi/.local/lib/python3.9/site-packages/garth/http.py", line 109, in username
return self.profile["userName"]
File "/home/pi/.local/lib/python3.9/site-packages/garth/http.py", line 104, in profile
assert isinstance(self._profile, dict)
AssertionError

@marksh
Copy link

marksh commented Nov 26, 2024

I had no error after deleting the .garmin_session folder for the first run and without new measurement.
but now it pops up again here also:

2024-11-26 21:02:41,116 - withings - INFO - Refresh Access Token
2024-11-26 21:02:41,267 - root - INFO - Fetching measurements from 2024-11-26 19:18 to 2024-11-26 23:59
2024-11-26 21:02:41,500 - withings - INFO - Get Measurements
2024-11-26 21:02:41,647 - root - INFO - No blood pressure data to sync for FIT file
2024-11-26 21:02:41,647 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
Traceback (most recent call last):
File "/usr/local/bin/withings-sync", line 8, in
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/site-packages/withings_sync/sync.py", line 510, in main
sync()
File "/usr/local/lib/python3.12/site-packages/withings_sync/sync.py", line 469, in sync
gar_wg_state = sync_garmin(fit_data_weight)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/withings_sync/sync.py", line 157, in sync_garmin
garmin.login(ARGS.garmin_username, ARGS.garmin_password)
File "/usr/local/lib/python3.12/site-packages/withings_sync/garmin.py", line 36, in login
if hasattr(self.client, "username"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/garth/http.py", line 109, in username
return self.profile["userName"]
^^^^^^^^^^^^
File "/usr/local/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 26, 2024

It's indeed a change on the Garmin side of things (again).
Using a new USER_AGENT string with Garth should fix it (see this Garth issue)
Or this PR for Garth itself
I am not able to create a PR right now so if anyone cares to have a go at it, or we wait for the Garth fix and build from there.

stynoo added a commit to stynoo/withings-sync that referenced this issue Nov 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants