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

Downloading Database Fails since 9/25/2023 #195

Closed spartan-it closed 11 months ago

spartan-it commented 11 months ago

Describe the bug I have been running a pipeline where I download data every day from Garmin, but to my surprise, for the last two days, the process has been failing with the same error (see logs). I have not changed any files, especially GarminConnectConfig.json.

To Reproduce Steps to reproduce the behavior:

  1. Create environment:
    python3 -m venv garmin-env
  2. Activate environment:
    source garmin-env/bin/activate 
  3. Install garmin db using pip:
    pip install garmindb
  4. Add proper authentication to GarminConnectConfig.json
    nano ~/.GarminDb/GarminConnectConfig.json
  5. Run the following command (update only; I already have data from years before):
    garmindb_cli.py --all --download --import --analyze --latest

Expected behavior I should see how the data is being downloaded and no errors at the end.

Logs

Running command: source /home/diegoalesar/garmin-env/bin/activate && garmindb_cli.py --all --download --import --analyze --latest
[2023-09-26, 20:00:26 EDT] {ssh.py:522} INFO - ___Downloading Latest Data___
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING - Traceback (most recent call last):
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING -   File "/home/diegoalesar/garmin-env/bin/garmindb_cli.py", line 358, in <module>
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING -     main(sys.argv[1:])
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING -   File "/home/diegoalesar/garmin-env/bin/garmindb_cli.py", line 339, in main
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING -     download_data(args.overwrite, args.latest, args.stats)
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING -   File "/home/diegoalesar/garmin-env/bin/garmindb_cli.py", line 112, in download_data
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING -     if not download.login():
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING -   File "/home/diegoalesar/garmin-env/lib/python3.8/site-packages/garmindb/download.py", line 178, in login
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING -     self.display_name = self.user_prefs['displayName']
[2023-09-26, 20:00:28 EDT] {ssh.py:527} WARNING - TypeError: 'NoneType' object is not subscriptable
[2023-09-26, 20:00:29 EDT] {taskinstance.py:1824} ERROR - Task failed with exception

Please run bugreport.sh and attach bugreport.zip. bugreport.zip

Additional context I have been running the pipeline for about a month. I haven't made any changes to any files. I tried starting from zero with no luck either. Using python 3.8.10

smacrico commented 11 months ago

i get the exatly same issue.. maybe garmin changed something to way of loign??

matin commented 11 months ago

This is related to the same issue discussed in https://github.com/pe-st/garmin-connect-export/issues/95. The issue can be resolved by migrating to Garth for the authentication (discussed in #192).

The discussion includes several examples of projects that performed the migration.

smacrico commented 11 months ago

This is related to the same issue discussed in pe-st/garmin-connect-export#95. The issue can be resolved by migrating to Garth for the authentication (discussed in #192).

The discussion includes several examples of projects that performed the migration.

thanks for the info! tried the changes got a step further of course with different authentication errors... Unfortunately i am not that good developer to fix this.. but i ll keep trying..

tcgoetz commented 11 months ago

The garth-migration branch is now working (auth, download, etc), but is not ready for merge yet.

tcgoetz commented 11 months ago

All tests are passing on the develop branch.

smacrico commented 11 months ago

Next stop: release!! Thank you so much!!

tcgoetz commented 11 months ago

https://github.com/tcgoetz/GarminDB/releases/tag/v3.5.0

spartan-it commented 11 months ago

I can confirm is working now. Thank you very much for your hard work! I highly appreciate it!