Issues upgrading from 0.36.4 to 1.0.3 (Login 500 Error) -> 1.0.2 (Stats/Insights broken & Slow)

Hi everyone,

I am trying to bring my Dawarich instance up to date, upgrading from version 0.36.4 to 1.0.3. I am running via Docker Compose on a NUC.

I have encountered several issues and am currently stuck on a partially working version 1.0.2. Here is what I have tried:

Attempt 1: Direct upgrade to v1.0.3 (latest) I updated my docker-compose.yml to pull latest (1.0.3) and changed the database image to postgis/postgis:17-3.5-alpine. I ran the migration manually to ensure the DB was updated: docker compose exec dawarich_app bundle exec rails db:migrate (The migration finished without crashing, though with some auth warnings).

  • Result: The login page loads, but as soon as I log in, I get a 500 Internal Server Error.

  • Logs: The logs show a NameError related to the navbar: ActionView::Template::Error (undefined local variable or method 'settings_path' for an instance of #<Class:0x...>) It seems like the navbar is trying to link to a settings path that doesn’t exist in this context.

Attempt 2: Downgrading to v1.0.2 Since 1.0.3 seemed broken on the frontend, I pinned the image to freikin/dawarich:1.0.2 in my compose file and recreated the container. I also ran rails tmp:clear and cleared my browser cache/cookies.

  • Result: I can now log in successfully!

  • New Issues:

    1. Broken Pages: Clicking on Stats or Insights results in a “500 Internal Server Error”.

    2. Performance: The map view is extremely slow when changing days or loading points. It feels much heavier than 0.36.4.

Steps taken so far:

  1. Ran db:migrate inside the container (successful).

  2. Ran tmp:clear to remove cached files.

  3. Verified that dawarich_app container is healthy.

  4. Tried distinct browsers (Brave/Edge) to rule out caching issues.

Has anyone experienced this settings_path error on 1.0.3, or do you have any advice on fixing the broken Stats/Insights pages on 1.0.2?

Thanks in advance!

Please update to 1.0.4, the issue should be solved there. As for map performance, make sure sidekiq jobs are processed, it’s possible that initial update scheduled lots of jobs that affects resource consumption. Once they are done, performance should return to normal

1 Like

Thanks

I have updated to 1.0.4 and verified that Sidekiq is fully drained and idle (I only have 1 month of data). The login works perfectly now, thanks!

However, the Stats and Insights pages still crash with a 500 error. Looking at the logs, it could be an issue with missing user settings (likely distance units) causing a crash in the DistanceConvertible concern.

The Error: NoMethodError (undefined method 'to_sym' for nil) Location: app/models/concerns/distance_convertible.rb:44:in 'DistanceConvertible::ClassMethods#convert_distance'

It seems like the migration from 0.36 → 1.0.4 didn’t set a default distance unit, so when the view tries to convert the distance, it fails on a nil value.

spookie@NUC:/opt/Docker/dawarich$ docker compose logs --tail=50 dawarich_app
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:null,“controller”:“PointsChannel”,“action”:“unsubscribe”,“status”:200,“allocations”:34,“duration”:0.07}
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:null,“controller”:“TracksChannel”,“action”:“unsubscribe”,“status”:200,“allocations”:34,“duration”:0.09}
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:{},“controller”:“ApplicationCable::Connection”,“action”:“disconnect”,“status”:200,“allocations”:245,“duration”:0.7}
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:{},“controller”:“ApplicationCable::Connection”,“action”:“connect”,“status”:200,“allocations”:505,“duration”:3.53}
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:null,“controller”:“NotificationsChannel”,“action”:“subscribe”,“status”:200,“allocations”:103,“duration”:0.19}
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:null,“controller”:“FamilyLocationsChannel”,“action”:“unsubscribe”,“status”:200,“allocations”:18,“duration”:0.04}
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:null,“controller”:“FamilyLocationsChannel”,“action”:“subscribe”,“status”:200,“allocations”:331,“duration”:0.73}
dawarich_app | {“method”:“GET”,“path”:“/api/v1/tags/privacy_zones”,“format”:“/”,“controller”:“Api::V1::TagsController”,“action”:“privacy_zones”,“status”:200,“allocations”:998,“duration”:3.22,“view”:0.09,“db”:0.92}
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:null,“controller”:“PointsChannel”,“action”:“subscribe”,“status”:200,“allocations”:103,“duration”:0.17}
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:null,“controller”:“TracksChannel”,“action”:“subscribe”,“status”:200,“allocations”:119,“duration”:0.23}
dawarich_app | {“method”:“GET”,“path”:“/api/v1/places”,“format”:“/”,“controller”:“Api::V1::PlacesController”,“action”:“index”,“status”:200,“allocations”:2477,“duration”:4.89,“view”:0.07,“db”:2.31}
dawarich_app | {“method”:“GET”,“path”:“/api/v1/areas”,“format”:“/”,“controller”:“Api::V1::AreasController”,“action”:“index”,“status”:200,“allocations”:2010,“duration”:4.27,“view”:0.36,“db”:3.05}
dawarich_app | {“method”:“PATCH”,“path”:“/api/v1/settings”,“format”:“/”,“controller”:“Api::V1::SettingsController”,“action”:“update”,“status”:200,“allocations”:1268,“duration”:3.73,“view”:0.29,“db”:0.47}
dawarich_app | {“method”:“GET”,“path”:“/api/v1/countries/borders.json”,“format”:“json”,“controller”:“Api::V1::Countries::BordersController”,“action”:“index”,“status”:200,“allocations”:1971708,“duration”:910.87,“view”:458.92,“db”:0.34}
dawarich_app | {“method”:“GET”,“path”:“/insights”,“format”:“html”,“controller”:“InsightsController”,“action”:“index”,“status”:500,“allocations”:1362,“duration”:4.25,“view”:0.0,“db”:1.01}
dawarich_app |
dawarich_app | NoMethodError (undefined method ‘to_sym’ for nil):
dawarich_app |
dawarich_app | app/models/concerns/distance_convertible.rb:44:in ‘DistanceConvertible::ClassMethods#convert_distance’
dawarich_app | app/services/insights/year_totals_calculator.rb:42:in ‘Insights::YearTotalsCalculator#calculate_total_distance’
dawarich_app | app/services/insights/year_totals_calculator.rb:27:in ‘Insights::YearTotalsCalculator#call’
dawarich_app | app/controllers/insights_controller.rb:43:in ‘InsightsController#load_year_totals’
dawarich_app | app/controllers/insights_controller.rb:14:in ‘InsightsController#index’
dawarich_app | {“method”:“GET”,“path”:“/stats”,“format”:“html”,“controller”:“StatsController”,“action”:“index”,“status”:500,“allocations”:2134,“duration”:14.02,“view”:0.0,“db”:0.86}
dawarich_app |
dawarich_app | ActionView::Template::Error (undefined method ‘to_sym’ for nil)
dawarich_app | Caused by: NoMethodError (undefined method ‘to_sym’ for nil)
dawarich_app |
dawarich_app | Information for: ActionView::Template::Error (undefined method ‘to_sym’ for nil):
dawarich_app | 13:
dawarich_app | 14:
dawarich_app | 15:
dawarich_app | 16: <%= number_with_delimiter(current_user.total_distance.round) %> <%= current_user.safe_settings.distance_unit %>
dawarich_app | 17:
dawarich_app | 18: Total distance
dawarich_app | 19:
dawarich_app |
dawarich_app | app/models/concerns/distance_convertible.rb:44:in ‘DistanceConvertible::ClassMethods#convert_distance’
dawarich_app | app/models/user.rb:61:in ‘block in User#total_distance’
dawarich_app | app/models/user.rb:59:in ‘User#total_distance’
dawarich_app | app/views/stats/index.html.erb:16
dawarich_app |
dawarich_app | Information for cause: NoMethodError (undefined method ‘to_sym’ for nil):
dawarich_app |
dawarich_app | app/models/concerns/distance_convertible.rb:44:in ‘DistanceConvertible::ClassMethods#convert_distance’
dawarich_app | app/models/user.rb:61:in ‘block in User#total_distance’
dawarich_app | app/models/user.rb:59:in ‘User#total_distance’
dawarich_app | app/views/stats/index.html.erb:16
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:null,“controller”:“NotificationsChannel”,“action”:“unsubscribe”,“status”:200,“allocations”:34,“duration”:0.13}
dawarich_app | {“method”:null,“path”:null,“format”:null,“params”:null,“controller”:“TracksChannel”,“action”:“unsubscribe”,“status”:200,“allocations”:34,“duration”:0.06}
spookie@NUC:/opt/Docker/dawarich$

Go to Settings → Map, select a unit (Miles/Kilometers) and save settings, it’ll fix it. The actual fix for the issue will be included in the next release.

1 Like

Thanks :slight_smile: It works just perfect now :slight_smile:

1 Like