ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request) for proxy
Environment
- Red Hat Satellite 6.x
- PXE-based provisioning
Issue
- Creating new host using additional subnet on Red Hat Satellite 6.x fails with below error.
Create DHCP Settings for client.example.com task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://capsule.example.com:9090/dhcp
Unable to save
Create DHCP Settings for client.example.com task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request) for Capsule https://satellite.example.com:9090/dhcp
Resolution
There is a DHCP host reservation that already exists for the particular hostname. Check the DHCP database on the Capsule that is causing the error (
/var/lib/dhcpd/dhcpd.leases):
host host123.example.com {
dynamic;
hardware ethernet 00:50:56:cc:bb:aa;
fixed-address 192.168.99.100;
supersede server.filename = "pxelinux.0";
supersede server.next-server = 0a:c1:20:10;
supersede host-name = "host123.example.com";
}
In order to fix this error, delete the problematic record. Please read the manual page for dhcpd.leases about the format of this file, it's append only. Create a backup of the lease file before proceeding.
- The first option is to delete a record is to append deletion entry:
cat >> /var/lib/dhcpd/dhcpd.leases <<EOA
host host123.example.com {
dynamic;
deleted;
}
EOA
- The second option is to stop dhcpd daemon, delete the entry in
/var/lib/dhcpd/dhcpd.leasesand start it again.
Additional checklist to prevent the issue happen:
-
Do not associate or change Subnet for existing hosts. The correct workflow is to delete the host and create a new one. Only change Subnets when you follow with manual edits of configuration files. This applies to Domains.
-
Do not change TFTP, DHCP and DNS proxies for existing Subnet or Domain objects when there are existing hosts. This will again lead to inconsistency.
-
Make sure all the Red Hat Satellite 6 is configured correctly for This content is not included.provisioning.
-
When executing
katello-installerwithDHCP,DNS& other parameters as per This content is not included.provisioning guide at the initial Red Hat Satellite installation step, theDNSentry for primary subnet is created. But for additional subnet it is required to manually add the entry in/etc/zones.conffile and create the subnet file under/var/named/dynamicsimilar to primary subnet. -
If you notice the error after upgrade, verify that no custom configuration in
/etc/dhcp/dhcpd.confoverwritten by installer.
See Applying custom configuration to your Satellite article for more information.
Also, make sure to restartforeman-proxyanddhcpdservices when you restore olddhcpd.confconfiguration as per the article. -
Make sure you are provisioning in the same subnet for which you are running your dhcp services as defined in /etc/dhcp/dhcpd.conf file.
-
In case you are provisioning with more than one interface, then make sure the
subnetfor the non-provisioning interface does not have aDHCP CAPSULEselected.
For more KB articles/solutions related to Red Hat Satellite 6.x Provisioning Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Provisioning related Issues
Root Cause
This can happen when you create new host, then undefine Subnet from it and then delete it. Then Satellite 6 will not delete the reservation apparently because the Subnet was already undefined. Future version of Satellite 6 will show a warning, but we want to keep the possibility to change the Subnet for advanced users.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.