Bug #14802
closedwebUI raises error for "operatting system" tab on submitting the "new host" form for first time
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1330012
Description of problem:
I was trying to provision a new host and as soon as I submitted the new host form, webUI highlighted "operating system" tab with 'red' border but no error on webUI. However, production.log says:
] [I] Failed to save: Medium can't be blank
Please note that media was associated. Please see the screenshot.
Also, above should be an error statement not "Info".
> /var/log/foreman/production.log <2016-04-25 05:32:37 [app] [I] Started POST "/hosts" for 10.65.193.53 at 2016-04-25 05:32:37 -0400
2016-04-25 05:32:37 [app] [I] Processing by HostsController#create as */*
2016-04-25 05:32:37 [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"8vCPyxpVczdumKXL5KNmK7Af1jYtwSEaunQpWzkXNW0=", "host"=>{"name"=>"rhel7", "organization_id"=>"1", "location_id"=>"2", "hostgroup_id"=>"", "compute_resource_id"=>"1", "compute_profile_id"=>"4", "content_facet_attributes"=>{"lifecycle_environment_id"=>"1", "content_view_id"=>"2", "id"=>""}, "environment_id"=>"1", "content_source_id"=>"1", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"rhel7", "domain_id"=>"1", "subnet_id"=>"1", "ip"=>"192.168.100.14", "managed"=>"1", "primary"=>"1", "provision"=>"1", "execution"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"network", "network"=>"foreman", "bridge"=>"enp0s29u1u1u5", "model"=>"virtio"}}}, "compute_attributes"=>{"cpus"=>"1", "memory"=>"1073741824", "start"=>"1", "volumes_attributes"=>{"0"=>{"_delete"=>"", "pool_name"=>"default", "capacity"=>"10G", "allocation"=>"0G", "format_type"=>"raw"}}}, "architecture_id"=>"1", "operatingsystem_id"=>"2", "provision_method"=>"build", "build"=>"1", "medium_id"=>"", "ptable_id"=>"61", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"3-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"build image", "provider"=>"Libvirt", "media_selector"=>"synced_content", "hostgroup"=>{"kickstart_repository_id"=>"13"}, "bare_metal_capabilities"=>"build"}
2016-04-25 05:32:37 [app] [I] Failed to save: Medium can't be blank
2016-04-25 05:32:37 [app] [I] Rendered hosts/_progress.html.erb (0.3ms)
2016-04-25 05:32:37 [app] [I] Rendered puppetclasses/_selectedClasses.html.erb (0.0ms)
2016-04-25 05:32:37 [app] [I] Rendered puppetclasses/_classes_in_groups.html.erb (0.0ms)
2016-04-25 05:32:37 [app] [I] Rendered puppetclasses/_classes.html.erb (0.1ms)
2016-04-25 05:32:37 [app] [I] Rendered puppetclasses/_class_selection.html.erb (8.4ms)
2016-04-25 05:32:37 [app] [I] Rendered nic/_base_form.html.erb (19.7ms)
2016-04-25 05:32:37 [app] [I] Rendered nic/_virtual_form.html.erb (1.2ms)
2016-04-25 05:32:37 [app] [I] Rendered compute_resources_vms/form/libvirt/_network.html.erb (19.9ms)
2016-04-25 05:32:37 [app] [I] Rendered nic/_provider_specific_form.html.erb (20.4ms)
2016-04-25 05:32:37 [app] [I] Rendered nic/manageds/_managed.html.erb (42.8ms)
2016-04-25 05:32:37 [app] [I] Rendered nic/_base_form.html.erb (51.1ms)
2016-04-25 05:32:37 [app] [I] Rendered nic/_virtual_form.html.erb (1.3ms)
2016-04-25 05:32:37 [app] [I] Rendered compute_resources_vms/form/libvirt/_network.html.erb (19.9ms)
2016-04-25 05:32:37 [app] [I] Rendered nic/_provider_specific_form.html.erb (20.4ms)
2016-04-25 05:32:37 [app] [I] Rendered nic/manageds/_managed.html.erb (74.4ms)
2016-04-25 05:32:37 [app] [I] Rendered hosts/_interfaces.html.erb (119.2ms)
2016-04-25 05:32:37 [app] [I] Rendered compute_resources_vms/form/libvirt/_base.html.erb (13.9ms)
2016-04-25 05:32:37 [app] [I] Rendered compute_resources_vms/form/libvirt/_volume.html.erb (3.3ms)
2016-04-25 05:32:37 [app] [I] Rendered compute_resources_vms/form/libvirt/_volume.html.erb (3.3ms)
2016-04-25 05:32:37 [app] [I] Rendered compute_resources_vms/form/_volumes.html.erb (8.9ms)
2016-04-25 05:32:37 [app] [I] Rendered hosts/_compute_detail.html.erb (23.4ms)
2016-04-25 05:32:37 [app] [I] Rendered hosts/_compute.html.erb (30.6ms)
2016-04-25 05:32:37 [app] [I] Rendered common/os_selection/_architecture.html.erb (3.6ms)
2016-04-25 05:32:37 [app] [I] Rendered common/os_selection/_operatingsystem.html.erb (71.6ms)
2016-04-25 05:32:37 [app] [I] Rendered hosts/provision_method/build/_form.html.erb (72.9ms)
2016-04-25 05:32:37 [app] [I] Rendered hosts/provision_method/image/_form.html.erb (0.2ms)
2016-04-25 05:32:37 [app] [I] Rendered hosts/_operating_system.html.erb (80.6ms)
2016-04-25 05:32:37 [app] [I] Rendered hosts/_unattended.html.erb (113.1ms)
2016-04-25 05:32:37 [app] [I] Rendered puppetclasses/_class_parameters.html.erb (0.0ms)
2016-04-25 05:32:37 [app] [I] Rendered puppetclasses/_classes_parameters.html.erb (5.0ms)
2016-04-25 05:32:37 [app] [I] Rendered common_parameters/_inherited_parameters.html.erb (0.3ms)
2016-04-25 05:32:37 [app] [I] Rendered common_parameters/_parameter.html.erb (1.7ms)
2016-04-25 05:32:37 [app] [I] Rendered common_parameters/_parameters.html.erb (3.5ms)
2016-04-25 05:32:37 [app] [I] Rendered hosts/_form.html.erb (321.4ms)
2016-04-25 05:32:37 [app] [I] Rendered hosts/new.html.erb within layouts/application (322.1ms)
2016-04-25 05:32:37 [app] [I] Rendered layouts/_application_content.html.erb (0.8ms)
2016-04-25 05:32:37 [app] [I] Deface: [WARNING] No :original defined for 'theme_css', you should change its definition to include: | :original => '9f26415985aeb5438b8efcaf9078980451df5ff7'
2016-04-25 05:32:37 [app] [I] Deface: [WARNING] No :original defined for 'remove foreman name from topbar', you should change its definition to include: | :original => '6f86bcbd36e017373b168cc34f62c6deb016bb55'
2016-04-25 05:32:37 [app] [I] Deface: [WARNING] No :original defined for 'add link to home', you should change its definition to include: | :original => '7c247aee58a81a4e49096e83b6a14b07ec780462'
2016-04-25 05:32:37 [app] [I] Rendered home/_submenu.html.erb (1.7ms)
2016-04-25 05:32:37 [app] [I] Rendered home/_user_dropdown.html.erb (1.5ms)
2016-04-25 05:32:37 [app] [I] Read fragment views/tabs_and_title_records-3 (0.1ms)
2016-04-25 05:32:37 [app] [I] Rendered home/_topbar.html.erb (8.0ms)
2016-04-25 05:32:37 [app] [I] Rendered layouts/base.html.erb (17.1ms)
2016-04-25 05:32:37 [app] [I] Completed 200 OK in 558ms (Views: 332.3ms | ActiveRecord: 33.8ms)
if you re-associate the media, then provisioning works fine.
Version-Release number of selected component (if applicable):
sat6.2 beta snap9.2
How reproducible:
Steps to Reproduce:
1. provision a new host
2.
3.
Actual results:
webUI raises error for "operatting system" tab on submitting the "new host" form for first time even when all entities are properly associated.
Expected results:
1. UI should n't raise any error when media is properly associated.
2. In case of error, error should be thrown on webUI
3. error in production.log shouldn't be a info statement. It should be an error log
] [I] Failed to save: Medium can't be blank
Additional info:
on re-submitting the same form again works, but not for first time.