Troubleshooting "ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request)" error observed when provisioning a host from Red Hat Satellite 6.

Updated

Issue

When provisioning a host from Red Hat Satellite 6, creating a DHCP setting fails with:

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

Overview

The 400 Bad Request error usually indicates an incorrect pathway, or an inability to access the given pathway. Thus, it could mean that either there has been a syntax error in the configuration files, or that the configuration itself is incorrect in some way. As can be surmised, there might be multiple causes for this issue, and correspondingly, multiple resolutions. In this article, we will take a look at the different causes and solutions for this issue.

Known Issues and Resolution

Incorrect Syntax in the DHCP Configuration File

Incorrect File Permissions

  • Check if the /etc/dhcp/ and /var/lib/dhcpd/dhcpd.leases/ directories and their contents have the correct permissions set on them.

  • These files should all have dhcpd:dhcpd ownership and 755 file permissions.

  • More about this can be found in this article.

Incorrect DHCP view

  • When using Infoblox, make sure that the DHCP view is set to default. As Satellite comes with the default view, which is also provided by Infoblox, the environment should match this view.

  • You can refer to this article for further information.

Stale DHCP Reservation for the Same Hostname

NOTE: This scenario has been specifically observed in Red Hat Satellite versions 6.1 and 6.2, and has been addressed in the later versions of Satellite.

  • On older versions of Red Hat Satellite (6.1 and 6.2), it has been observed that the Satellite fails to delete the DHCP reservation if the host was deleted after undefining the Subnet. This leads to the 400 Bad Request error in case a new host is being provisioned with the same hostname.

  • This can be addressed by deleting the stale record from the DHCP leases.

  • The steps for deleting the record are outlined in this article.

Remediation steps in Satellite 6.8

  • With Satellite 6.8 an option to "synchronize" states between the DHCP and the Satellite database has been added.

  • Some examples of the commands that can be used with Satellite 6.8:

     # foreman-rake orchestration:dhcp:add_missing subnet_name=NAME
        Preview missing DHCP records on a DHCP Smart Proxy.
    
      # foreman-rake orchestration:dhcp:add_missing subnet_name=NAME perform=1
        Do create missing DHCP records on a DHCP Smart Proxy.
    
      # foreman-rake orchestration:dhcp:remove_offending subnet_name=NAME
        Preview offending DHCP records on a DHCP Smart Proxy.
    
      # foreman-rake orchestration:dhcp:remove_offending subnet_name=NAME perform=1
        Do remove offending DHCP records on a DHCP Smart Proxy.
    

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

SBR
Product(s)
Category
Components
Article Type