tcgoetz / GarminDB

Download and parse data from Garmin Connect or a Garmin watch, FitBit CSV, and MS Health CSV files into and analyze data in Sqlite serverless databases with Jupyter notebooks.
GNU General Public License v2.0
1.1k stars 138 forks source link

script finds 0 activities #219

Closed pflajszer closed 8 months ago

pflajszer commented 8 months ago

Describe the bug The last activities import I have is around August 2023. I was using the iterative update script (garmindb_cli.py --all --download --import --analyze --latest) to get new data periodically, but I've noticed that all metrics were updating except activities. I've reinstalled version 3.5.2 but the issue still persists. Even after deleting HealthData folder, the script just proceeds downloading monitoring data as it finds 0 activities:

image

To Reproduce Steps to reproduce the behavior:

  1. use v 3.5.2
  2. run garmindb_cli.py --all --download --import --analyze --latest on existing data or garmindb_cli.py --all --download --import --analyze on a fresh install
  3. the FitFiles/Activities folder will be empty (only containing activity_types.json; the DBs/garmin_activities.db will also be empty (or, if you already had this working and have some data in the db, the LastModified will indicate the .db file wasn't updated now and not have recent data)

Expected behavior Activities db/fit files get populated with the latest data

Logs

INFO:root:Fetching 100000 activities to /home/atampaolo/HealthData/FitFiles/Activities
INFO:root:get_activity_types: '/home/atampaolo/HealthData/FitFiles/Activities'
INFO:/home/atampaolo/mambaforge/envs/garmin/lib/python3.12/site-packages/garmindb/download.py:Getting activities: '/home/atampaolo/HealthData/FitFiles/Activities' (100000) temp /tmp/tmpyrcpuxh5
INFO:root:get_activity_summaries
ERROR:root:Exception getting activity summary: Error in request: 400 Client Error: Bad Request for url: https://connectapi.garmin.com/activitylist-service/activities/search/activities?start=0&limit=100000
INFO:root:unzip_files: from /tmp/tmpyrcpuxh5 to /home/atampaolo/HealthData/FitFiles/Activities
INFO:/home/atampaolo/mambaforge/envs/garmin/bin/garmindb_cli.py:Downloading all monitoring data from: 2019-12-31 [1475]
pflajszer commented 8 months ago

Funny I've actually resolved it while writing this up, but I thought I'll post it anyways in case someone else encounters this. The issue is the number of activities to download specified in the .GarminDb/GarminConnectConfig.json:

image

Updating the number under download_all_activities to a lower one (I went with 3000) did the trick for me