jaroslawhartman / withings-sync

Synchronisation of Withings weight
MIT License
457 stars 89 forks source link

This Withings metric contains no weight data. Not syncing... #159

Closed w9925 closed 10 months ago

w9925 commented 10 months ago

Hey, I have the following error:


[User@QNAP ~]$ docker start -i withings
2024-01-14 16:15:52,866 - withings - INFO - Refresh Access Token
2024-01-14 16:15:53,068 - root - INFO - Fetching measurements from 2024-01-14 00:00 to 2024-01-14 23:59
2024-01-14 16:15:53,325 - withings - INFO - Get Measurements
2024-01-14 16:15:53,531 - root - INFO - 2024-01-14 09:57:38 This Withings metric contains no weight data.  Not syncing...
2024-01-14 16:15:53,532 - root - INFO - 2024-01-14 09:57:38 This Withings metric contains no weight data.  Not syncing...
2024-01-14 16:15:53,532 - root - INFO - 2024-01-14 09:57:38 This Withings metric contains no weight data.  Not syncing...
2024-01-14 16:15:53,532 - root - INFO - 2024-01-14 09:57:38 This Withings metric contains no weight data.  Not syncing...
2024-01-14 16:15:53,534 - root - INFO - No blood pressure data to sync for FIT file
2024-01-14 16:15:53,535 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/garth-0.4.44-py3.10.egg/garth/http.py", line 139, in request
    self.last_resp.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests-2.31.0-py3.10.egg/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 412 Client Error: Precondition Failed for url: https://connectapi.garmin.com/upload-service/upload

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/withings-sync", line 33, in <module>
    sys.exit(load_entry_point('withings-sync==4.2.2', 'console_scripts', 'withings-sync')())
  File "/usr/local/lib/python3.10/site-packages/withings_sync-4.2.2-py3.10.egg/withings_sync/sync.py", line 505, in main
    sync()
  File "/usr/local/lib/python3.10/site-packages/withings_sync-4.2.2-py3.10.egg/withings_sync/sync.py", line 466, in sync
    gar_wg_state = sync_garmin(fit_data_weight)
  File "/usr/local/lib/python3.10/site-packages/withings_sync-4.2.2-py3.10.egg/withings_sync/sync.py", line 158, in sync_garmin
    return garmin.upload_file(fit_file)
  File "/usr/local/lib/python3.10/site-packages/withings_sync-4.2.2-py3.10.egg/withings_sync/garmin.py", line 55, in upload_file
    self.client.upload(fit_file)
  File "/usr/local/lib/python3.10/site-packages/garth-0.4.44-py3.10.egg/garth/http.py", line 185, in upload
    return self.connectapi(
  File "/usr/local/lib/python3.10/site-packages/garth-0.4.44-py3.10.egg/garth/http.py", line 169, in connectapi
    resp = self.request(method, "connectapi", path, api=True, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/garth-0.4.44-py3.10.egg/garth/http.py", line 141, in request
    raise GarthHTTPError(
garth.exc.GarthHTTPError: Error in request: 412 Client Error: Precondition Failed for url: https://connectapi.garmin.com/upload-service/upload

Things I have done:

  1. docker pull ghcr.io/jaroslawhartman/withings-sync:master
  2. docker run -v $HOME:/root --interactive --tty --name withings ghcr.io/jaroslawhartman/withings-sync:master --garmin-username=myuser --garmin-password=mypassword
  3. entered the token from withings
  4. docker start -i withings

I always got the same output (see above) Is there something I am doing wrong?

w9925 commented 10 months ago

I have found the problem. I have to accept the storage of my data on the garmin site.