Foreman-proxy doesn't remove dhcpd entry on host delete

Problem:
When I delete a host from foreman, the proxy doesn’t remove the entry from /var/lib/dhcpd/dhcpd.leases
This prevents to build it again with another suggested IP.

Expected outcome:
The entry should be removed on delete.

Foreman and Proxy versions:
Foreman: 2.0.0
Foreman-proxy: 2.0.0

Foreman and Proxy plugin versions:
|foreman-tasks|1.0.1|
|foreman_ansible|5.0.1|
|foreman_column_view|0.4.0|
|foreman_discovery|16.0.1|
|foreman_kubevirt|0.1.7|
|foreman_openscap|2.0.2|
|foreman_remote_execution|3.0.3|
|katello|3.15.0.1|

Distribution and version:
CentOS 7.8.2003

Other relevant data:
I’m using FreeIPA Authentication and for REALM/DNS and foreman-proxy has the ISC DHCPD locally managed. I’m provisioning thru PXE on a vlan. Sorry if some information is irrelevant I’m just starting with foreman and trying to grasp some concepts. Is there any/more mistakes from my behalf?
Any help is appreciated

foreman-proxy features:
[“ansible”,“bmc”,“dhcp”,“discovery”,“dynflow”,“httpboot”,“logs”,“openscap”,“pulp”,“pulpcore”,“puppet”,“puppetca”,“realm”,“ssh”,“templates”,“tftp”]

proxy.log

May  7 16:36:41 katello smart-proxy: 172.19.20.4 - - [07/May/2020:16:36:41 EEST] "GET /tftp/serverName HTTP/1.1" 200 17
May  7 16:36:41 katello smart-proxy: - -> /tftp/serverName
May  7 16:36:41 katello smart-proxy: 172.19.20.4 - - [07/May/2020:16:36:41 EEST] "DELETE /dhcp/172.19.20.3/mac/08:f1:ea:cf:0a:50 HTTP/1.1" 200 0
May  7 16:36:41 katello smart-proxy: - -> /dhcp/172.19.20.3/mac/08:f1:ea:cf:0a:50
May  7 16:36:41 katello smart-proxy: 172.19.20.4 - - [07/May/2020:16:36:41 EEST] "DELETE /tftp/PXELinux/08:f1:ea:cf:0a:50 HTTP/1.1" 200 0
May  7 16:36:41 katello smart-proxy: - -> /tftp/PXELinux/08:f1:ea:cf:0a:50
May  7 16:36:41 katello smart-proxy: 172.19.20.4 - - [07/May/2020:16:36:41 EEST] "DELETE /tftp/PXEGrub2/08:f1:ea:cf:0a:50 HTTP/1.1" 200 0
May  7 16:36:41 katello smart-proxy: - -> /tftp/PXEGrub2/08:f1:ea:cf:0a:50
May  7 16:36:41 katello smart-proxy: 172.19.20.4 - - [07/May/2020:16:36:41 EEST] "DELETE /tftp/PXEGrub/08:f1:ea:cf:0a:50 HTTP/1.1" 200 0
May  7 16:36:41 katello smart-proxy: - -> /tftp/PXEGrub/08:f1:ea:cf:0a:50
May  7 16:36:41 katello smart-proxy: 172.19.20.4 - - [07/May/2020:16:36:41 EEST] "DELETE /tftp/iPXE/08:f1:ea:cf:0a:50 HTTP/1.1" 200 0
May  7 16:36:41 katello smart-proxy: - -> /tftp/iPXE/08:f1:ea:cf:0a:50
May  7 16:36:42 katello smart-proxy: /usr/share/foreman-proxy/modules/realm_freeipa/provider.rb:41: warning: already initialized constant XMLRPC::Config::ENABLE_NIL_PARSER
May  7 16:36:42 katello smart-proxy: /usr/share/foreman-proxy/modules/realm_freeipa/provider.rb:41: warning: previous definition of ENABLE_NIL_PARSER was here
May  7 16:36:42 katello smart-proxy: 172.19.20.4 - - [07/May/2020:16:36:41 EEST] "DELETE /realm/DO.example.com/ovirt-db-2.do.example.com HTTP/1.1" 200 127
May  7 16:36:42 katello smart-proxy: - -> /realm/DO.example.com/ovirt-db-2.do.example.com

dhcpd.leases

lease 172.19.21.200 {
  starts 4 2020/05/07 12:24:26;
  ends 4 2020/05/07 12:31:19;
  tstp 4 2020/05/07 12:31:19;
  cltt 4 2020/05/07 12:24:26;
  binding state free;
  hardware ethernet 08:f1:ea:cf:3e:d0;
}
server-duid "\000\001\000\001&F\270\271\000%\263\243\273\350";

host ovirt-db-3.do.example.com {
  dynamic;
  hardware ethernet 08:f1:ea:cf:3e:d0;
  fixed-address 172.19.21.22;
        supersede server.filename = "grub2/grubx64.efi";
        supersede server.next-server = ac:13:14:04;
        supersede host-name = "ovirt-db-3.do.example.com";
}

foreman-installer dhcp options:

--foreman-proxy-dhcp          Enable DHCP feature (current: true)
--foreman-proxy-dhcp-config   DHCP config file path (current: "/etc/dhcp/dhcpd.conf")
--foreman-proxy-dhcp-gateway  DHCP pool gateway (current: "172.19.20.1")
--foreman-proxy-dhcp-interface  DHCP listen interface (current: "vlan97")
--foreman-proxy-dhcp-leases   DHCP leases file (current: "/var/lib/dhcpd/dhcpd.leases")
--foreman-proxy-dhcp-listen-on  DHCP proxy to listen on https, http, or both (current: "https")
--foreman-proxy-dhcp-managed  The DHCP daemon is managed by this module (current: true)
--foreman-proxy-dhcp-nameservers  DHCP nameservers, comma-separated (current: "172.19.20.2,172.19.20.3,172.17.254.254")
--foreman-proxy-dhcp-node-type  DHCP node type (current: "standalone")
--foreman-proxy-dhcp-option-domain  DHCP use the dhcpd config option domain-name (current: ["do.example.com"])
--foreman-proxy-dhcp-provider  DHCP provider for the DHCP module (current: "isc")
--foreman-proxy-dhcp-pxefilename  DHCP "filename" value, defaults otherwise to pxelinux.0 (current: "pxelinux.0")
--foreman-proxy-dhcp-pxeserver  DHCP "next-server" value, defaults otherwise to IP of dhcp_interface (current: UNDEF)
--foreman-proxy-dhcp-range    Space-separated DHCP pool range (current: "172.19.21.200 172.19.21.254")
--foreman-proxy-dhcp-search-domains  DHCP search domains option (current: ["do.example.com"])
--foreman-proxy-dhcp-server   Address of DHCP server to manage (current: "127.0.0.1")
--foreman-proxy-dhcp-subnets  Subnets list to restrict DHCP management to (current: ["172.19.20.0/23"])

Defined subnet:


Hello,

dhcpd.leases is append-only file. Entries do not get deleted from there, but a new line which “removes” the reservation is appended. From time to time (I think once per hour or few hours), ISC DHCP “squashes” the file and removes the reservations which should not be there anymore. You cannot force ISC DHCP to do this, but it looks like it does this at least once during restart.

For more info head over to the man pages of ISC DHCP.