Bug #10632
openOperation FAILED: No route matches {:controller=>"reports", :host_id=>nil} on login
Description
This is similar (possibly the same issue) as #2164. That was closed since the issue "went away" overnight.
After logging in and being directed to the dashboard, I see the following :
Oops, we're sorry but something went wrong
Warning!
No route matches {:controller=>"reports", :host_id=>nil}
If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
Back
I can manually change the url to /hosts and access the system. But the dashboard won't respond. If I go to /reports directly, I see what I believe is causing the problem. One of the reports listed has no hostname. If I click on the "Last Report" time, I get the same error as above.
So, it would appear that somehow a reports entry was added without a hostname. That, in turn, causes a route failure because the host_id is nil.
The reporter of ticket #2164 reported that this went away overnight, likely due to the dashboard no longer needing to display that report.. ie, it rolled off the list.
/var/log/foreman/production.log shows this :
2015-05-27 17:20:40 [I] Processing by DashboardController#index as HTML
2015-05-27 17:20:40 [I] Rendered dashboard/_status_widget.html.erb (2.8ms)
2015-05-27 17:20:40 [I] Rendered dashboard/_status_chart_widget.html.erb (1.0ms)
2015-05-27 17:20:40 [I] Rendered dashboard/_reports_widget.html.erb (9.7ms)
2015-05-27 17:20:40 [I] Rendered dashboard/index.html.erb within layouts/application (15.8ms)
2015-05-27 17:20:40 [W] Operation FAILED: No route matches {:controller=>"reports", :host_id=>nil}
2015-05-27 17:20:40 [I] Rendered common/500.html.erb within layouts/application (3.1ms)
2015-05-27 17:20:40 [I] Rendered layouts/base.html.erb (0.9ms)
2015-05-27 17:20:40 [I] Completed 500 Internal Server Error in 85ms (Views: 4.9ms | ActiveRecord: 1.4ms)
No idea what caused this to begin with, though. I had upgraded puppet from 2.7.?? to 3.8.1 and was running puppet agent --test on a number of hosts.