Create DHCP Settings for cuarto.dot task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://primero.dot:8443/dhcp

Problem:
I am unable to create a new host via manual input and/or foreman_discovery because of dhcp error.
After submitting the entry, I get this error “Create DHCP Settings for cuarto.dot task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://primero.dot:8443/dhcp
Expected outcome:
Successful Host Creation
Foreman and Proxy versions:
3.0.1
Foreman and Proxy plugin versions:
foreman_bootdisk (18.0.0)
foreman_discovery (18.0.5)
foreman_puppet (1.0.5)
Distribution and version:
Ubuntu 20.04
Other relevant data:

/var/log/foreman-proxy/proxy.log

2021-12-02T13:29:09 7a3dd2d7 [I] Started GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 
2021-12-02T13:29:09 7a3dd2d7 [E] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:29:09 7a3dd2d7 [W] Error details for No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:29:09 7a3dd2d7 [W] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:29:09 7a3dd2d7 [I] Finished GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 with 404 (0.93 ms)
2021-12-02T13:29:09 7a3dd2d7 [I] Started GET /dhcp/10.70.0.0/unused_ip mac=00:1e:0b:c6:f1:a0&from=10.70.1.1&to=10.70.1.10
2021-12-02T13:29:11 7a3dd2d7 [I] Finished GET /dhcp/10.70.0.0/unused_ip with 200 (2006.97 ms)
2021-12-02T13:29:11 7a3dd2d7 [I] Started GET /tftp/serverName 
2021-12-02T13:29:11 7a3dd2d7 [I] Finished GET /tftp/serverName with 200 (0.59 ms)
2021-12-02T13:29:12 7a3dd2d7 [I] Started GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 
2021-12-02T13:29:12 7a3dd2d7 [E] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:29:12 7a3dd2d7 [W] Error details for No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:29:12 7a3dd2d7 [W] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:29:12 7a3dd2d7 [I] Finished GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 with 404 (0.98 ms)
2021-12-02T13:29:12 7a3dd2d7 [I] Started GET /dhcp/10.70.0.0/ip/10.70.1.9 
2021-12-02T13:29:12 7a3dd2d7 [E] No DHCP records for IP 10.70.0.0/10.70.1.9 found
2021-12-02T13:29:12 7a3dd2d7 [W] Error details for No DHCP records for IP 10.70.0.0/10.70.1.9 found: <Exception>: No DHCP records for IP 10.70.0.0/10.70.1.9 found
2021-12-02T13:29:12 7a3dd2d7 [W] No DHCP records for IP 10.70.0.0/10.70.1.9 found: <Exception>: No DHCP records for IP 10.70.0.0/10.70.1.9 found
2021-12-02T13:29:12 7a3dd2d7 [I] Finished GET /dhcp/10.70.0.0/ip/10.70.1.9 with 404 (0.86 ms)
2021-12-02T13:30:12 c382e888 [I] Started GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 
2021-12-02T13:30:12 c382e888 [E] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:12 c382e888 [W] Error details for No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:12 c382e888 [W] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:12 c382e888 [I] Finished GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 with 404 (0.92 ms)
2021-12-02T13:30:12 c382e888 [I] Started GET /dhcp/10.70.0.0/unused_ip mac=00:1e:0b:c6:f1:a0&from=10.70.1.1&to=10.70.1.10
2021-12-02T13:30:12 c382e888 [W] No free IPs in range 10.70.1.1..10.70.1.10.
2021-12-02T13:30:12 c382e888 [I] Finished GET /dhcp/10.70.0.0/unused_ip with 200 (5.2 ms)
2021-12-02T13:30:12 c382e888 [I] Started GET /tftp/serverName 
2021-12-02T13:30:12 c382e888 [I] Finished GET /tftp/serverName with 200 (0.62 ms)
2021-12-02T13:30:12 c382e888 [I] Started GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 
2021-12-02T13:30:12 c382e888 [E] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:12 c382e888 [W] Error details for No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:12 c382e888 [W] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:12 c382e888 [I] Finished GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 with 404 (3.58 ms)
2021-12-02T13:30:12 c382e888 [I] Started GET /dhcp/10.70.0.0/ip/10.70.1.9 
2021-12-02T13:30:12 c382e888 [E] No DHCP records for IP 10.70.0.0/10.70.1.9 found
2021-12-02T13:30:12 c382e888 [W] Error details for No DHCP records for IP 10.70.0.0/10.70.1.9 found: <Exception>: No DHCP records for IP 10.70.0.0/10.70.1.9 found
2021-12-02T13:30:12 c382e888 [W] No DHCP records for IP 10.70.0.0/10.70.1.9 found: <Exception>: No DHCP records for IP 10.70.0.0/10.70.1.9 found
2021-12-02T13:30:12 c382e888 [I] Finished GET /dhcp/10.70.0.0/ip/10.70.1.9 with 404 (0.88 ms)
2021-12-02T13:30:17 87ddd61f [I] Started GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 
2021-12-02T13:30:17 87ddd61f [E] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:17 87ddd61f [W] Error details for No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:17 87ddd61f [W] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:17 87ddd61f [I] Finished GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 with 404 (0.89 ms)
2021-12-02T13:30:17 87ddd61f [I] Started GET /dhcp/10.70.0.0/unused_ip mac=00:1e:0b:c6:f1:a0&from=10.70.1.1&to=10.70.1.10
2021-12-02T13:30:17 87ddd61f [W] No free IPs in range 10.70.1.1..10.70.1.10.
2021-12-02T13:30:17 87ddd61f [I] Finished GET /dhcp/10.70.0.0/unused_ip with 200 (0.93 ms)
2021-12-02T13:30:17 87ddd61f [I] Started GET /tftp/serverName 
2021-12-02T13:30:17 87ddd61f [I] Finished GET /tftp/serverName with 200 (0.51 ms)
2021-12-02T13:30:17 87ddd61f [I] Started GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 
2021-12-02T13:30:17 87ddd61f [E] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:17 87ddd61f [W] Error details for No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:17 87ddd61f [W] No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found: <Exception>: No DHCP record for MAC 10.70.0.0/00:1e:0b:c6:f1:a0 found
2021-12-02T13:30:17 87ddd61f [I] Finished GET /dhcp/10.70.0.0/mac/00:1e:0b:c6:f1:a0 with 404 (0.76 ms)
2021-12-02T13:30:17 87ddd61f [I] Started GET /dhcp/10.70.0.0/ip/10.70.1.9 
2021-12-02T13:30:17 87ddd61f [E] No DHCP records for IP 10.70.0.0/10.70.1.9 found
2021-12-02T13:30:17 87ddd61f [W] Error details for No DHCP records for IP 10.70.0.0/10.70.1.9 found: <Exception>: No DHCP records for IP 10.70.0.0/10.70.1.9 found
2021-12-02T13:30:17 87ddd61f [W] No DHCP records for IP 10.70.0.0/10.70.1.9 found: <Exception>: No DHCP records for IP 10.70.0.0/10.70.1.9 found
2021-12-02T13:30:17 87ddd61f [I] Finished GET /dhcp/10.70.0.0/ip/10.70.1.9 with 404 (0.79 ms)
2021-12-02T13:30:17 87ddd61f [I] Started POST /dhcp/10.70.0.0 
2021-12-02T13:30:17 87ddd61f [I] Next-server option not IPv4, trying to resolve 'primero.dot'
2021-12-02T13:30:17 87ddd61f [E] Omshell failed: omshell= > > > dhcpctl_connect: no more
omshell= > not connected.
omshell= > no open object.
omshell= > no open object.
omshell= > no open object.
omshell= > no open object.
omshell= > no open object.
omshell= > not connected.
omshell= > 
2021-12-02T13:30:17 87ddd61f [E] Failed to add DHCP reservation for cuarto.dot (10.70.1.9 / 00:1e:0b:c6:f1:a0): No response from DHCP server
2021-12-02T13:30:17 87ddd61f [W] Error details for Failed to add DHCP reservation for cuarto.dot (10.70.1.9 / 00:1e:0b:c6:f1:a0): No response from DHCP server: <Proxy::DHCP::Error>: Failed to add DHCP reservation for cuarto.dot (10.70.1.9 / 00:1e:0b:c6:f1:a0): No response from DHCP server
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:103:in `report'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:81:in `om_disconnect'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:54:in `om_add_record'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:30:in `add_record'
/usr/share/foreman-proxy/modules/dhcp/dhcp_api.rb:87:in `block in <class:DhcpApi>'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1636:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1636:in `block in compile!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:987:in `block (3 levels) in route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1006:in `route_eval'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:987:in `block (2 levels) in route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1035:in `block in process_route'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1033:in `catch'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1033:in `process_route'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:985:in `block in route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:984:in `each'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:984:in `route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1098:in `block in dispatch!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `block in invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `catch'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1095:in `dispatch!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:919:in `block in call!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `block in invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `catch'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:919:in `call!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:908:in `call'
/usr/lib/ruby/vendor_ruby/rack/method_override.rb:22:in `call'
/usr/share/foreman-proxy/lib/proxy/log.rb:105:in `call'
/usr/share/foreman-proxy/lib/proxy/request_id_middleware.rb:11:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/xss_header.rb:18:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/path_traversal.rb:16:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/json_csrf.rb:26:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/base.rb:50:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/base.rb:50:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/frame_options.rb:31:in `call'
/usr/lib/ruby/vendor_ruby/rack/null_logger.rb:9:in `call'
/usr/lib/ruby/vendor_ruby/rack/head.rb:12:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/show_exceptions.rb:22:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:194:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1951:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1503:in `block in call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1730:in `synchronize'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1503:in `call'
/usr/lib/ruby/vendor_ruby/rack/urlmap.rb:68:in `block in call'
/usr/lib/ruby/vendor_ruby/rack/urlmap.rb:53:in `each'
/usr/lib/ruby/vendor_ruby/rack/urlmap.rb:53:in `call'
/usr/lib/ruby/vendor_ruby/rack/builder.rb:153:in `call'
/usr/lib/ruby/vendor_ruby/rack/handler/webrick.rb:86:in `service'
/usr/lib/ruby/2.7.0/webrick/httpserver.rb:140:in `service'
/usr/lib/ruby/2.7.0/webrick/httpserver.rb:96:in `run'
/usr/lib/ruby/2.7.0/webrick/server.rb:307:in `block in start_thread'
/usr/lib/ruby/vendor_ruby/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2021-12-02T13:30:17 87ddd61f [W] Failed to add DHCP reservation for cuarto.dot (10.70.1.9 / 00:1e:0b:c6:f1:a0): No response from DHCP server: <Proxy::DHCP::Error>: Failed to add DHCP reservation for cuarto.dot (10.70.1.9 / 00:1e:0b:c6:f1:a0): No response from DHCP server
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:103:in `report'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:81:in `om_disconnect'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:54:in `om_add_record'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:30:in `add_record'
/usr/share/foreman-proxy/modules/dhcp/dhcp_api.rb:87:in `block in <class:DhcpApi>'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1636:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1636:in `block in compile!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:987:in `block (3 levels) in route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1006:in `route_eval'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:987:in `block (2 levels) in route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1035:in `block in process_route'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1033:in `catch'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1033:in `process_route'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:985:in `block in route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:984:in `each'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:984:in `route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1098:in `block in dispatch!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `block in invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `catch'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1095:in `dispatch!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:919:in `block in call!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `block in invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `catch'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1072:in `invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:919:in `call!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:908:in `call'
/usr/lib/ruby/vendor_ruby/rack/method_override.rb:22:in `call'
/usr/share/foreman-proxy/lib/proxy/log.rb:105:in `call'
/usr/share/foreman-proxy/lib/proxy/request_id_middleware.rb:11:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/xss_header.rb:18:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/path_traversal.rb:16:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/json_csrf.rb:26:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/base.rb:50:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/base.rb:50:in `call'
/usr/lib/ruby/vendor_ruby/rack/protection/frame_options.rb:31:in `call'
/usr/lib/ruby/vendor_ruby/rack/null_logger.rb:9:in `call'
/usr/lib/ruby/vendor_ruby/rack/head.rb:12:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/show_exceptions.rb:22:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:194:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1951:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1503:in `block in call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1730:in `synchronize'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1503:in `call'
/usr/lib/ruby/vendor_ruby/rack/urlmap.rb:68:in `block in call'
/usr/lib/ruby/vendor_ruby/rack/urlmap.rb:53:in `each'
/usr/lib/ruby/vendor_ruby/rack/urlmap.rb:53:in `call'
/usr/lib/ruby/vendor_ruby/rack/builder.rb:153:in `call'
/usr/lib/ruby/vendor_ruby/rack/handler/webrick.rb:86:in `service'
/usr/lib/ruby/2.7.0/webrick/httpserver.rb:140:in `service'
/usr/lib/ruby/2.7.0/webrick/httpserver.rb:96:in `run'
/usr/lib/ruby/2.7.0/webrick/server.rb:307:in `block in start_thread'
/usr/lib/ruby/vendor_ruby/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2021-12-02T13:30:17 87ddd61f [I] Finished POST /dhcp/10.70.0.0 with 400 (27.19 ms)

/etc/dhcp/dhcpd.conf

omapi-port 7911;

default-lease-time 43200;
max-lease-time 86400;


not authoritative;


ddns-update-style none;

option domain-name "dot";
option domain-name-servers 10.70.1.1;
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 10.70.1.1;
option architecture code 93 = unsigned integer 16 ;
if option architecture = 00:06 {
  filename "grub2/bootia32.efi";
} elsif option architecture = 00:07 {
  filename "grub2/bootx64.efi";
} elsif option architecture = 00:09 {
  filename "grub2/bootx64.efi";
} else {
  filename "pxelinux.0";
}

log-facility local7;

include "/etc/dhcp/dhcpd.hosts";
# dot
subnet 10.70.0.0 netmask 255.255.0.0 {
  pool
  {
    range 10.70.0.0 10.70.4.100;
  }

  option subnet-mask 255.255.0.0;
  option routers 10.70.1.1;
}

Proxy can’t connect to the DHCP server via OMAPI. Investigate why.

Hi Izap, I am not sure where to look. Can you please advise on where to investigate?

Smart proxy performs omshell command and that fails to connect. There can be multiple reasons for that. Increase logging level to DEBUG for foreman-proxy, restart, try again.

Try to perform a DHCP update via omshell command as foreman-proxy user manually: omshell(1): OMAPI Command Shell - Linux man page

You will need to know the omapi key and secure string. It is those keys from the dhcp configuration file.

Hi Guys, did anybody get solution for this problem I am also receiving
RF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request

SmartProxy 3.4.1 managed DHCP same version is foreman

Logs from proxy, isc-dhcp-server is up and running no problem

2023-01-24T13:07:17 196612b2 [I] Finished POST /dhcp/10.237.4.0 with 400 (17.22 ms)
2023-01-24T13:11:17 1c00f9a8 [I] Started GET /tftp/serverName
2023-01-24T13:11:17 1c00f9a8 [I] Finished GET /tftp/serverName with 200 (1.24 ms)
2023-01-24T13:11:17 1c00f9a8 [I] Started POST /dhcp/10.237.4.0
2023-01-24T13:11:17 1c00f9a8 [I] Next-server option not IPv4, trying to resolve ‘bdtforeman01.test.domain’
2023-01-24T13:11:17 1c00f9a8 [E] Omshell failed: omshell= > > > dhcpctl_connect: no more
omshell= > not connected.
omshell= > no open object.
omshell= > no open object.
omshell= > no open object.
omshell= > no open object.
omshell= > no open object.
omshell= > not connected.
omshell= >
2023-01-24T13:11:17 1c00f9a8 [E] Failed to add DHCP reservation for ddmmzdb02.test.domain (10.237.4.106 / 56:6f:1d:0b:00:23): No response from DHCP server
2023-01-24T13:11:17 1c00f9a8 [W] Error details for Failed to add DHCP reservation for ddmmzdb02.test.domain (10.237.4.106 / 56:6f:1d:0b:00:23): No response from DHCP server: Proxy::DHCP::Error: Failed to add DHCP reservation for ddmmzdb02.test.domain (10.237.4.106 / 56:6f:1d:0b:00:23): No response from DHCP server

1 Like

HI @gol19
I am also affected by this. Latest 3.5 version of all things.

Now if I run omshell and try to connect I don’t get back anything.
So I am looking at how to debug the omapi at this point, but nothing is being logged on DHCP server syslogs…

Any help is appreciated!

I have massive problem with DHCP and new foreman installed on Ubuntu 20.04

1 Like

Is there any better way of getting this to work?

I am open to install another distro if that helps…

I think that this is not problem for me anymore.
I installed ISC-DHCP server from source. 4.4.3 version
please check below link

https://www.linuxfromscratch.org/blfs/view/svn/basicnet/dhcp.html

Hi @gol19
weird issue actually:
When I issue “systemctl start dhcpd” after building dhcpd from scratch I see the daemon started, port open, it even works, but on the other tmux pane it is still stuck with “systemctl start dhcpd” until ~60 seconds when it times out.
In the meanwhile the server works though, getting an IP address on the client connecting, etc!

Seems there is still a bug when built from source?

Here is what I used to build/launch

./configure --sysconfdir=/etc/dhcp --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases --enable-paranoia --with-cli-lease-file=/var/lib/dhclient/dhclient.leases --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases --localstatedir=/var --prefix=/usr

make -j8

make -C server install

systemctl daemon-reload

systemctl start dhcpd.service

All this on Rocky Linux 8 right now.

hm not sure for RedHat edition I tried on Ubuntu 20.04 and working fine for now. Do still have problem with omnishell and foreman,

1 Like

Thanks, I’ll try and install Ubuntu quickly again!

OK, reinstall was quick.
But still I am not being able to run foreman-installer for the SSL certificates that puppet generates.

2023-02-24 05:27:15 [NOTICE] [root] Loading installer configuration. This will take some time.
2023-02-24 05:27:18 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2023-02-24 05:27:18 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2023-02-24 05:27:20 [NOTICE] [configure] Starting system configuration.
2023-02-24 05:27:28 [NOTICE] [configure] 250 configuration steps out of 1414 steps complete.
2023-02-24 05:27:28 [NOTICE] [configure] 500 configuration steps out of 1416 steps complete.
2023-02-24 05:27:28 [NOTICE] [configure] 750 configuration steps out of 1428 steps complete.
2023-02-24 05:27:29 [NOTICE] [configure] 1000 configuration steps out of 1553 steps complete.
2023-02-24 05:27:46 [NOTICE] [configure] 1250 configuration steps out of 1553 steps complete.
2023-02-24 05:27:46 [NOTICE] [configure] 1500 configuration steps out of 1559 steps complete.
2023-02-24 05:27:47 [ERROR ] [configure] /Stage[main]/Foreman::Register/Foreman_host[foreman-vmforeman-dev.dev-farm.something.net]: Could not evaluate: Exception SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain) in get request to: https://vmforeman-dev.dev-farm.something.net/api/v2/hosts?search=name%3D"vmforeman-dev.dev-farm.something.net"
2023-02-24 05:27:47 [ERROR ] [configure] Wrapped exception:
2023-02-24 05:27:47 [ERROR ] [configure] SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain)
2023-02-24 05:27:49 [NOTICE] [configure] System configuration has finished.

Any idea, @gol19 ?

I got this sorted out by using the correct files on foreman-installer command, had some f-up with CA and CRT/CHAIN…
Now I have a different issue at the moment with
/etc/apache2/mods-available/event.conf: ThreadsPerChild 16
resulting in
[ERROR ] [configure] Feb 24 07:20:02 vmforeman-dev apachectl[86287]: AH00513: WARNING: MaxRequestWorkers of 150 is not an integer multiple of ThreadsPerChild of 16, decreasing to nearest multiple 144, for a maximum of 9 servers.

…so I am having a good search on the net here.
foreman-installer is overwriting that value (of course)…

Manually changed this
apache::mod::event::threadsperchild: 16
to
apache::mod::event::threadsperchild: 10
in
/usr/share/foreman-installer/config/foreman.hiera/tuning/common.yaml

solved this issue.
Just continuing here as it might help others…?

Now still apache2 not starting, it’s latest version from a PPA, so Apache/2.4.55 (Ubuntu)

OK, it was just all about using the right cert/CA files!

Running, so now config of OSes can go on, and trying to get UEFI boot to work…

OK, still getting this, something I was not able to solve in the past before re-doing all again:

Create DHCP Settings for mac000c29238a30.dev-farm.tld.net task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::Conflict]: 409 Conflict) for proxy https://vmforeman-dev.dev-farm.tld.net:8443/dhcp

I have 2 separate subnets ranges defined in foreman-proxy range:

–foreman-proxy-dhcp-range=“10.1.0.10 10.1.0.99”

And in foreman GUI:

10.1.0.100 → 10.1.0.250

This is odd?