Project

General

Profile

Bug #10298

Unable to delete host: Unable to find IP address for ... can't modify frozen Hash

Added by Alexander Litvinenko over 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Orchestration
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

In web interface shown exception:

Failed to save: failed to detect boot server: ERF50-9294 [Foreman::WrappedException]: Unable to find IP address for 'prov.ua.int' ([RuntimeError]: can't modify frozen Hash)

Trace:
http://pastebin.com/Mwn8Tgva

Api info about proxy:

{"ip":"172.16.160.10","environment_id":1,"environment_name":"production","last_report":"2015-04-29T08:33:48Z","mac":"00:50:56:ad:30:c8","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":6,"domain_name":"ua.int","architecture_id":1,"architecture_name":"x86_64","operatingsystem_id":7,"operatingsystem_name":"Debian 7.8","subnet_id":null,"subnet_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"build":false,"comment":"","disk":null,"installed_at":null,"model_id":1,"model_name":"VMware Virtual Platform","hostgroup_id":10,"hostgroup_name":"Foreman Proxy","owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":1,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":1,"compute_profile_name":"1-Micro-1CPU-512M-10GB","capabilities":["build"],"provision_method":"build","puppet_proxy_id":1,"certname":"prov.ua.int","image_id":null,"image_name":null,"created_at":"2014-12-22T21:54:29Z","updated_at":"2015-04-29T08:34:21Z","last_compile":"2015-04-29T08:33:52Z","last_freshcheck":null,"serial":null,"source_file_id":null,"puppet_status":0,"location_id":1,"location_name":"UA","name":"prov.ua.int","id":127,"parameters":[],"interfaces":[{"id":130,"name":"prov.ua.int","ip":"172.16.160.10","mac":"00:50:56:ad:30:c8","identifier":"eth0","primary":true,"provision":true,"type":"interface"}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[]}

Api info about host:
{"ip":"172.16.160.133","environment_id":1,"environment_name":"production","last_report":"2015-04-29T08:32:01Z","mac":"00:50:56:ad:9b:43","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":6,"domain_name":"ua.int","architecture_id":1,"architecture_name":"x86_64","operatingsystem_id":7,"operatingsystem_name":"Debian 7.8","subnet_id":3,"subnet_name":"172.16.160.0/24","sp_subnet_id":null,"ptable_id":8,"ptable_name":"Preseed default","medium_id":2,"medium_name":"Debian mirror","build":false,"comment":"","disk":"","installed_at":"2015-04-27T07:57:46Z","model_id":1,"model_name":"VMware Virtual Platform","hostgroup_id":25,"hostgroup_name":"Docker","owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":1,"managed":true,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":3,"compute_profile_name":"3-Normal-1CPU-2048M-40GB","capabilities":["build"],"provision_method":"build","puppet_proxy_id":1,"certname":"rancher04.ua.int","image_id":null,"image_name":null,"created_at":"2015-04-27T07:49:10Z","updated_at":"2015-04-29T08:32:33Z","last_compile":"2015-04-29T08:32:05Z","last_freshcheck":null,"serial":null,"source_file_id":null,"puppet_status":0,"location_id":1,"location_name":"UA","name":"rancher04.ua.int","id":233,"parameters":[],"interfaces":[{"id":197,"name":"rancher04.ua.int","ip":"172.16.160.133","mac":"00:50:56:ad:9b:43","identifier":"","primary":true,"provision":true,"type":"interface"}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[]}

Associated revisions

Revision db559817 (diff)
Added by Dominic Cleal over 4 years ago

fixes #10298 - handle destroyed but present interfaces

When deleting a host and DHCP orchestration is removing reservations for NICs,
it generates a dhcp_record that contains next-server data. Determining the
next-server IP causes the primary interface to be fetched for DNS resolution,
to resolve the next-server hostname:

app/models/host/base.rb:390:in `get_interface_by_flag'
app/models/host/base.rb:253:in `primary_interface'
app/models/host/managed.rb:130:in `dns_ptr_record'
app/models/host/managed.rb:838:in `to_ip_address'
app/models/nic/managed.rb:16:in `to_ip_address'
app/models/concerns/orchestration/dhcp.rb:49:in `boot_server'
app/models/concerns/orchestration/dhcp.rb:72:in `dhcp_attrs'
app/models/concerns/orchestration/dhcp.rb:18:in `dhcp_record'
app/models/concerns/orchestration/dhcp.rb:32:in `del_dhcp'

get_interface_by_flag no longer attempts to modify the interface when it is
being deleted.

Revision e18cfe2f (diff)
Added by Dominic Cleal over 4 years ago

fixes #10298 - handle destroyed but present interfaces

When deleting a host and DHCP orchestration is removing reservations for NICs,
it generates a dhcp_record that contains next-server data. Determining the
next-server IP causes the primary interface to be fetched for DNS resolution,
to resolve the next-server hostname:

app/models/host/base.rb:390:in `get_interface_by_flag'
app/models/host/base.rb:253:in `primary_interface'
app/models/host/managed.rb:130:in `dns_ptr_record'
app/models/host/managed.rb:838:in `to_ip_address'
app/models/nic/managed.rb:16:in `to_ip_address'
app/models/concerns/orchestration/dhcp.rb:49:in `boot_server'
app/models/concerns/orchestration/dhcp.rb:72:in `dhcp_attrs'
app/models/concerns/orchestration/dhcp.rb:18:in `dhcp_record'
app/models/concerns/orchestration/dhcp.rb:32:in `del_dhcp'

get_interface_by_flag no longer attempts to modify the interface when it is
being deleted.

(cherry picked from commit db5598175aba763db9dcbbeec38e7e0ab89825d6)

History

#1 Updated by Dominic Cleal over 4 years ago

  • Subject changed from Unable to delete host to Unable to delete host: Unable to find IP address for ... can't modify frozen Hash
  • Category set to Orchestration
  • Legacy Backlogs Release (now unused) set to 50

#2 Updated by Raul Laansoo over 4 years ago

I'm experiencing the same problem. Our Foreman host has mmultiple IP addresses (A records) and we use DNS sortlist. Foreman host IP from the subnet from where the DNS request is made is put on the top of the list. Might this be the problem? It worked in 1.8 RC3.

#3 Updated by Byron Miller over 4 years ago

Same issue here, 1.8 release. Can't delete host - can't modify frozen hash. CentOS 7.1

#4 Updated by Dominic Cleal over 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

#5 Updated by Dominic Cleal over 4 years ago

The regression between RC3 and .0 was triggered by the last minute #10020 fix. The issue's coming in when Foreman's deleting the DHCP reservation, which causes it to create one in memory temporarily. To do that, it's trying to resolve the IP address of the TFTP server from a network interface that was just deleted (the "frozen" error). Prior to #10020 it wasn't setting the next-server option at all, so this problem didn't occur.

#6 Updated by Dominic Cleal over 4 years ago

As a workaround, on your TFTP server (often Foreman), change :tftp_servername in /etc/foreman-proxy/settings.d/tftp.yml to an IP address or uncomment it and set to an IP if unset.

#7 Updated by The Foreman Bot over 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2355 added
  • Pull request deleted ()

#8 Updated by Dominic Cleal over 4 years ago

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

Also available in: Atom PDF