danielalvsaaker / tf-viewer

Selfhosted web dashboard for activity tracking - written in Rust!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Activity does not contain any geographic data

datvance opened this issue · comments

Hey, cool project, been looking for something like this, and saw you just posted about it on r/selfhosted.

So I spun this up easily in a docker container and uploaded my last 10 .FIT files from my Garmin Forerunner 25 (yeah, a pretty old model), but on viewing the activities in the app I don't see any map, only the message, "Activity does not contain any geographic data". I do see the speed/distance graph at the bottom, and the summary on the right, but no map.

Any insight into why it's not finding GPS data / displaying the map? Are there different versions of FIT files? Other sites/apps like Garmin Connect, MapMyRun and Strava all show maps for my activities.

Thanks again, I really hope to get this working.

Hey, thanks!

I managed to reproduce your issue. I manually checked for the values "swc_lat" (south west corner), "nec_lat" (north east corner") etc. to check if a file contains coordinates and set map bounds, and discarded the map if missing. I falsely assumed every version of the FIT format contained these values.

I'll fix the issue promptly.

Fixed in d57190d. New docker image has been pushed. Delete the database and reupload files.

Thanks for your quick response. I pulled the new image, and now when I try to view an activity I get a blank screen and 10 lines of this in the logs:

"thread 'actix-rt:worker:0' panicked at 'called Option::unwrap()on aNone value', src/routes/activity.rs:36:10"

Backtrace:

tf-viewer    |    0: rust_begin_unwind
tf-viewer    |              at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
tf-viewer    |    1: core::panicking::panic_fmt
tf-viewer    |              at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/panicking.rs:92:14
tf-viewer    |    2: core::panicking::panic
tf-viewer    |              at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/panicking.rs:50:5
tf-viewer    |    3: <T as askama_actix::TemplateIntoResponse>::into_response
tf-viewer    |    4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
tf-viewer    |    5: <actix_web::handler::HandlerServiceResponse<T,R> as core::future::future::Future>::poll
tf-viewer    |    6: <actix_web::handler::ExtractResponse<T,S> as core::future::future::Future>::poll
tf-viewer    |    7: <actix_web::handler::ExtractResponse<T,S> as core::future::future::Future>::poll
tf-viewer    |    8: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
tf-viewer    |    9: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
tf-viewer    |   10: <core::pin::Pin<P> as core::future::future::Future>::poll
tf-viewer    |   11: <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll
tf-viewer    |   12: <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll
tf-viewer    |   13: <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll
tf-viewer    |   14: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
tf-viewer    |   15: actix_http::h1::dispatcher::InnerDispatcher<T,S,B,X,U>::handle_request
tf-viewer    |   16: actix_http::h1::dispatcher::InnerDispatcher<T,S,B,X,U>::poll_request
tf-viewer    |   17: <actix_http::h1::dispatcher::Dispatcher<T,S,B,X,U> as core::future::future::Future>::poll
tf-viewer    |   18: <actix_service::and_then::AndThenServiceResponse<A,B> as core::future::future::Future>::poll
tf-viewer    |   19: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
tf-viewer    |   20: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
tf-viewer    |   21: tokio::runtime::task::raw::poll
tf-viewer    |   22: std::thread::local::LocalKey<T>::with
tf-viewer    |   23: tokio::task::local::LocalSet::tick
tf-viewer    |   24: tokio::macros::scoped_tls::ScopedKey<T>::set
tf-viewer    |   25: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
tf-viewer    |   26: std::thread::local::LocalKey<T>::with
tf-viewer    |   27: tokio::macros::scoped_tls::ScopedKey<T>::set
tf-viewer    |   28: tokio::runtime::context::enter

My bad🤦‍♂️ You did reupload the files after deleting the database, right? I'll implement better error handling in the templates to prevent panics.

Thanks, it all works now.