Following an upgrade of our Foreman environment from 1.7.1->1.8.x->1.9.3,
I'm seeing network interfaces with duplicate IP's in my host records.
It seems to be related to the following issue:
I'm unable to delete the duplicate IP's in the web interface, because the
validation checks for a duplicate on the deleted NIC interface. In an
attempt to fix this, I introduced the changes from here:
I created patches for the three modified files (excluding test files) as
follows:
cd /usr/share/foreman
git show 35241dd65a6b4f426374a03e83d6f796f59a9d35 app/models/host/managed.rb
> patch1.txt
git show 35241dd65a6b4f426374a03e83d6f796f59a9d35 app/models/nic/base.rb >
patch2.txt
git show 35241dd65a6b4f426374a03e83d6f796f59a9d35 app/models/nic/interface.rb
> patch3.txt
and then applied them to our 1.9.3 files like so:
cd /usr/share/foreman
patch -p1 < patch1.txt
patch -p1 < patch2.txt
patch -p1 < patch3.txt
This worked in our staging environment. I'm able to remove the duplicate
IP's through the Web UI.
However, on two separate occasions, I've moved the three files over to
production and it's failed. It doesn't break anything per se, but it just
doesn't seem to "work". When I try to go into a host record and delete the
duplicate IP, I still get a validation error. I went so far as to
completely reboot both Foreman application servers (we run two in a load
balanced pair) to ensure there were no apache/passenger connections left
open.
Our stage and production environments are both running 1.9.3 and are
mostly the same, including running a copy of the production database.
The staging environment is not running hooks present in production, and has
some slightly different configuration to reflect it being on a different
host, but that's about it.
Is there anything else that could be causing this to work in our stage
environment but not production?
Has anyone had to deal with this duplicate IP issue following an upgrade
and come up with a reasonable fix? Ideally, I'd like to clean up all
duplicates in our database, but I'm a little nervous about trying to do so
in our production environment.
I've attached the three patched files, if it's helpful.
20151214.patch-base.rb (7.87 KB)