Bug #23145

The new-host form fails to show virtual machine form after an error occurs during provisioning

Added by Ivan Necas 4 months ago. Updated about 1 month ago.

Target version:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:


1. try to create a new host on compute resource (tested with oVirt, but the code-path is the same for all compute resources), while intentionally leaving some incorrect value (to cause the provisioning to fail) such leaving 'disk interface' blank
2. when the the provisioning fails, in the Virtual Machine, it's reported

'maude-jordahl.inecas.ovirt.test' not found on 'abcde ovirt (oVirt)' 'maude-jordahl.inecas.ovirt.test' could be deleted or 'abcde ovirt (oVirt)' is not responding.

It turns out we were masking out exceptions when creating new compute object

After removing the rescue nil, which seems was not even helping anything in the original issue (, the root exception showed up:

2018-04-06T14:27:22 [F|app|] ActionView::Template::Error (unable to convert unpermitted parameters to hash):
2018-04-06T14:27:22 [F|app|]      8:       <% end %>
 |      9:     </h3>
 |     10:     <%= f.fields_for 'compute_attributes', do |f| %>
 |     11:       <%= render provider_partial(@host.compute_resource, 'network'), :f => f, :disabled => f.object.persisted?, :compute_resource => @host.compute_resource, :new_host => new_vm?(@host), :new_vm => new_vm?(@host) %>
 |     12:     <% end %>
 |     13:   </fieldset>
 |     14: <% end %>
2018-04-06T14:27:22 [F|app|]   
2018-04-06T14:27:22 [F|app|] app/models/compute_resource.rb:163:in `new_vm'
 | app/models/compute_resources/foreman/model/ovirt.rb:283:in `new_vm'
 | app/models/concerns/orchestration/compute.rb:25:in `compute_object'
 | app/helpers/compute_resources_vms_helper.rb:242:in `new_vm?'
 | app/views/nic/_provider_specific_form.html.erb:11:in `block in _4b811acf287d4e5bcb68d9f3d7a65854'
 | app/views/nic/_provider_specific_form.html.erb:10:in `_4b811acf287d4e5bcb68d9f3d7a65854'
 | app/views/nic/manageds/_managed.html.erb:16:in `_9a9a2fd328cdd4e5c420cac4b473b902'
 | app/views/hosts/_interfaces.html.erb:50:in `block in _6fc94f3b1e91f2db7acb3fe454d52772'
 | app/views/hosts/_interfaces.html.erb:49:in `_6fc94f3b1e91f2db7acb3fe454d52772'
 | app/views/hosts/_form.html.erb:102:in `block (2 levels) in _e237b40a33ad5afb1535f229dd5ab30b'
 | app/helpers/form_helper.rb:296:in `form_for'
 | app/views/hosts/_form.html.erb:8:in `block in _e237b40a33ad5afb1535f229dd5ab30b'
 | app/models/taxonomy.rb:75:in `block (2 levels) in as_taxonomy'
 | app/models/concerns/foreman/thread_session.rb:173:in `as_location'
 | app/models/taxonomy.rb:74:in `block in as_taxonomy'
 | app/models/concerns/foreman/thread_session.rb:136:in `as_org'
 | app/models/taxonomy.rb:73:in `as_taxonomy'
 | app/views/hosts/_form.html.erb:6:in `_e237b40a33ad5afb1535f229dd5ab30b'
 | app/views/hosts/new.html.erb:3:in `_5d22ebb4ea92e4b9dcb444f6a788e75b'
 | app/controllers/application_controller.rb:292:in `process_error'
 | app/controllers/hosts_controller.rb:111:in `create'
 | app/controllers/concerns/application_shared.rb:15:in `set_timezone'

It's probably a regression after migration to Rails 5, proposing as a blocker for 1.18 GA

Associated revisions

Revision d7a9d13f (diff)
Added by Ivan Necas 4 months ago

Fixes #23145 - fix strong params for compute attributes on fail (#5412)


#1 Updated by The Foreman Bot 4 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request added

#2 Updated by Ivan Necas 4 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF