Dhcp stopped working / foreman proxy 1.15

Problem:
When I deploy a machine I get the error:
Failed to fetch a free IP from proxy *** (https://***:9090): ERF12-8202 [ProxyAPI::ProxyException]: Unable to retrieve unused IP ([RestClient::ResourceNotFound]: 404 Resource Not Found) for proxy https://***:9090/dhcp

It worked for months, but stopped now. How can I debug the foreman/dhcp connection?
DHCP-Server and Foreman (+Proxy) runs on the same systems.

Expected outcome:
Get a dhcp reservation

Foreman and Proxy versions:

Foreman (with Katello): 1.15.6

We see this very often. When dhcpd package is updated, it also sets more strict permissions on /etc/dhcp and/or /var/lib/dhcp.

Re-run our installer to correct those permissions, preferably with “-n” (no op) option first, or fix this manually. In recent versions of installer, we applied facls so it won’t happen again. Basically it does this:

setfacl -R -m u:foreman:rwx /etc/dhcp /var/lib/dhcpd

http://projects.theforeman.org/issues/20683

The installer should do this for you since some release. Pretty sure it was some 1.15.x (after 1.15.0) and you might not have rerun the installer.

The example @lzap provided is incorrect. It should be the foreman-proxy user rather than foreman. It’s also not needed to give write permissions. For copy-paste value:

setfacl -R -m u:foreman-proxy:rx /etc/dhcp /var/lib/dhcpd
1 Like

Thanks for the hint. Problem solved.