Foreman 1.9 (problably 1.8 too) : cannot save host : IP address already taken

Hi,

I've read a thread on this list which is about the same thing, but for MAC addresses.
I've just migrated to foreman 1.9.2, so I can't say if the issue was already present in 1.8 - I am assuming it was.

The issue is the following :
I have a host, on which I defined a bridge during the system lifetime (libvirt host).
At some time, I must have had the foreman setting "ignore_puppet_facts_for_provisionning" set to false - but it has been set to true for some time already.

I now see in my host all the network interfaces + the bridge with the machine IP + "eth0" (should be em1… anyway) with the machine IP address too.

I'd like to reinstall the host and change its OS.
And whatever I try, I always get an error message about the host IP address which has already been taken.
I tried deleting all network interfaces but the main eth0 one : they all come back when I try to save.

In the foreman-proxy host, I see a query for this IP (w.x.y.z)but twice in 1 second :
w.w.w.w - - [28/Oct/2015 13:39:08] "GET /w.x.y.0/w.x.y.z HTTP/1.1" 200 176 0.8319
w.w.w.w - - [28/Oct/2015 13:39:09] "GET /w.x.y.0/w.x.y.z HTTP/1.1" 200 176 0.8875

Since I already have the "ignore_puppet…" setting set to true, I'm wondering if anyone would know of a way to get around this error ?
Any way to cleanup the foreman database for all other hosts in this case ?

Thanks

Hello,

I'm not sure about the double foreman-proxy query but I'd start with finding
all hosts with a given IP. It might be the case, that some other host's
interface got the same IP assigned. Go to hosts page and try searching with
query "has_ip = $ip". That search takes interfaces into considerations, unlike
"ip = $ip" which searches only among primary interfaces. If you find
conflicting record, try removing it.

Hope this helps

··· -- Marek

On Wednesday 28 of October 2015 12:49:05 SCHAER Frederic wrote:

Hi,

I’ve read a thread on this list which is about the same thing, but for MAC
addresses. I’ve just migrated to foreman 1.9.2, so I can’t say if the issue
was already present in 1.8 - I am assuming it was.

The issue is the following :
I have a host, on which I defined a bridge during the system lifetime
(libvirt host). At some time, I must have had the foreman setting
"ignore_puppet_facts_for_provisionning" set to false - but it has been set
to true for some time already.

I now see in my host all the network interfaces + the bridge with the
machine IP + “eth0” (should be em1… anyway) with the machine IP address
too.

I’d like to reinstall the host and change its OS.
And whatever I try, I always get an error message about the host IP address
which has already been taken. I tried deleting all network interfaces but
the main eth0 one : they all come back when I try to save.

In the foreman-proxy host, I see a query for this IP (w.x.y.z)but twice in 1
second : w.w.w.w - - [28/Oct/2015 13:39:08] "GET /w.x.y.0/w.x.y.z HTTP/1.1"
200 176 0.8319 w.w.w.w - - [28/Oct/2015 13:39:09] “GET /w.x.y.0/w.x.y.z
HTTP/1.1” 200 176 0.8875

Since I already have the “ignore_puppet…” setting set to true, I’m
wondering if anyone would know of a way to get around this error ? Any way
to cleanup the foreman database for all other hosts in this case ?

Thanks


Marek

I'm also encountering this more frequently lately. It would help if we
could know the duplicated IP and perhaps the MAC address.
Did anyone try to debug this?

··· On Wednesday, October 28, 2015 at 2:49:09 PM UTC+2, SCHAER Frederic wrote: > > Hi, > > > > I’ve read a thread on this list which is about the same thing, but for MAC > addresses. > > I’ve just migrated to foreman 1.9.2, so I can’t say if the issue was > already present in 1.8 – I am assuming it was. > > > > The issue is the following : > > I have a host, on which I defined a bridge during the system lifetime > (libvirt host). > > At some time, I must have had the foreman setting > “ignore_puppet_facts_for_provisionning” set to false – but it has been set > to true for some time already. > > > > I now see in my host all the network interfaces + the bridge with the > machine IP + “eth0” (should be em1… anyway) with the machine IP address too. > > > > I’d like to reinstall the host and change its OS. > > And whatever I try, I always get an error message about the host IP > address which has already been taken. > > I tried deleting all network interfaces but the main eth0 one : they all > come back when I try to save. > > > > In the foreman-proxy host, I see a query for this IP (w.x.y.z)but twice > in 1 second : > > w.w.w.w - - [28/Oct/2015 13:39:08] "GET /w.x.y.0/w.x.y.z HTTP/1.1" 200 176 > 0.8319 > > w.w.w.w - - [28/Oct/2015 13:39:09] "GET /w.x.y.0/w.x.y.z HTTP/1.1" 200 176 > 0.8875 > > > > > > Since I already have the “ignore_puppet…” setting set to true, I’m > wondering if anyone would know of a way to get around this error ? > > Any way to cleanup the foreman database for all other hosts in this case ? > > > > Thanks >

Hi Marek,

Well, I know which hosts are problematic : in my case, it's probably all libvirt servers.
One of them I just looked at has a yaml that contains :

parameters:
ip: XXX

  • mac: xyz
    Ip:XXX
    (type interface, but that's in fact a bridge)
  • mac : x2y2z2
    Ip : XXX
    (with eth0 name, physical interface at install time)

So, the IP appears 3 times in the yaml.
I'd love to do a search in the foreman console, but I do not find much about how to use that anywhere.
I just found a way on this list to use this console in order to fix the hosts without having to delete+recreate them :

If the interface I want to keep is N-2 in the list, I do :
irb(main):007:0> host = Host.find_by_name('__full_hostname__here')
i=host.interfaces[-2]
host.interfaces=[i]
host.save

Thing is I do not know where this Host.find_by_name comes from, nor if that's possible to run a search on the IP addresses for instance…
The ruby completion does not even show the find_by_name method for the Host object… ??

Regards
-----Message d'origine-----

··· De : Marek Hulan [mailto:mhulan@redhat.com] Envoyé : vendredi 30 octobre 2015 09:37 À : foreman-users@googlegroups.com Cc : SCHAER Frederic Objet : Re: [foreman-users] foreman 1.9 (problably 1.8 too) : cannot save host : IP address already taken...

Hello,

I’m not sure about the double foreman-proxy query but I’d start with finding
all hosts with a given IP. It might be the case, that some other host’s
interface got the same IP assigned. Go to hosts page and try searching with
query “has_ip = $ip”. That search takes interfaces into considerations, unlike
"ip = $ip" which searches only among primary interfaces. If you find
conflicting record, try removing it.

Hope this helps


Marek

On Wednesday 28 of October 2015 12:49:05 SCHAER Frederic wrote:

Hi,

I’ve read a thread on this list which is about the same thing, but for MAC
addresses. I’ve just migrated to foreman 1.9.2, so I can’t say if the issue
was already present in 1.8 - I am assuming it was.

The issue is the following :
I have a host, on which I defined a bridge during the system lifetime
(libvirt host). At some time, I must have had the foreman setting
"ignore_puppet_facts_for_provisionning" set to false - but it has been set
to true for some time already.

I now see in my host all the network interfaces + the bridge with the
machine IP + “eth0” (should be em1… anyway) with the machine IP address
too.

I’d like to reinstall the host and change its OS.
And whatever I try, I always get an error message about the host IP address
which has already been taken. I tried deleting all network interfaces but
the main eth0 one : they all come back when I try to save.

In the foreman-proxy host, I see a query for this IP (w.x.y.z)but twice in 1
second : w.w.w.w - - [28/Oct/2015 13:39:08] "GET /w.x.y.0/w.x.y.z HTTP/1.1"
200 176 0.8319 w.w.w.w - - [28/Oct/2015 13:39:09] “GET /w.x.y.0/w.x.y.z
HTTP/1.1” 200 176 0.8875

Since I already have the “ignore_puppet…” setting set to true, I’m
wondering if anyone would know of a way to get around this error ? Any way
to cleanup the foreman database for all other hosts in this case ?

Thanks


Marek

We encountered this too, after upgrading from 1.7 to 1.9.
We believe this is caused by Bug #12486: Duplicate IP addresses after upgrading from 1.7 -> 1.8 -> 1.9 - Foreman

··· On Saturday, October 31, 2015 at 11:57:58 AM UTC+2, ghidu wrote: > > I'm also encountering this more frequently lately. It would help if we > could know the duplicated IP and perhaps the MAC address. > Did anyone try to debug this? > > On Wednesday, October 28, 2015 at 2:49:09 PM UTC+2, SCHAER Frederic wrote: >> >> Hi, >> >> >> >> I’ve read a thread on this list which is about the same thing, but for >> MAC addresses. >> >> I’ve just migrated to foreman 1.9.2, so I can’t say if the issue was >> already present in 1.8 – I am assuming it was. >> >> >> >> The issue is the following : >> >> I have a host, on which I defined a bridge during the system lifetime >> (libvirt host). >> >> At some time, I must have had the foreman setting >> “ignore_puppet_facts_for_provisionning” set to false – but it has been set >> to true for some time already. >> >> >> >> I now see in my host all the network interfaces + the bridge with the >> machine IP + “eth0” (should be em1… anyway) with the machine IP address too. >> >> >> >> I’d like to reinstall the host and change its OS. >> >> And whatever I try, I always get an error message about the host IP >> address which has already been taken. >> >> I tried deleting all network interfaces but the main eth0 one : they all >> come back when I try to save. >> >> >> >> In the foreman-proxy host, I see a query for this IP (w.x.y.z)but twice >> in 1 second : >> >> w.w.w.w - - [28/Oct/2015 13:39:08] "GET /w.x.y.0/w.x.y.z HTTP/1.1" 200 >> 176 0.8319 >> >> w.w.w.w - - [28/Oct/2015 13:39:09] "GET /w.x.y.0/w.x.y.z HTTP/1.1" 200 >> 176 0.8875 >> >> >> >> >> >> Since I already have the “ignore_puppet…” setting set to true, I’m >> wondering if anyone would know of a way to get around this error ? >> >> Any way to cleanup the foreman database for all other hosts in this case ? >> >> >> >> Thanks >> >