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$