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

Coros fit file parsing: validating Event failed #78

Open
qdesrame opened this issue Feb 8, 2023 · 2 comments
Open

Coros fit file parsing: validating Event failed #78

qdesrame opened this issue Feb 8, 2023 · 2 comments

Comments

@qdesrame
Copy link

qdesrame commented Feb 8, 2023

Hello, I'm trying to parse a fit files exported from Coros Hub (Coros Apex Pro watch).

I have an error when i'm trying to decode the file:
parsing definition message: validating Event failed: field 3: size (1) is less than base type size (4)

Here is the full trace with fit.WithStdLogger() options:

header decoded: size: 14 | protover: 32 | profver: 2178 | dsize: 188025 | dtype: .FIT | crc: 0xc6a5
definition message parsed: local: 0 | global: FileId | arch: LittleEndian | fields: 5 | data dev fields: 0
parsed file_id message: {Activity Coros 841 0 2023-02-05 17:18:37 +0000 UTC 65535 COROS APEX Pro}
definition message parsed: local: 0 | global: DeveloperDataId | arch: LittleEndian | fields: 3 | data dev fields: 0
definition message parsed: local: 0 | global: DeviceInfo | arch: LittleEndian | fields: 3 | data dev fields: 0
definition message parsed: local: 0 | global: Activity | arch: LittleEndian | fields: 7 | data dev fields: 0
definition message parsed: local: 0 | global: FieldDescription | arch: LittleEndian | fields: 5 | data dev fields: 0
definition message parsed: local: 0 | global: FieldDescription | arch: LittleEndian | fields: 5 | data dev fields: 0
definition message parsed: local: 0 | global: FieldDescription | arch: LittleEndian | fields: 5 | data dev fields: 0
definition message parsed: local: 0 | global: FieldDescription | arch: LittleEndian | fields: 5 | data dev fields: 0
definition message parsed: local: 0 | global: Event | arch: LittleEndian | fields: 4 | data dev fields: 0
definition message parsed: local: 0 | global: Record | arch: LittleEndian | fields: 3 | data dev fields: 0
definition message parsed: local: 0 | global: Record | arch: LittleEndian | fields: 5 | data dev fields: 1
definition message parsed: local: 0 | global: Record | arch: LittleEndian | fields: 7 | data dev fields: 1
definition message parsed: local: 0 | global: Record | arch: LittleEndian | fields: 8 | data dev fields: 1
definition message parsed: local: 0 | global: Record | arch: LittleEndian | fields: 9 | data dev fields: 1
definition message parsed: local: 0 | global: Record | arch: LittleEndian | fields: 10 | data dev fields: 1
definition message parsed: local: 0 | global: Record | arch: LittleEndian | fields: 12 | data dev fields: 1
definition message parsed: local: 0 | global: Event | arch: LittleEndian | fields: 4 | data dev fields: 0
illegal definition message: local: 0 | global: Event | arch: LittleEndian | fields: 5 | data dev fields: 0
panic: parsing definition message: validating Event failed: field 3: size (1) is less than base type size (4)

I can provide the .fit file if needed 🙂

@qdesrame
Copy link
Author

It seems related to this issue in Golden Cheetah:
https://groups.google.com/g/golden-cheetah-developers/c/RVb_fk9kSOM
GoldenCheetah/GoldenCheetah#3645

Here is the fix they made:
dtcooper/python-fitparse#116

I tried something on my side, it's working now with my fit file but i'm not sure of what I've done 😅

@tormoder
Copy link
Owner

Hi. Thanks for the links regarding Coros files.

We would need to add a more permissive parsing mode to allow such "bugs".

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

2 participants