Problem:
Clicking edit on libvirt hosts produces: Oops, we’re sorry but something went wrong undefined method `persisted?’ for nil:NilClass
Expected outcome:
Should proceed to the edit screen
Foreman and Proxy versions:
Foreman version: 2.5.4
Plugins:
- foreman-tasks 4.1.5
- foreman_bootdisk 17.1.0
- foreman_discovery 17.0.1
- foreman_hooks 0.3.17
- foreman_remote_execution 4.5.4
Ubuntu pkgs:
foreman 2.5.4-2
foreman-cli 2.5.4-2
foreman-debug 2.5.4-2
foreman-ec2 2.5.4-2
foreman-installer 2.4.1-1
foreman-libvirt 2.5.4-2
foreman-postgresql 2.5.4-2
foreman-proxy 2.5.4-1
foreman-vmware 2.5.4-2
ruby-foreman-bootdisk 17.1.0-1
ruby-foreman-deface 1.5.3-1
ruby-foreman-discovery 17.0.1-1
ruby-foreman-hooks 0.3.17-1
ruby-foreman-remote-execution 9999-plugin+scratchbuild+20210810144503
ruby-foreman-remote-execution-core 1.4.8-1
ruby-foreman-salt 13.2.4-1
ruby-foreman-tasks 4.1.5-1
ruby-foreman-tasks-core 0.3.6-1
ruby-hammer-cli-foreman 2.5.0-1
Rake:
2022-03-23T18:40:23 [I|app|2a804849] Processing by HostsController#edit as HTML
2022-03-23T18:40:23 [I|app|2a804849] Parameters: {“id”=>“hostname.fqdn”}
2022-03-23T18:40:23 [I|app|2a804849] Rendering hosts/edit.html.erb within layouts/application
2022-03-23T18:40:23 [I|app|2a804849] Rendered hosts/_progress.html.erb (Duration: 4.0ms | Allocations: 5797)
2022-03-23T18:40:23 [I|app|2a804849] Rendered hosts/puppet/_main_tab_fields.html.erb (Duration: 11.0ms | Allocations: 7756)
2022-03-23T18:40:23 [I|app|2a804849] Rendered config_groups/_config_group.html.erb (Duration: 34.1ms | Allocations: 14366)
2022-03-23T18:40:23 [I|app|2a804849] Rendered config_groups/_config_group.html.erb (Duration: 4.5ms | Allocations: 6113)
2022-03-23T18:40:23 [I|app|2a804849] Rendered config_groups/_config_groups_selection.html.erb (Duration: 53.8ms | Allocations: 29178)
2022-03-23T18:40:23 [I|app|2a804849] Rendered collection of puppetclasses/_selectedClasses.html.erb [1 times] (Duration: 7.5ms | Allocations: 7002)
2022-03-23T18:40:23 [I|app|2a804849] Rendered collection of puppetclasses/_classes_in_groups.html.erb [0 times] (Duration: 0.0ms | Allocations: 3)
2022-03-23T18:40:23 [I|app|2a804849] Rendered puppetclasses/_classes.html.erb (Duration: 211.3ms | Allocations: 160128)
2022-03-23T18:40:23 [I|app|2a804849] Rendered puppetclasses/_class_selection.html.erb (Duration: 360.9ms | Allocations: 225236)
2022-03-23T18:40:23 [I|app|2a804849] Rendered hosts/puppet/_puppet_classes_tab.html.erb (Duration: 366.1ms | Allocations: 231171)
2022-03-23T18:40:23 [I|app|2a804849] Rendered nic/_base_form.html.erb (Duration: 45.4ms | Allocations: 23596)
2022-03-23T18:40:23 [I|app|2a804849] Rendered nic/_virtual_form.html.erb (Duration: 4.6ms | Allocations: 6608)
2022-03-23T18:40:23 [I|app|2a804849] Rendered compute_resources_vms/form/libvirt/_network.html.erb (Duration: 104.1ms | Allocations: 7406)
2022-03-23T18:40:23 [I|app|2a804849] Rendered nic/_provider_specific_form.html.erb (Duration: 126.5ms | Allocations: 14107)
2022-03-23T18:40:23 [I|app|2a804849] Rendered nic/manageds/_managed.html.erb (Duration: 185.8ms | Allocations: 56484)
2022-03-23T18:40:23 [I|app|2a804849] Rendered nic/_base_form.html.erb (Duration: 57.6ms | Allocations: 25279)
2022-03-23T18:40:23 [I|app|2a804849] Rendered nic/_virtual_form.html.erb (Duration: 4.7ms | Allocations: 6603)
2022-03-23T18:40:24 [I|app|2a804849] Rendered compute_resources_vms/form/libvirt/_network.html.erb (Duration: 106.9ms | Allocations: 7380)
2022-03-23T18:40:24 [I|app|2a804849] Rendered nic/_provider_specific_form.html.erb (Duration: 126.7ms | Allocations: 14016)
2022-03-23T18:40:24 [I|app|2a804849] Rendered nic/manageds/_managed.html.erb (Duration: 200.0ms | Allocations: 58056)
2022-03-23T18:40:24 [I|app|2a804849] Rendered hosts/_interfaces.html.erb (Duration: 392.8ms | Allocations: 120870)
2022-03-23T18:40:24 [I|app|2a804849] Rendered compute_resources_vms/form/libvirt/_base.html.erb (Duration: 85.2ms | Allocations: 8023)
2022-03-23T18:40:24 [I|app|2a804849] Rendered compute_resources_vms/form/libvirt/_volume.html.erb (Duration: 31.8ms | Allocations: 12706)
2022-03-23T18:40:24 [I|app|2a804849] Rendered compute_resources_vms/form/_volumes.html.erb (Duration: 68.8ms | Allocations: 19714)
2022-03-23T18:40:24 [I|app|2a804849] Rendered hosts/_compute_detail.html.erb (Duration: 159.8ms | Allocations: 33614)
2022-03-23T18:40:24 [I|app|2a804849] Rendered hosts/_compute.html.erb (Duration: 184.9ms | Allocations: 40338)
2022-03-23T18:40:24 [I|app|2a804849] Rendered hosts/_unattended.html.erb (Duration: 190.0ms | Allocations: 46137)
2022-03-23T18:40:24 [I|app|2a804849] Rendered hosts/_form.html.erb (Duration: 1054.6ms | Allocations: 442156)
2022-03-23T18:40:24 [I|app|2a804849] Rendered hosts/edit.html.erb within layouts/application (Duration: 1064.5ms | Allocations: 448590)
2022-03-23T18:40:24 [W|app|2a804849] undefined method persisted?' for nil:NilClass 2022-03-23T18:40:24 [I|app|2a804849] Backtrace for 'undefined method
persisted?’ for nil:NilClass’ error (ActionView::Template::Error): undefined method `persisted?’ for nil:NilClass
2022-03-23T18:40:24 [I|app|2a804849] Rendering common/500.html.erb within layouts/application
2022-03-23T18:40:24 [I|app|2a804849] Rendered common/500.html.erb within layouts/application (Duration: 5.4ms | Allocations: 6125)
2022-03-23T18:40:24 [I|app|2a804849] Rendered layouts/_application_content.html.erb (Duration: 5.3ms | Allocations: 5816)
2022-03-23T18:40:24 [I|app|2a804849] Rendering layouts/base.html.erb
2022-03-23T18:40:24 [I|app|2a804849] Rendered layouts/base.html.erb (Duration: 6.8ms | Allocations: 7179)
2022-03-23T18:40:24 [I|app|2a804849] Completed 500 Internal Server Error in 1158ms (Views: 23.7ms | ActiveRecord: 72.0ms | Allocations: 487190)