Bug #12338
closedDiscover host is registered twice
Description
I was trying to add a new interface on discovered host. Interface was added, but when I refreshed the facts, I got following exception:
Warning! Could not get facts from proxy https://foreman_server:9090/discovery/192.168.100.36: ERF42-1064 [Foreman::Exception]: Unable to assign subnet, primary interface is missing IP address
Please note that dhcp proxy is properly associated with selected subnet. This happens in both cases like: discovery with dhcp and w/o dhcp
As soon as we refresh the host, the assigned IP also wiped out from webUI listing. Please see the screenshot.
production.log:
----------------
| Started GET "/discovered_hosts/mac525400be8e1b/refresh_facts" for 10.10.54.100 at 2015-10-28 03:48:59 -0400 2015-10-28 03:48:59 [app] [I] Processing by DiscoveredHostsController#refresh_facts as HTML 2015-10-28 03:48:59 [app] [I] Parameters: {"id"=>"mac525400be8e1b"} 2015-10-28 03:49:01 [app] [I] Import facts for 'mac525400e72f09' completed. Added: 0, Updated: 0, Deleted 0 facts 2015-10-28 03:49:01 [app] [W] Action failed | RuntimeError: Could not get facts from proxy https://cloud-qe-19.idmqe.lab.eng.bos.redhat.com:9090/discovery/192.168.100.36: ERF42-1064 [Foreman::Exception]: Unable to assign subnet, primary interface is missing IP address | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-4.1.1/app/models/host/discovered.rb:138:in `rescue in refresh_facts' | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-4.1.1/app/models/host/discovered.rb:135:in `refresh_facts' | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-4.1.1/app/controllers/discovered_hosts_controller.rb:64:in `refresh_facts' | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action' | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action' | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action' | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action' | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:649:in `block (4 levels) in _run__2799771436671021720__process_action__3853937877995232844__callbacks'
Files
Updated by Sachin Ghai about 9 years ago
- File webUI_error.png webUI_error.png added
Updated by Sachin Ghai about 9 years ago
Ah.. looks like when we add a new interface in discovered_host and refresh the facts then somehow another host entry got created in webUI under discovered_host and without IP address.
For example: when I created a discovered_host then host was created with mac=52:54:00:be:8e:1b and got IP 192.168.100.36. Please see the discovered_host entry in the attached screenshot.
Later, I added a new interface with mac=52:54:00:e7:2f:09 and refreshed the facts and this time another host entry got created under discovered_host page.
Updated by Sachin Ghai about 9 years ago
- Related to Tracker #10294: PXEless discovery feature added
Updated by Lukas Zapletal about 9 years ago
- Subject changed from [Foreman::Exception]: Unable to assign subnet, primary interface is missing IP address, on refreshing the facts of a discovered host to Discover host is registered twice
- Status changed from New to Duplicate
This is known issue and I have already fixed it, pending review: #12323. By default I attempted to send 5 register calls, but if we provision the host, it will re-create discovered host.
Workaround: provide fdi.cachefacts=0 on the command line to prevent non-cached requests to be sent.
Updated by Lukas Zapletal about 9 years ago
- Has duplicate Bug #12323: Default number of register calls should be zero added