jovandeginste / workout-tracker

A workout tracking web application for personal use (or family, friends), geared towards running and other GPX-based activities
Other
945 stars 31 forks source link

Error processing .fit file #106

Closed zoenglinghou closed 5 months ago

zoenglinghou commented 5 months ago

Hi, thank you for developing this project! I am trying out the project with podman on my local machine, and there seems to be an error processing a .fit file generated using a Wahoo Element Bolt bike computer.

version: v0.13.0 The following error is seen on the page: image

The console log follows:

{"time":"2024-04-14T19:25:40.367276288Z","level":"ERROR","msg":"sql: converting argument $5 type: json: unsupported value: NaN","app":"workout-tracker","version":"master","sha":"1131e68d8a262f85731b2a661f5a6af1897aa8af","module":"database","error":"sql: converting argument $5 type: json: unsupported value: NaN","query":"INSERT INTO `map_data_details` (`created_at`,`updated_at`,`deleted_at`,`map_data_id`,`points`) VALUES (\"2024-04-14 19:25:40.366\",\"2024-04-14 19:25:40.366\",NULL,1,\"\") ON CONFLICT (`id`) DO UPDATE SET `map_data_id`=`excluded`.`map_data_id` RETURNING `id`","duration":117335,"rows":0,"file":"/app/pkg/database/workouts.go:197"}
{"time":"2024-04-14T19:25:40.367474547Z","level":"ERROR","msg":"sql: converting argument $5 type: json: unsupported value: NaN","app":"workout-tracker","version":"master","sha":"1131e68d8a262f85731b2a661f5a6af1897aa8af","module":"database","error":"sql: converting argument $5 type: json: unsupported value: NaN","query":"INSERT INTO `map_data` (`created_at`,`updated_at`,`deleted_at`,`workout_id`,`creator`,`name`,`center`,`address`,`total_distance`,`total_duration`,`max_speed`,`pause_duration`,`min_elevation`,`max_elevation`,`total_up`,`total_down`,`points`) VALUES (\"2024-04-14 19:25:40.366\",\"2024-04-14 19:25:40.366\",NULL,1,\"Garmin Connect\",\"\",\"{\"\"Lat\"\":47.45598521556553,\"\"Lng\"\":8.797513872274084}\",\"{\"\"FormattedAddress\"\":\"\"Burgstrasse, Rutzen, Rikon, Zell (ZH), Bezirk Winterthur, Zürich, 8486, Schweiz/Suisse/Svizzera/Svizra\"\",\"\"Street\"\":\"\"Burgstrasse\"\",\"\"HouseNumber\"\":\"\"\"\",\"\"Suburb\"\":\"\"\"\",\"\"Postcode\"\":\"\"8486\"\",\"\"State\"\":\"\"Zürich\"\",\"\"StateCode\"\":\"\"\"\",\"\"StateDistrict\"\":\"\"\"\",\"\"County\"\":\"\"\"\",\"\"Country\"\":\"\"Schweiz/Suisse/Svizzera/Svizra\"\",\"\"CountryCode\"\":\"\"CH\"\",\"\"City\"\":\"\"Rikon\"\"}\",0,6524000000000,0,776000000776,0,0,355.1200000000007,0,NULL) ON CONFLICT (`id`) DO UPDATE SET `workout_id`=`excluded`.`workout_id` RETURNING `id`","duration":1315417,"rows":1,"file":"/app/pkg/database/workouts.go:197"}
{"time":"2024-04-14T19:25:40.368148467Z","level":"ERROR","msg":"sql: converting argument $5 type: json: unsupported value: NaN; sql: converting argument $5 type: json: unsupported value: NaN","app":"workout-tracker","version":"master","sha":"1131e68d8a262f85731b2a661f5a6af1897aa8af","module":"database","error":"sql: converting argument $5 type: json: unsupported value: NaN; sql: converting argument $5 type: json: unsupported value: NaN","query":"INSERT INTO `workouts` (`created_at`,`updated_at`,`deleted_at`,`name`,`date`,`user_id`,`dirty`,`notes`,`type`,`data`,`gpx_data`,`filename`) VALUES (\"2024-04-14 19:25:40.364\",\"2024-04-14 19:25:40.364\",NULL,\"\",\"2024-04-12 14:21:29\",1,false,\"\",\"cycling\",NULL,\"\",\"\") RETURNING `id`,`checksum`","duration":5123591,"rows":1,"file":"/app/pkg/database/workouts.go:197"}

I would happily provide you with the file privately via Email if you decide to tackle the issue, since I don't want to reveal my location. Thanks!

jovandeginste commented 5 months ago

You can send the file to my mail address, associated with my commits on github

jovandeginste commented 5 months ago

@zoenglinghou thanks for the sample - I fixed the logic and can import your samples successfully now; please try for yourself and report back if anything is still missing...

zoenglinghou commented 5 months ago

it works as intended. Thank you