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

Location of workouts showing as unknown #160

Closed nrevolt closed 3 months ago

nrevolt commented 4 months ago

After importing workout from 05/27/2024, I noticed that it's Location was unknown, all previous workouts showed correct City, Province.

I refreshed all workouts, and the location to all previously imported workouts, also changed to unknown location. Deleted a workout and re-imported, same problem. I had recently switched from Chrome to Firefox, and thought that may have been the issue, so I launched Chrome and logged into Workout-Tracker in Chrome, refresh all workouts, and tried re-importing a workout same problem.

Using most current version: branch master (0fe05a80) Also tried downgrading to: v0.14.1 (0e6f0c5b) issue persists

jovandeginste commented 4 months ago

Could you provide me with a sample gpx?

nrevolt commented 4 months ago

20240529_140526.zip

nrevolt commented 4 months ago

On the off chance that Samsung made some changes, here is a gpx file from last month, that showed the correct location, (Toronto, Ontario) prior to this week when I did a refresh.

20220407_180347.zip

jovandeginste commented 4 months ago

Which version are you using?

jovandeginste commented 4 months ago

If you are running a release version (and not master), this could be the same issue as #146

This is fixed, but not yet released.

nrevolt commented 4 months ago

Which version are you using?

Was running branch master (0fe05a80) when I first noticed the problem. Just updated to branch master (0d0101d1) and refreshed workouts, problem persists.

In case it matters, running in Docker under Unraid and repository is: ghcr.io/jovandeginste/workout-tracker:master

jovandeginste commented 4 months ago

Does the container have access to the internet? It uses openstreetmap to convert lat/lon to an address. When I update the workout, it says "Toronto" and "Bedford" ...

nrevolt commented 4 months ago

The container does have access to the internet, and I am able to ping openstreetmaps.org from a console opened from the container as per the attached screencap. I did a fresh install and problem persists. chrome_mL1HYJhm2A

betov69 commented 3 months ago

Hello all, I present the same error, I share the information so that we can solve this problem, excuse my English, greetings

Version Workout: [branch docker-arm (c88c551d)] Version RunnerUp: v2.6.0.2

RunnerUp_SM-A525M_2024-06-01-07-57-31_Running.zip

firefox_ayH2zP8d7A

jovandeginste commented 3 months ago

@betov69 could you make sure you use the latest release? When I import your gpx, I get the correct location:

image

betov69 commented 3 months ago

Hello, thank you very much for responding, I just updated the version of the docker container to the: Workout Tracker, v0.15.0 (0fe05a80)

imagen

workout-tracker:
    image: ghcr.io/jovandeginste/workout-tracker:latest
    restart: unless-stopped

Unfortunately I still have the same problem. As additional information, I remember that I recently added two additional options:

- WT_REGISTRATION_DISABLED=1
- WT_SOCIALS_DISABLED=1

but I highly doubt that they are related to the problem, I even added the training of the colleague from Toronto and it also appeared to me as unknown, I don't know what is happening

nrevolt commented 3 months ago

Upgraded to ghcr.io/jovandeginste/workout-tracker:latest, and problem persists.

You mentioned the two additional options you recently added, and like you doubted they related to the problem, however it was around the same time I implemented the two options as variables, that the unknown location problem started. Never brought it up previously since a fresh install into a new docker image, and a different data folder continued to show the problem.

jovandeginste commented 3 months ago

I'll add debug information in a next release

betov69 commented 3 months ago

Thank you very much

jovandeginste commented 3 months ago

The current version already has DEBUG logging. If you run with WT_DEBUG=true, and add the GPX (or refresh the workout), you should get a line like this:

9:56AM INF SQL query executed [22.404436ms] app=workout-tracker version=master sha=44bb39cd4d0d78e7d412d00b9b01745dbe2cfdc2 module=database 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,id) VALUES (\"2024-05-31 18:25:23.606\",\"2024-06-03 09:56:35.386\",NULL,219,\"Samsung Health_0.2\",\"20240529_140526.gpx\",\"{\"\"Lat\"\":43.69838552092704,\"\"Lng\"\":-79.30457942134832}\",\"{\"\"FormattedAddress\"\":\"\"Taylor Creek Trail, Woodbine Heights, Beaches—East York, East York, Toronto, Golden Horseshoe, Ontario, M4C 4T4, Canada\"\",\"\"Street\"\":\"\"Taylor Creek Trail\"\",\"\"HouseNumber\"\":\"\"\"\",\"\"Suburb\"\":\"\"East York\"\",\"\"Postcode\"\":\"\"M4C 4T4\"\",\"\"State\"\":\"\"Ontario\"\",\"\"StateCode\"\":\"\"\"\",\"\"StateDistrict\"\":\"\"\"\",\"\"County\"\":\"\"\"\",\"\"Country\"\":\"\"Canada\"\",\"\"CountryCode\"\":\"\"CA\"\",\"\"City\"\":\"\"Toronto\"\"}\",3024.907481902884,2154000000000,1.6835604768216892,5000000005,135.05223233170423,141.29623233170423,29.978099999999912,28.988099999999918,NULL,231) ON CONFLICT (id) DO UPDATE SET workout_id=excluded.workout_id RETURNING id" duration=22.404436ms rows=1 file=/workout-tracker/pkg/database/workouts.go:220

Could you verify the Lat, Lng and FormattedAddress in the output? As you can see, the address contains the full address of the center of the workout.

betov69 commented 3 months ago

Hello, thank you very much for following up on my problem, I really appreciate it, I enabled the Debug option to true and updated the training as you mentioned, it took me a lot of work to check the log but I didn't find the information you asked for:

2024-06-03T15:30:53.548375389Z INFO msg=SQL query executed [2.9261ms] app=workout-tracker version=v0.15.0 sha=0fe05a807206885e10716cad2f1978d995331c5c module=database query=INSERT INTO gpx_data (created_at,updated_at,deleted_at,workout_id,content,checksum,filename,id) VALUES ("2024-06-03 15:28:00.646","2024-06-03 15:28:00.646",NULL,124,"","","RunnerUp_SM-A525M_2024-06-01-07-57-31_Running.gpx",124) ON CONFLICT (id) DO UPDATE SET workout_id=excluded.workout_id RETURNING id duration=2926100 rows=1 file=/app/pkg/database/workouts.go:210

{"time":"2024-06-03T15:40:57.107083859Z","level":"INFO","msg":"SQL query executed [387.003µs]","app":"workout-tracker","version":"v0.15.0","sha":"0fe05a807206885e10716cad2f1978d995331c5c","module":"database","query":"SELECT FROM users WHERE users.username = \"beto\" AND users.deleted_at IS NULL ORDER BY users.id LIMIT 1","duration":387003,"rows":1,"file":"/app/pkg/database/user.go:117"} {"time":"2024-06-03T15:40:57.11304762Z","level":"INFO","msg":"SQL query executed [3.589384ms]","app":"workout-tracker","version":"v0.15.0","sha":"0fe05a807206885e10716cad2f1978d995331c5c","module":"database","query":"SELECT FROM map_data WHERE map_data.workout_id IN (124,121,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2) AND map_data.deleted_at IS NULL","duration":3589384,"rows":118,"file":"/app/pkg/database/user.go:254"}

I hope it is useful, I am waiting, thank you and greetings

jovandeginste commented 3 months ago

No, I need the line matching INSERT INTO map_data... Maybe remove the workout and add it back?

betov69 commented 3 months ago

The line you mention does not appear, let me tell you what I do to know if it is correct:

Is it the correct way or did I forget to omit something, I appreciate the feedback

jovandeginste commented 3 months ago

No, this is correct; are you able to run a clean installation, to test?

betov69 commented 3 months ago

Hello, thank you very much for the feedback, of course it is but I will have to do it at night, as soon as I do the clean installation I will comment on the results, again thank you very much

betov69 commented 3 months ago

Good evening, I just created a new container called demo and unfortunately I get the same results

{"time":"2024-06-04T03:23:11.920499965Z","level":"INFO","msg":"SQL query executed [15.584449ms]","app":"workout-tracker","version":"v0.15.0","sha":"0fe05a807206885e10716cad2f1978d995331c5c","module":"database","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-06-04 03:23:11.904\",\"2024-06-04 03:23:11.904\",NULL,4,\"RunnerUp SM-A525M\",\"RunnerUp-Running-2024-06-01T13:57:31Z\",\"{\"\"Lat\"\":19.484092458715782,\"\"Lng\"\":-99.12433610871645}\",NULL,3094.402307518108,2167000000000,5.241230479192305,374000000374,2230.980868580703,2243.626868580703,146.10838000000558,144.81988000000547,NULL) ON CONFLICT (id) DO UPDATE SET workout_id=excluded.workout_id RETURNING id","duration":15584449,"rows":1,"file":"/app/pkg/database/workouts.go:202"}

imagen

jovandeginste commented 3 months ago

Suddenly I can reproduce the issue!

jovandeginste commented 3 months ago

The problem seems to be with the geocoder API, which takes about 13 seconds now, for me; the default timeout in the library is 8 seconds.

jovandeginste commented 3 months ago

I added a (partial) fix in #164 - would you please try this build?

jovandeginste commented 3 months ago

Also see: https://github.com/codingsince1985/geo-golang/issues/78

nrevolt commented 3 months ago

Switched back to repository: ghcr.io/jovandeginste/workout-tracker:master which I believe contains the partial fix (please correct me if I am not doing this correctly). Deleted the workout associated with the attached GPX and problem persists. Assuming it has to do with the geocoder issue you mentioned.

Here is the debug info:

On Tue, Jun 4, 2024 at 6:26 AM Jo Vandeginste @.***> wrote:

I added a (partial) fix in #164 https://github.com/jovandeginste/workout-tracker/pull/164 - would you please try this build?

— Reply to this email directly, view it on GitHub https://github.com/jovandeginste/workout-tracker/issues/160#issuecomment-2147176563, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBPVYUGXGYX43BPOEMKUZA3ZFWI5RAVCNFSM6AAAAABIQAK7ZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBXGE3TMNJWGM . You are receiving this because you authored the thread.Message ID: @.***>

betov69 commented 3 months ago

I added a (partial) fix in #164 - would you please try this build?

Unfortunately it still doesn't work

imagen

jovandeginste commented 3 months ago

There should now be log lines if a timeout happens

betov69 commented 3 months ago

I show the logs

{"time":"2024-06-04T16:48:03.270237529Z","level":"INFO","msg":"SQL query executed [15.044596ms]","app":"workout-tracker","version":"master","sha":"fb0b77da206f023456701462bfaa18517773c9b2","module":"database","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-06-04 16:48:03.255\",\"2024-06-04 16:48:03.255\",NULL,7,\"RunnerUp SM-A525M\",\"RunnerUp-Running-2024-06-01T13:57:31Z\",\"{\"\"Lat\"\":19.484092458715782,\"\"Lng\"\":-99.12433610871645}\",NULL,3094.402307518108,2167000000000,5.241230479192305,374000000374,2230.980868580703,2243.626868580703,146.10838000000558,144.81988000000547,NULL) ON CONFLICT (id) DO UPDATE SET workout_id=excluded.workout_id RETURNING id","duration":15044596,"rows":1,"file":"/app/pkg/database/workouts.go:212"} {"time":"2024-06-04T16:48:03.273025671Z","level":"INFO","msg":"SQL query executed [2.476459ms]","app":"workout-tracker","version":"master","sha":"fb0b77da206f023456701462bfaa18517773c9b2","module":"database","query":"INSERT INTO gpx_data (created_at,updated_at,deleted_at,workout_id,content,checksum,filename) VALUES (\"2024-06-04 16:48:03.27\",\"2024-06-04 16:48:03.27\",NULL,7,\"\",\"\",\"RunnerUp_SM-A525M_2024-06-01-07-57-31_Running.gpx\") ON CONFLICT (id) DO UPDATE SET workout_id=excluded.workout_id RETURNING id","duration":2476459,"rows":1,"file":"/app/pkg/database/workouts.go:212"}

jovandeginste commented 3 months ago

No single log line containing "OpenStreetMap" ?

jovandeginste commented 3 months ago

I added even more logging now

nrevolt commented 3 months ago

Only 2 lines from most current import contained "OpenStreetMap" as per below, and only the 1

2024-06-04T22:21:02.044068762Z {"time":"2024-06-04T18:21:02.043997282-04:00","level":"INFO","prefix":"-","file":"workouts_map.go","line":"177","message":"OpenStreetMap reverse geocoding {43.711251, -79.298477}"}

2024-06-04T22:21:02.447613162Z {"time":"2024-06-04T18:21:02.447400155-04:00","level":"ERROR","prefix":"-","file":"workouts_map.go","line":"189","message":"OpenStreetMap geocoding error: invalid character '<' looking for beginning of value"}

jovandeginste commented 3 months ago

Seems like the issue described here: codingsince1985/geo-golang#78

jovandeginste commented 3 months ago

Please let me know if this is working for you @nrevolt and @betov69

nrevolt commented 3 months ago

Problem appears to have been resolved. Thank you.

On Fri, Jun 7, 2024 at 5:25 AM Jo Vandeginste @.***> wrote:

Closed #160 https://github.com/jovandeginste/workout-tracker/issues/160 as completed via #168 https://github.com/jovandeginste/workout-tracker/pull/168.

— Reply to this email directly, view it on GitHub https://github.com/jovandeginste/workout-tracker/issues/160#event-13077818369, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBPVYUGA4CQN4XRLHAWFXI3ZGF37BAVCNFSM6AAAAABIQAK7ZKVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGA3TOOBRHAZTMOI . You are receiving this because you authored the thread.Message ID: @.*** com>

betov69 commented 3 months ago

Please let me know if this is working for you @nrevolt and @betov69

I confirm that the incident has been corrected, thank you very much

imagen