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

Unable to edit Workout #65

Closed wills106 closed 5 months ago

wills106 commented 5 months ago

Just going through my imported Workouts from FitoTrack and noticed one had a top speed of 20km/m near the end. So I wanted to see if I could trim the walk to remove the last few mins. But I get the following error when I press the edit button:

image

I'm not sure if a log file records any further information or not as I only have the /data folder exposed on Unraid. If an error log is created would it be possible to have a copy stored in /data with the database file?

jovandeginste commented 5 months ago

The output goes to stdout

jovandeginste commented 5 months ago

You can't edit the gpx file through this application, by the way - you can edit outside and replace the workout entry...

wills106 commented 5 months ago

For some reason the docker log wasn't retuning anything before. Tried again and got:

{"time":"2024-04-07T17:14:15.516189791+01:00","level":"-","prefix":"echo","file":"recover.go","line":"120","message":"[PANIC RECOVER] runtime error: invalid memory address or nil pointer dereference goroutine 1749 [running]:\ngithub.com/jovandeginste/workout-tracker/pkg/app.newEcho.Recover.RecoverWithConfig.func2.1.1()\n\t/app/vendor/github.com/labstack/echo/v4/middleware/recover.go:100 +0x165\npanic({0xd5fe00?, 0x2cee9f0?})\n\t/usr/local/go/src/runtime/panic.go:770 +0x132\ngithub.com/jovandeginste/workout-tracker/pkg/database.(*Workout).statisticsWithUnit(0xd544a0?, {0xe2d742?, 0xe31aaf?})\n\t/app/pkg/database/workouts_statistics.go:89 +0x33\ngithub.com/jovandeginste/workout-tracker/pkg/database.(*Workout).StatisticsPerKilometer(...)\n\t/app/pkg/database/workouts_statistics.go:81\ngithub.com/jovandeginste/workout-tracker/pkg/app.(*App).workoutsEditHandler(0xc0002310e0, {0x23064b0, 0xc0000360a0})\n\t/app/pkg/app/workouts_handlers.go:126 +0xb2\ngithub.com/labstack/echo-jwt/v4.Config.ToMiddleware.func2.1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/labstack/echo-jwt/v4/jwt.go:237 +0x3dd\ngithub.com/labstack/echo/v4.(*Echo).add.func1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/labstack/echo/v4/echo.go:582 +0x4b\ngithub.com/jovandeginste/workout-tracker/pkg/app.(*App).ConfigureWebserver.LoadAndSave.LoadAndSaveWithConfig.func2.1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/spazzymoto/echo-scs-session/session.go:90 +0x1cb\ngithub.com/labstack/echo/v4/middleware.GzipWithConfig.func1.1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/labstack/echo/v4/middleware/compress.go:140 +0x2a3\ngithub.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/labstack/echo/v4/middleware/cors.go:204 +0x463\ngithub.com/jovandeginste/workout-tracker/pkg/app.newEcho.Secure.SecureWithConfig.func3.1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/labstack/echo/v4/middleware/secure.go:142 +0x364\ngithub.com/jovandeginste/workout-tracker/pkg/app.newEcho.Recover.RecoverWithConfig.func2.1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/labstack/echo/v4/middleware/recover.go:131 +0x114\ngithub.com/jovandeginste/workout-tracker/pkg/app.newEcho.New.NewWithConfig.func1.1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/samber/slog-echo/middleware.go:123 +0x2ee\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP.func1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/labstack/echo/v4/echo.go:663 +0x127\ngithub.com/jovandeginste/workout-tracker/pkg/app.newEcho.RemoveTrailingSlash.RemoveTrailingSlashWithConfig.func4.1({0x23064b0, 0xc0000360a0})\n\t/app/vendor/github.com/labstack/echo/v4/middleware/slash.go:118 +0x1fd\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc000232fc8, {0x22f7020, 0xc0008942a0}, 0xc0001530e0)\n\t/app/vendor/github.com/labstack/echo/v4/echo.go:669 +0x327\nnet/http.serverHandler.ServeHTTP({0xc0009949c0?}, {0x22f7020?, 0xc0008942a0?}, 0x6?)\n\t/usr/local/go/src/net/http/server.go:3137 +0x8e\nnet/http.(*conn).serve(0xc00099c240, {0x22f8618, 0xc000647d40})\n\t/usr/local/go/src/net/http/server.go:2039 +0x5e8\ncreated by net/http.(*Server).Serve in goroutine 1\n\t/usr/local/go/src/net/http/server.go:3285 +0x4b4\n\ngoroutine 1 [IO wait]:\ninternal/poll.runtime_pollWait(0x154c22f81f50, 0x72)\n\t/usr/local/go/src/runtime/netpoll.go:345 +0x85\ninternal/poll.(*pollDesc).wait(0x7?, 0xc000148b10?, 0x0)\n\t/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27\ninternal/poll.(*pollDesc).waitRead(...)\n\t/usr/local/go/src/internal/poll/fd_poll_runtime.go:89\ninternal/poll.(*FD).Accept(0xc000639c80)\n\t/usr/local/go/src/internal/poll/fd_unix.go:611 +0x2ac\nnet.(*netFD).accept(0xc000639c80)\n\t/usr/local/go/src/net/fd_unix.go:172 +0x29\nnet.(*TCPListener).accept(0xc000355420)\n\t/usr/local/go/src/net/tcpsock_posix.go:159 +0x1e\nnet.(*TCPListener).AcceptTCP(0xc000355420)\n\t/usr/local/go/src/net/tcpsock.go:314 +0x30\ngithub.com/labstack/echo/v4.tcpKeepAliveListener.Accept({0x447d80?})\n\t/app/vendor/github.com/labstack/echo/v4/echo.go:989 +0x17\nnet/http.(*Server).Serve(0xc0004491d0, {0x22f6e70, 0xc0005eaa70})\n\t/usr/local/go/src/net/http/server.go:3255 +0x33e\ngithub.com/labstack/echo/v4.(*Echo).Start(0xc000232fc8, {0xe344e8, 0x9})\n\t/app/vendor/github.com/labstack/echo/v4/echo.go:686 +0xd2\ngithub.com/jovandeginste/workout-tracker/pkg/\n"}
> {"time":"2024-04-07T17:14:15.516247304+01:00","level":"ERROR","msg":"Internal Server Error","app":"workout-tracker","version":"master","sha":"179acb773e6a18463d30b801fcbaf8f9273d588a","module":"webserver","request":{"time":"2024-04-07T17:14:15.513971094+01:00","method":"GET","host":"ipaddress:8083","path":"/workouts/78/edit","query":"","params":{"id":"78"},"route":"/workouts/:id/edit","ip":"192.168.1.156","referer":"http://ipaddress:8083/workouts/78","length":0},"response":{"time":"2024-04-07T17:14:15.516239978+01:00","latency":2268883,"status":500,"length":0}}

What should the edit function let you do? Rename the workout?

jovandeginste commented 5 months ago

Yes and edit notes; not much, really... I'll look into the NPE

wills106 commented 5 months ago

Just letting you know this is working ok now. I have imported a few workouts with no names and I can add the date/time back into the title now.