Trip Error After Upgrading Dawarich to 0.24.1
OS & Hardware Dell PowerEdge, Unraid
Version 0.24.1 (upgrade 0.23.5) This is running using Docker Compose in the Docker Compose plugin, not the community app
Describe the bug After upgrading to the latest version, Trips throws an error
To Reproduce Steps to reproduce the behavior:
- Upgraded to the latest version
- Click on Trips
- Error "NoMethodError in Trips#index" is displayed
Expected behavior Would expect to see the trips page
Screenshots
Logs
dawarich_app | D, [2025-03-06T00:55:19.045865 #187] DEBUG -- : User Load (0.9ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1], ["LIMIT", 1]]
dawarich_app | D, [2025-03-06T00:55:19.047973 #187] DEBUG -- : ↳ app/controllers/application_controller.rb:11:in 'ApplicationController#unread_notifications'
dawarich_app | D, [2025-03-06T00:55:19.051402 #187] DEBUG -- : Rendering layout layouts/application.html.erb
dawarich_app | D, [2025-03-06T00:55:19.051577 #187] DEBUG -- : Rendering trips/index.html.erb within layouts/application
dawarich_app | D, [2025-03-06T00:55:19.053673 #187] DEBUG -- : Trip Exists? (1.0ms) SELECT 1 AS one FROM "trips" WHERE "trips"."user_id" = $1 LIMIT $2 OFFSET $3 [["user_id", 1], ["LIMIT", 1], ["OFFSET", 0]]
dawarich_app | D, [2025-03-06T00:55:19.055230 #187] DEBUG -- : ↳ app/views/trips/index.html.erb:10
dawarich_app | D, [2025-03-06T00:55:19.056907 #187] DEBUG -- : Trip Count (0.7ms) SELECT COUNT() FROM "trips" WHERE "trips"."user_id" = $1 [["user_id", 1]]
dawarich_app | D, [2025-03-06T00:55:19.058606 #187] DEBUG -- : ↳ app/views/trips/index.html.erb:24
dawarich_app | D, [2025-03-06T00:55:19.060414 #187] DEBUG -- : Trip Load (0.8ms) SELECT "trips". FROM "trips" WHERE "trips"."user_id" = $1 ORDER BY "trips"."started_at" DESC LIMIT $2 OFFSET $3 [["user_id", 1], ["LIMIT", 6], ["OFFSET", 0]]
dawarich_app | D, [2025-03-06T00:55:19.061997 #187] DEBUG -- : ↳ app/views/trips/index.html.erb:29
dawarich_app | I, [2025-03-06T00:55:19.064306 #187] INFO -- : {"method":"GET","path":"/trips","format":"html","controller":"TripsController","action":"index","status":500,"allocations":3946,"duration":21.58,"view":0.0,"db":3.19}
dawarich_app | E, [2025-03-06T00:55:19.073029 #187] ERROR -- :
dawarich_app | ActionView::Template::Error (undefined method 'path' for an instance of Trip)
dawarich_app | Caused by: NoMethodError (undefined method 'path' for an instance of Trip)
dawarich_app |
dawarich_app | Information for: ActionView::Template::Error (undefined method 'path' for an instance of Trip):
dawarich_app | 13: class="rounded-lg z-0"
dawarich_app | 14: data-controller="trip-map"
dawarich_app | 15: data-trip-map-trip-id-value="<%= trip.id %>"
dawarich_app | 16: data-trip-map-path-value="<%= trip.path.to_json %>"
dawarich_app | 17: data-trip-map-api-key-value="<%= current_user.api_key %>"
dawarich_app | 18: data-trip-map-user-settings-value="<%= current_user.settings.to_json %>"
dawarich_app | 19: data-trip-map-timezone-value="<%= Rails.configuration.time_zone %>"
dawarich_app |
dawarich_app | app/views/trips/_trip.html.erb:16
dawarich_app | app/views/trips/_trip.html.erb:1
dawarich_app | app/views/trips/index.html.erb:30
dawarich_app | app/views/trips/index.html.erb:29
dawarich_app |
dawarich_app | Information for cause: NoMethodError (undefined method 'path' for an instance of Trip):
dawarich_app |
dawarich_app | app/views/trips/_trip.html.erb:16
dawarich_app | app/views/trips/_trip.html.erb:1
dawarich_app | app/views/trips/index.html.erb:30
dawarich_app | app/views/trips/index.html.erb:29
From Trips page: Showing /var/app/app/views/trips/_trip.html.erb where line #16 raised:
undefined method 'path' for an instance of Trip Extracted source (around line #16): data-controller="trip-map" data-trip-map-trip-id-value="<%= trip.id %>" data-trip-map-path-value="<%= trip.path.to_json %>" data-trip-map-api-key-value="<%= current_user.api_key %>" data-trip-map-user-settings-value="<%= current_user.settings.to_json %>" data-trip-map-timezone-value="<%= Rails.configuration.time_zone %>"
Trace of template inclusion: #<ActionView::Template app/views/trips/index.html.erb locals=[]>
Rails.root: /var/app
Application Trace | Framework Trace | Full Trace app/views/trips/_trip.html.erb:16 app/views/trips/_trip.html.erb:1 app/views/trips/index.html.erb:30 app/views/trips/index.html.erb:29 Request Parameters:
None Toggle session dump Toggle env dump Response Headers:
None
Add any other context about the problem here. I had two trips created before the upgrade.
In the Console (https://dawarich.app/docs/FAQ#how-to-enter-dawarich-console) run this:
Trip.find_each do |trip|
Trips::CreatePathJob.perform_later(trip.id)
end
I'm seeing the same error. Running the CreatePathJob command didn't help. I deleted all Trips with rails cli but if I try to create a new Trip I get the same error:
ActionView::Template::Error (undefined method 'path' for an instance of Trip)
Caused by: NoMethodError (undefined method 'path' for an instance of Trip)
Information for: ActionView::Template::Error (undefined method 'path' for an instance of Trip):
20: data-distance_unit="<%= DISTANCE_UNIT %>"
21: data-api_key="<%= current_user.api_key %>"
22: data-user_settings="<%= current_user.settings.to_json %>"
23: data-path="<%= trip.path.to_json %>"
24: data-started_at="<%= trip.started_at %>"
25: data-ended_at="<%= trip.ended_at %>"
26: data-timezone="<%= Rails.configuration.time_zone %>">
app/views/trips/_form.html.erb:23
app/views/trips/_form.html.erb:1
app/views/trips/new.html.erb:6
Information for cause: NoMethodError (undefined method 'path' for an instance of Trip):
app/views/trips/_form.html.erb:23
app/views/trips/_form.html.erb:1
app/views/trips/new.html.erb:6
I'm running latest docker image
I had a similar experience, once the command was run I went to 'Trips" and got the same error as I originally posted. Here is the output from console:
D, [2025-03-10T17:30:31.191893 #513380] DEBUG -- : Trip Load (5.5ms) SELECT "trips".* FROM "trips" ORDER BY "trips"."id" ASC LIMIT $1 [["LIMIT", 1000]] 2025-03-10T17:30:31.570Z pid=513380 tid=azmc INFO: Sidekiq 7.3.8 connecting to Redis with options {size: 10, pool_name: "internal", url: "redis://dawarich_redis:6379/0"} I, [2025-03-10T17:30:31.612942 #513380] INFO -- : Enqueued Trips::CreatePathJob (Job ID: 15d00111-0dee-4908-93a1-bfef8285660e) to Sidekiq(default) with arguments: 1 I, [2025-03-10T17:30:31.626250 #513380] INFO -- : ↳ (pry):2:in 'block in __pry__' I, [2025-03-10T17:30:31.637979 #513380] INFO -- : Enqueued Trips::CreatePathJob (Job ID: 10de0a5d-06b0-4051-9ace-6e16701085ae) to Sidekiq(default) with arguments: 2 I, [2025-03-10T17:30:31.650719 #513380] INFO -- : ↳ (pry):2:in 'block in __pry__' => nil [2] pry(main)>
From sidekiq:
@jacobbehrnes was your issue resolved?
My issue was fixed. Thank you!