Hi everyone, I’m trying to create a new host on my freshly installed Foreman, but I get this error
"Create DHCP Settings for deb-pxe.localdomain task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://foreman.localdomain:9090/dhcp"
I checked the log of the Foreman-proxy and I’ve got this output:
2025-05-05T05:16:11 b0112d95 [E] Omshell failed: omshell= > > > obj: <null>
omshell= > obj: host
omshell= > obj: host
omshell= name = "deb-pxe.localdomain"
omshell= > obj: host
omshell= name = "deb-pxe.localdomain"
omshell= ip-address = ac:10:01:c5
omshell= > obj: host
omshell= name = "deb-pxe.localdomain"
omshell= ip-address = ac:10:01:c5
omshell= hardware-address = bc:24:11:89:1c:9b
omshell= > obj: host
omshell= name = "deb-pxe.localdomain"
omshell= ip-address = ac:10:01:c5
omshell= hardware-address = bc:24:11:89:1c:9b
omshell= hardware-type = 1
omshell= > obj: host
omshell= name = "deb-pxe.localdomain"
omshell= ip-address = ac:10:01:c5
omshell= hardware-address = bc:24:11:89:1c:9b
omshell= hardware-type = 1
omshell= statements = "filename = "pxelinux.0"; next-server = ac:10:01:32; option host-name = "deb-pxe.localdomain";"
omshell= > can't open object: no key specified
omshell= obj: host
omshell= name = "deb-pxe.localdomain"
omshell= ip-address = ac:10:01:c5
omshell= hardware-address = bc:24:11:89:1c:9b
omshell= hardware-type = 1
omshell= statements = "filename = "pxelinux.0"; next-server = ac:10:01:32; option host-name = "deb-pxe.localdomain";"
omshell= >
2025-05-05T05:16:11 b0112d95 [E] Failed to add DHCP reservation for deb-pxe.localdomain (172.16.1.197 / bc:24:11:89:1c:9b)
2025-05-05T05:16:11 b0112d95 [W] Error details for Failed to add DHCP reservation for deb-pxe.localdomain (172.16.1.197 / bc:24:11:89:1c:9b): <Proxy::DHCP::Error>: Failed to add DHCP reservation for deb-pxe.localdomain (172.16.1.197 / bc:24:11:89:1c:9b)
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:109:in `report'
Apparently the error is on the keys that I configured on the /etc/dhcp/dhcpd.conf
and in the etc/foreman-proxy/settings.d/dhcp_isc.yml
, these are my configurations:
/etc/dhcp/dhpd.conf
omapi-port 7911;
default-lease-time 43200;
max-lease-time 86400;
key omapi_key {
algorithm HMAC-SHA256;
secret #########;
};
omapi-key omapi_key;
authoritative;
ddns-update-style none;
option domain-name "localdomain";
option domain-name-servers 172.16.1.50;
option ntp-servers none;
allow booting;
allow bootp;
option fqdn.no-client-update on; # set the "O" and "S" flag bits
option fqdn.rcode2 255;
option pxegrub code 150 = text ;
# required for UEFI HTTP boot
if substring(option vendor-class-identifier, 0, 10) = "HTTPClient" {
option vendor-class-identifier "HTTPClient";
}
# promote vendor in dhcpd.leases
set vendor-string = option vendor-class-identifier;
# next server and filename options
next-server 172.16.1.50;
option architecture code 93 = unsigned integer 16 ;
if option architecture = 00:06 {
filename "grub2/shim.efi";
} elsif option architecture = 00:07 {
filename "grub2/shim.efi";
} elsif option architecture = 00:09 {
filename "grub2/shim.efi";
} else {
filename "pxelinux.0";
}
log-facility local7;
include "/etc/dhcp/dhcpd.hosts";
# localdomain
subnet 172.16.1.0 netmask 255.255.255.0 {
pool
{
range 172.16.1.100 172.16.1.200;
}
option subnet-mask 255.255.255.0;
option routers 172.16.1.1;
}
/etc/foreman-proxy/settings.d/dhcp_isc.yml
---
#
# Configuration file for ISC dhcp provider
#
:config: /etc/dhcp/dhcpd.conf
:leases: /var/lib/dhcpd/dhcpd.leases
# Redhat 5
#
#:config: /etc/dhcpd.conf
#
# Settings for Ubuntu
#
#:config: /etc/dhcp3/dhcpd.conf
#:leases: /var/lib/dhcp3/dhcpd.leases
# Specifies TSIG key name and secret
:key_name: omapi_key
:key_secret: ##########
:omapi_port: 7911
# use :server setting in dhcp.yml if you are managing a dhcp server which is not localhost
Foreman and Proxy versions:
Foreman 3.13 (Also this error was present in 3.14)
Distribution and version:
AlmaLinux 9
Im very lost with this error, so it would be amazing if someone could help me