'kickstart_ifcfg_generic_interface' threw an error: undefined method '#gateway' for NilClass::Jail (NilClass)
with a clean Foreman 1.15 install and database with puppet 4, defining an IPV4 subnet and using the kickstart_default template a host successfully builds the host checks in from puppet, and populates an IPV6 onto the interface,
This can be seen in the host details interface of foreman once the host has checked in IPv6 Address is displayed in this example fe80::dacb:8aff:fee3:2950 however other test cases show they all start with fe80 which is the IPV6 link-local address.
Once this has happened, the template kickstart_networking_setup breaks when you ask it to render for the host with the error.
emplate: ERF42-7327 [Foreman::Exception]: The snippet 'kickstart_ifcfg_generic_interface' threw an error: undefined method '#gateway' for NilClass::Jail (NilClass)
Upon investigation it appears this is because it's checking for a IPV6 gateway for the IPV6 address it's now aware of after the puppet checkin. The Link local address would never have a gateway.
This issue appears to have been addressed in a earlier version of foreman https://github.com/theforeman/foreman/pull/4439
Looking at commit https://github.com/theforeman/foreman/pull/4439/commits/9e74056dff2bc2ac21f2d51c272238edeccba34a the fix in app/models/host/base.rb appears to have been lost in the re-write for 1.15
I've been unable to find if this is now handled elsewhere or if I'm looking at this wrong, however it looks like this is a regression of an earlier problem.
It appears the problem is that foreman should not be aware of this iP from facts, but there maybe worth in looking at this as a second issue in that the template could also be used to ignore this.
#2 Updated by Dominic Cleal almost 3 years ago
- Category changed from Facts to Templates
I think #17895 (which is not in 1.15.0) will fix the fact import problem, so this is probably a duplicate of that ticket. I will leave this against the template instead which could handle
@subnet6 being nil to prevent the nilclass gateway error.