Unable to create new DHCP entry when PXE Loader is changed

Problem:
On an existing host, try to change the PXE Loader from the Foreman web UI. Results in error

Create DHCP Settings for lucia-noice.helab.in task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::Conflict]: 409 Conflict) for proxy https://thepuppetmaster.helab.in:8443/dhcp

However the dhcp lease file gets updated with the new entry.

Expected outcome:
DHCP lease file will already have an entry for this host. On changing the PXE Loader, it should invalidate this entry an write a new entry at the bottom.

Foreman and Proxy versions:

foreman/xenial,now 1.15.6-1 amd64 [installed,automatic]
foreman-cli/xenial,xenial,now 1.15.6-1 all [installed]
foreman-debug/xenial,xenial,now 1.15.6-1 all [installed,automatic]
foreman-installer/xenial,xenial,now 1.15.6-1 all [installed]
foreman-postgresql/xenial,xenial,now 1.15.6-1 all [installed]
foreman-proxy/xenial,xenial,now 1.15.6-1 all [installed]
ruby-foreman-hooks/plugins,plugins,now 0.3.14-1 all [installed]
ruby-foreman-setup/plugins,plugins,now 5.0.0-1 all [installed]
ruby-hammer-cli-foreman/xenial,xenial,now 0.10.2-1 all [installed,automatic]

Foreman and Proxy plugin versions:

isc-dhcp-client/xenial-updates,now 4.3.3-5ubuntu12.10 amd64 [installed]
isc-dhcp-common/xenial-updates,now 4.3.3-5ubuntu12.10 amd64 [installed]
isc-dhcp-server/xenial-updates,now 4.3.3-5ubuntu12.10 amd64 [installed]

Other relevant data:
Lease file before changing pxe loader:

# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.3.3

server-duid "\000\001\000\001\"\254\017O\000PV\210\200\223";
host lucia-noice.helab.in {
  dynamic;
  hardware ethernet 00:50:56:88:b4:15;
  fixed-address 10.10.10.25;
        supersede server.filename = "pxelinux.0";
        supersede server.next-server = 0a:0a:0a:02;
        supersede host-name = "lucia-noice.helab.in";
}

After changing PXE Loader through web UIlogs.tar (116.5 KB)

# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.3.3

host lucia-noice.helab.in {
  dynamic;
  hardware ethernet 00:50:56:88:b4:15;
  fixed-address 10.10.10.25;
        supersede server.filename = "pxelinux.0";
        supersede server.next-server = 0a:0a:0a:02;
        supersede host-name = "lucia-noice.helab.in";
}
server-duid "\000\001\000\001\"\254\017O\000PV\210\200\223";

host lucia-noice.helab.in {
  dynamic;
  deleted;
}
host lucia-noice.helab.in {
  dynamic;
  hardware ethernet 00:50:56:88:b4:15;
  fixed-address 10.10.10.25;
        supersede server.filename = "pxelinux.efi";
        supersede server.next-server = 0a:0a:0a:02;
        supersede host-name = "lucia-noice.helab.in";
}

production.log and proxy.log is attached

I have tried

Logs: logs.tar (116.5 KB)

This issue was not seen in Foreman v1.14.2 on Redhat 7.3 running dhcpd v4.2.5.47

Hello, known issue, fixed in 1.16:

https://projects.theforeman.org/issues/21120

Hi Lukas,
Will this not be ported to the stable branch in Ubuntu 16.04 LTS?

Patching 1.15 with https://github.com/theforeman/foreman/pull/5085 worked.
Really hope this is backported to the stable release.

Whilst I’m glad you got it working, I have to address this comment:

This is in the current stable release - Foreman 1.17 (which is available for Ubuntu 16.04). The Foreman community support the current release and the previous release (1.16 currently), and anything older is unsupported. We try help with older systems where we can, but I wouldn’t expect further 1.15 releases at this point. Consider upgrading your Foreman when you can find the time :slight_smile:

When adding the deb repository I used xenial-stable.
http://deb.theforeman.org/dists/xenial/stable/binary-amd64/Packages
This still lists 1.15. I think it should be updated to 1.17. That is what I meant by “stable” release.

1 Like

That sounds like an oversight during the release process - @packaging could someone take a look?

it’s that stable symlink once again…

@Amardeep_Kahali please check what you’re getting now with “xenial-stable”.

1 Like

1.16…Thank you!

1 Like

Looks like there was some regression for this case, I fixed it: Bug #27877: DHCP conflict when editing PXE loader for existing host - Foreman

Affected version?

All versions up to 1.24 (develop).