Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

'NoneType' object is not subscriptable while processing data #257

Open
petar-ps opened this issue Jan 4, 2025 · 5 comments
Open

'NoneType' object is not subscriptable while processing data #257

petar-ps opened this issue Jan 4, 2025 · 5 comments

Comments

@petar-ps
Copy link

petar-ps commented Jan 4, 2025

Describe the bug
After downloading that took probably around 4h+ it started to process the data and printed out a lot of this messages below. It got to 88% and then suddenly showing 100%. Idk if everything is alright.
image

To Reproduce
Steps to reproduce the behavior:
I dont know

Expected behavior
A clear and concise description of what you expected to happen.

Logs
Failed to write message <MessageType.monitoring_info: 103> type DataMessage(<MessageType.monitoring_info: 103>: [timestamp(datetime.datetime(2024, 6, 6, 5, 56, 20, tzinfo=datetime.timezone.utc) (1086587780)), local_timestamp(datetime.datetime(2024, 6, 6, 7, 56, 20) (1086594980)), cycles_to_distance([0.7734, 1.1602] m/cycle ([3867, 5801])), unknown_7([13480.0, 13480.0]), resting_metabolic_rate(2028.0 kcal/day), activity_type([<ActivityType.walking: 6>, <ActivityType.running: 1>] ([6, 1]))]): 'NoneType' object is not subscriptable

Please run bugreport.sh and attach bugreport.zip.

Additional context
Add any other context about the problem here.

@delize
Copy link

delize commented Jan 4, 2025

Also am receiving this error, and when attempting to run garmindb_bug_report.py, and receiving the following:

$ ./garmindb_bug_report.py                                                                                  [16:08:19]
Traceback (most recent call last):
  File "/Users/andrewdoering/Documents/github/GarminDB/bin/./garmindb_bug_report.py", line 43, in <module>
    zip.write('garmindb.log')
    ~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/zipfile/__init__.py", line 1876, in write
    zinfo = ZipInfo.from_file(filename, arcname,
                              strict_timestamps=self._strict_timestamps)
  File "/opt/homebrew/Cellar/[email protected]/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/zipfile/__init__.py", line 580, in from_file
    st = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'garmindb.log'
(GarminDB) FAIL**

I noticed it is in the directory that is run, as opposed to the bin folder for the pip installation.

@tcgoetz , please see the linked below for the log file / bugreport.zip

https://drive.google.com/file/d/1ARfyFf9yau_kdhIuaqeAIXMh4_wOIK7m/view?usp=sharing

It can't be uploaded to Github, as File size too big: 25 MB are allowed, 25 MB were attempted to upload.

@TheBestian7
Copy link

Unfortunately I have the same issue as posted above. Error from the log:

ERROR:root:Failed to write message <MessageType.monitoring_info: 103> type DataMessage(<MessageType.monitoring_info: 103>: [timestamp(datetime.datetime(2024, 2, 10, 8, 41, 53, tzinfo=datetime.timezone.utc) (1076488913)), local_timestamp(datetime.datetime(2024, 2, 10, 9, 41, 53) (1076492513)), cycles_to_distance([0.8462, 1.2694] m/cycle ([4231, 6347])), unknown_7([8000.0, 8000.0]), resting_metabolic_rate(2290.0 kcal/day), activity_type([<ActivityType.walking: 6>, <ActivityType.running: 1>] ([6, 1]))]): Traceback (most recent call last):
File "/home/sebastian/Programs/distance_prediction/.venv/lib/python3.11/site-packages/garmindb/fit_file_processor.py", line 53, in __write_generic
function(fit_file, message.fields)
File "/home/sebastian/Programs/distance_prediction/.venv/lib/python3.11/site-packages/garmindb/monitoring_fit_file_processor.py", line 51, in _write_monitoring_info_entry
'cycles_to_calories' : message_fields.cycles_to_calories[index]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
TypeError: 'NoneType' object is not subscriptable

Just for testing, i know it won't work as supposed to be: When I comment out the line 51 the error does not appear, but the database won't update. So I guess there is any error with cycles_to_calories

bugreport.zip

@tcgoetz
Copy link
Owner

tcgoetz commented Jan 12, 2025

@TheBestian7 can you share the fit file /home/sebastian//home/sebastian/Programs/distance_prediction/Garmin_HealthData/FitFiles/Monitoring/2024/236119219450_WELLNESS.fit with me so I can debug it?

@TheBestian7
Copy link

@TheBestian7 can you share the fit file /home/sebastian//home/sebastian/Programs/distance_prediction/Garmin_HealthData/FitFiles/Monitoring/2024/236119219450_WELLNESS.fit with me so I can debug it?
236119219450_WELLNESS.fit.zip

@tcgoetz
Copy link
Owner

tcgoetz commented Jan 13, 2025

@TheBestian7 can you test from the develop branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants