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$