Project

General

Profile

Actions

Bug #11434

closed

Foreman 1.7.x -> 1.8.2 (Puppet collects/adds Lots of bogus interface entries)

Added by Will Foster over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Network
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

We've noticed an issue with some existing hosts after upgrading from Foreman 1.7.2 -> 1.8.2
where there are sometimes dozens of new interfaces populated under interfaces, this causes updates to the host like changing hostgroup, toggling build to reprovision etc to fail.

Via hammer changing the hostgroup would render:

Started PUT "/api/hosts/92" for 127.0.0.1 at 2015-08-19 13:11:35 +0000
2015-08-19 13:11:35 [I] Processing by Api::V2::HostsController#update as JSON
2015-08-19 13:11:35 [I]   Parameters: {"host"=>{"name"=>"host29-rack06.scale.openstack.engineering.XXXXXX.com", "hostgroup_id"=>"183", "interfaces_attributes"=>{}, "host_parameters_attributes"=>{}, "compute_attributes"=>{"volumes_attributes"=>{}}}, "apiv"=>"v2", "id"=>"92"}
2015-08-19 13:11:35 [I] Authorized user admin(Admin User)
2015-08-19 13:11:36 [E] Unprocessable entity Host::Managed (id: 92):
  Interfaces some interfaces are invalid

Attempting to remove the non-primary interfaces listed, toggling to unmanaged and performing this or removing attributes from the primary interface (and deleting the generated non-primary interfaces) would yield:

NoMethodError
undefined method `changed?' for nil:NilClass
app/models/host/managed.rb:910:in `trigger_nic_orchestration'
app/models/concerns/orchestration.rb:48:in `valid?'
app/models/concerns/foreman/sti.rb:29:in `save_with_type'
app/controllers/hosts_controller.rb:100:in `block in update'
app/models/taxonomy.rb:54:in `block in no_taxonomy_scope'
app/models/taxonomy.rb:61:in `block (2 levels) in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:147:in `as_location'
app/models/taxonomy.rb:60:in `block in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:112:in `as_org'
app/models/taxonomy.rb:59:in `as_taxonomy'
app/models/taxonomy.rb:53:in `no_taxonomy_scope'
app/controllers/hosts_controller.rb:99:in `update'
app/controllers/concerns/application_shared.rb:13:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

We have found a workaround with manually removing the interfaces via hammer CLI
and skipping the primary/provision interface: this lets us further edit and manage the host.

problemhost=yourhostFQDN
skip_id=$(hammer host info --name $problemhost | grep -B 3 "nterface (primary, provision" | grep Id: | awk '{ print $NF }')
hammer host info --name $problemhost > /tmp/$problemhost
for interface in $(grep Id /tmp/$problemhost  | grep ')' | grep -v $skip_id | awk '{ print $NF }') ; do \
hammer host interface delete --host $problemhost --id $interface \
done

Files

foreman_issue_11434_1.png View foreman_issue_11434_1.png 98.2 KB Will Foster, 08/20/2015 03:07 AM
foreman_issue_11434_1.yaml foreman_issue_11434_1.yaml 7.94 KB YAML output of facter Will Foster, 08/20/2015 08:08 AM

Related issues 1 (0 open1 closed)

Related to Foreman - Feature #11972: Implement regex for option ignore_puppet_facts_for_provisioningClosedMarek Hulán09/26/2015Actions
Actions

Also available in: Atom PDF