Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stats won't update #406

Open
ajpanton opened this issue Nov 15, 2024 · 3 comments
Open

Stats won't update #406

ajpanton opened this issue Nov 15, 2024 · 3 comments

Comments

@ajpanton
Copy link

The "Update stats" doesn't update anything. It creates a "Stats updated" notification, but nothing was updated.

This is after destroying all my imports from Google takeout, so the expected behavior is to delete stats. The only points left are from the last half a day, confirmed by the "map" and "points" tabs. However the stats page still shows stats from the last 10 years, from which I imported data.

Logs from the container (click to open) 15:34:40 web.1 | D, [2024-11-15T15:34:40.349882 #100] DEBUG -- : User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1], ["LIMIT", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.350478 #100] DEBUG -- : ↳ app/controllers/application_controller.rb:11:in `unread_notifications'

15:34:40 web.1 | I, [2024-11-15T15:34:40.351795 #100] INFO -- : Enqueued Stats::CalculatingJob (Job ID: 8e6ea4a2-a0cf-4bbb-a83d-ef2db1f21187) to Sidekiq(stats) with arguments: 1

15:34:40 web.1 | I, [2024-11-15T15:34:40.352176 #100] INFO -- : ↳ app/controllers/stats_controller.rb:16:in `update'

15:34:40 web.1 | I, [2024-11-15T15:34:40.352521 #100] INFO -- : {"method":"POST","path":"/stats","format":"turbo_stream","controller":"StatsController","action":"update","status":303,"allocations":1781,"duration":4.78,"view":0.0,"db":0.52,"location":"https://[domain]/stats"}

15:34:40 web.1 | D, [2024-11-15T15:34:40.394719 #100] DEBUG -- : User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1], ["LIMIT", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.395318 #100] DEBUG -- : ↳ app/controllers/application_controller.rb:11:in `unread_notifications'

15:34:40 web.1 | D, [2024-11-15T15:34:40.398514 #100] DEBUG -- : Stat Load (1.8ms) SELECT "stats".* FROM "stats" WHERE "stats"."user_id" = $1 [["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.398930 #100] DEBUG -- : ↳ app/controllers/stats_controller.rb:7:in `group_by'

15:34:40 web.1 | D, [2024-11-15T15:34:40.401671 #100] DEBUG -- : Rendering layout layouts/application.html.erb

15:34:40 web.1 | D, [2024-11-15T15:34:40.401719 #100] DEBUG -- : Rendering stats/index.html.erb within layouts/application

15:34:40 web.1 | D, [2024-11-15T15:34:40.402370 #100] DEBUG -- : Stat Sum (0.2ms) SELECT SUM("stats"."distance") FROM "stats" WHERE "stats"."user_id" = $1 [["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.402762 #100] DEBUG -- : ↳ app/models/user.rb:40:in `total_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.403786 #100] DEBUG -- : Point Count (0.4ms) SELECT COUNT(*) FROM "points" WHERE "points"."user_id" = $1 [["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.404157 #100] DEBUG -- : ↳ app/views/stats/index.html.erb:14

15:34:40 web.1 | D, [2024-11-15T15:34:40.405075 #100] DEBUG -- : Point Count (0.4ms) SELECT COUNT("points"."id") FROM "points" WHERE "points"."user_id" = $1 AND "points"."geodata" != $2 [["user_id", 1], ["geodata", "{}"]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.405466 #100] DEBUG -- : ↳ app/models/user.rb:52:in `total_reverse_geocoded'

15:34:40 web.1 | D, [2024-11-15T15:34:40.407004 #100] DEBUG -- : Stat Pluck (0.3ms) SELECT "stats"."toponyms" FROM "stats" WHERE "stats"."user_id" = $1 AND "stats"."toponyms" IS NOT NULL [["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.407389 #100] DEBUG -- : ↳ app/models/user.rb:28:in `cities_visited'

15:34:40 web.1 | D, [2024-11-15T15:34:40.408176 #100] DEBUG -- : CACHE Stat Pluck (0.0ms) SELECT "stats"."toponyms" FROM "stats" WHERE "stats"."user_id" = $1 AND "stats"."toponyms" IS NOT NULL [["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.408426 #100] DEBUG -- : ↳ app/models/user.rb:28:in `cities_visited'

15:34:40 web.1 | D, [2024-11-15T15:34:40.410087 #100] DEBUG -- : Stat Load (0.4ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2024], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.410520 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.411208 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2024], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.411526 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.412626 #100] DEBUG -- : Stat Load (0.3ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2023], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.414198 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.414841 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2023], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.415137 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.416191 #100] DEBUG -- : Stat Load (0.3ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2022], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.416589 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.417189 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2022], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.417472 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.418517 #100] DEBUG -- : Stat Load (0.4ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2021], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.418892 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.419515 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2021], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.419791 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.420817 #100] DEBUG -- : Stat Load (0.3ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2020], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.421211 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.421817 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2020], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.422111 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.423176 #100] DEBUG -- : Stat Load (0.4ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2019], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.423603 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.424229 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2019], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.424526 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.425591 #100] DEBUG -- : Stat Load (0.3ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2018], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.425982 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.426602 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2018], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.426897 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.427931 #100] DEBUG -- : Stat Load (0.3ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2017], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.428339 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.428902 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2017], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.429220 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.430191 #100] DEBUG -- : Stat Load (0.3ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2016], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.430623 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.431196 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2016], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.431513 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.432496 #100] DEBUG -- : Stat Load (0.3ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2015], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.432921 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.433540 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2015], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.433841 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.434795 #100] DEBUG -- : Stat Load (0.2ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2014], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.435224 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.435769 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2014], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.436092 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.436990 #100] DEBUG -- : Stat Load (0.2ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2013], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.437430 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.437945 #100] DEBUG -- : CACHE Stat Load (0.0ms) SELECT "stats".* FROM "stats" WHERE "stats"."year" = $1 AND "stats"."user_id" = $2 ORDER BY "stats"."month" ASC [["year", 2013], ["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.438278 #100] DEBUG -- : ↳ app/models/stat.rb:38:in `block in year_distance'

15:34:40 web.1 | D, [2024-11-15T15:34:40.457869 #100] DEBUG -- : Notification Load (0.9ms) SELECT "notifications".* FROM "notifications" WHERE "notifications"."user_id" = $1 AND "notifications"."read_at" IS NULL ORDER BY "notifications"."created_at" DESC [["user_id", 1]]

15:34:40 web.1 | D, [2024-11-15T15:34:40.458348 #100] DEBUG -- : ↳ app/views/shared/_navbar.html.erb:72

15:34:40 web.1 | I, [2024-11-15T15:34:40.460629 #100] INFO -- : {"method":"GET","path":"/stats","format":"turbo_stream","controller":"StatsController","action":"index","status":200,"allocations":47561,"duration":68.04,"view":52.88,"db":8.35}

@Freika
Copy link
Owner

Freika commented Nov 18, 2024

@ajpanton the logs are from the dawarich_app container, while the stats updating is being processed in the dawarich_sidekiq, can you provide logs from there?

@ajpanton
Copy link
Author

I'll see if I get a chance to reproduce this again some day, because I already rebuilt and re-imported everything.

@shaman007
Copy link
Contributor

@Freika, I think I have kind of similar situation.

This is my 'stats' page:

image

There is no 2019, but it's accessible with URL:

image

All stats are 0! But if we go at some month, it's fine:

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants