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.18k stars 142 forks source link

Monitoring data parsing error #115

Closed Zveroloff closed 3 years ago

Zveroloff commented 3 years ago

Describe the bug Got an exception while running DB creation script on my Mac. Here is the stack trace:

ERROR:root:Failed to parse .../HealthData/FitFiles/Monitoring/2021/M3C94224.FIT:  - Traceback (most recent call last):
  File "fit_data.py", line 53, in process_files
  File "monitoring_fit_file_processor.py", line 42, in write_file
  File "fit_file_processor.py", line 83, in _write_message_types
  File "fit_file_processor.py", line 72, in __write_message_type
  File "fit_file_processor.py", line 67, in _write_file_id
  File "fit_file_processor.py", line 122, in _write_file_id_entry
  File "GarminDB/garmin_db.py", line 169, in name_and_id_from_path
GarminDB.garmin_db.GarminDbError_IdNotFound

To Reproduce Steps to reproduce the behavior:

  1. Run DB creation from device script: ./copy_create_dbs.sh
  2. See error

Expected behavior FIT data successfully parsed, DB created

Logs Can upload full log on request

bugreport_1615811383.zip

Additional context I faced an issue with MacOS Mojave and Garmin Instinct Tactical Solar device

tcgoetz commented 3 years ago

The files with this error have names different than what I would expect: "M3C94224.FIT". Are they downloaded from Garmin Connect? Taken directly off the watch?

Zveroloff commented 3 years ago

They were taken directly off the watch

tcgoetz commented 3 years ago

Fix committed to develop branch. Please try it out.

Zveroloff commented 3 years ago

Sorry for that delay. Yes, your fix works