joaovitoriasilva / endurain

My DIY fitness tracker journey. Frontend is built using Vue.js and Bootstrap CSS; Python FastAPI, Alembic, SQLAlchemy, stravalib, gpxpy, MariaDB behind the scenes. Suggestions welcome!
GNU General Public License v3.0
355 stars 7 forks source link

Can't import GPX #7

Open DavidHenryThoreau opened 5 months ago

DavidHenryThoreau commented 5 months ago

I've tried to import that GPX file : https://www.visugpx.com/download.php?id=LW80xEsvce Unable to create activity stream (-5/-6/-7/-8/-9/-10/-11).

joaovitoriasilva commented 5 months ago

Thanks for reaching out. Do you have any error in the backend logs? Both the app.log file and the container log?

DavidHenryThoreau commented 5 months ago

I've enable logs before uploading GPX file the only things i'm getting is bellow :

docker logs backend  -f
INFO:     172.27.0.4:35936 - "GET /validate_token HTTP/1.1" 200 OK
INFO:     172.27.0.4:35946 - "GET /activities/useractivities/pagenumber/1/numRecords/5 HTTP/1.1" 200 OK
INFO:     172.27.0.4:35958 - "GET /activities/useractivities/number HTTP/1.1" 200 OK
INFO:     172.27.0.4:35966 - "GET /activities/followeduseractivities/pagenumber/1/numRecords/5 HTTP/1.1" 200 OK
INFO:     172.27.0.4:35976 - "GET /activities/followeduseractivities/number HTTP/1.1" 200 OK
INFO:     172.27.0.4:35978 - "GET /activities/useractivities/1/thisweek/distances HTTP/1.1" 200 OK
INFO:     172.27.0.4:35984 - "GET /activities/useractivities/1/thismonth/distances HTTP/1.1" 200 OK
DavidHenryThoreau commented 5 months ago
root@debian-12:~/endurain# docker exec -it backend cat app.log
2024-01-31 13:59:47,416 - myLogger - INFO - 0 access tokens deleted from the database
2024-01-31 14:04:47,416 - myLogger - INFO - 0 access tokens deleted from the database
joaovitoriasilva commented 5 months ago

Can you try with a different GPX? Some files don't upload and I can't figure it out why.

DavidHenryThoreau commented 5 months ago

Still the same for : https://fr-fr.gps-viewer.com/tracks/t/Grande-Travers%C3%A9e-du-Jura-GTJ/ https://fr-fr.gps-viewer.com/tracks/egiz/Chemin-de-Saint-Jacques-de-Compostelle/

DavidHenryThoreau commented 5 months ago

Can you reproduce my error by importing these GPX ?

joaovitoriasilva commented 4 months ago

Hello again,

Yes I was able to reproduce the error: "in calculate_instant_speed time_calc = datetime.fromisoformat(time.strftime("%Y-%m-%dT%H:%M:%S")) ^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'strftime'"

I opened the .gpx files provided and those files appear to be route files and not "normal" activities files generated after you do an activity, which means they lack certain types of fields like time, HR, others. The activity processor flow used uses the field time to do some calculations, and that's why it is not working.

Example:

Can you upload a .gpx file exported from Strava, Garmin Connect, other equivalent and check if it works?

DavidHenryThoreau commented 4 months ago

I'm not using Strava or Garmin Connect

joaovitoriasilva commented 4 months ago

Maybe route support can be implemented in the future