ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request)

Problem:

Can not create new host because DHCP entry can not be created. IP suggestion works fine.

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

Expected outcome:

DHCP entry should be created.

Foreman and Proxy versions:

2.0.0

Distribution and version:

Ubuntu 18.04

Other relevant data:

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

2020-04-28T12:46:34 9a963506 [I] Started GET /dhcp/192.168.1.0/unused_ip from=192.168.1.30&to=192.168.1.38
2020-04-28T12:46:36 d6904ff4 [I] Started GET /dhcp/192.168.1.0/unused_ip from=192.168.1.30&to=192.168.1.38
2020-04-28T12:46:36 9a963506 [I] Finished GET /dhcp/192.168.1.0/unused_ip with 200 (2006.95 ms)
2020-04-28T12:46:38 d6904ff4 [I] Finished GET /dhcp/192.168.1.0/unused_ip with 200 (2005.4 ms)
2020-04-28T12:46:44 cfb09092 [I] Started GET /dhcp/192.168.1.0/unused_ip from=192.168.1.30&to=192.168.1.38
2020-04-28T12:46:46 cfb09092 [I] Finished GET /dhcp/192.168.1.0/unused_ip with 200 (2005.91 ms)
2020-04-28T12:46:48 ff6a5935 [I] Started GET /dhcp/192.168.1.0/unused_ip from=192.168.1.30&to=192.168.1.38
2020-04-28T12:46:50 ff6a5935 [I] Finished GET /dhcp/192.168.1.0/unused_ip with 200 (2005.36 ms)
2020-04-28T12:47:59 5ba3fcb3 [I] Started GET /dhcp/192.168.1.0/unused_ip mac=00:0e:1e:7a:38:80&from=192.168.1.30&to=192.168.1.38
2020-04-28T12:48:01 5ba3fcb3 [I] Finished GET /dhcp/192.168.1.0/unused_ip with 200 (2007.03 ms)
2020-04-28T12:48:19 1c0ec421 [I] Started GET /dhcp/192.168.1.0/mac/00:0e:1e:7a:38:80
2020-04-28T12:48:19 1c0ec421 [E] No DHCP record for MAC 192.168.1.0/00:0e:1e:7a:38:80 found
2020-04-28T12:48:19 1c0ec421 [W] No DHCP record for MAC 192.168.1.0/00:0e:1e:7a:38:80 found
Exception: No DHCP record for MAC 192.168.1.0/00:0e:1e:7a:38:80 found
2020-04-28T12:48:19 1c0ec421 [I] Finished GET /dhcp/192.168.1.0/mac/00:0e:1e:7a:38:80 with 404 (1.52 ms)
2020-04-28T12:48:19 1c0ec421 [I] Started GET /dhcp/192.168.1.0/ip/192.168.1.34
2020-04-28T12:48:19 1c0ec421 [E] No DHCP records for IP 192.168.1.0/192.168.1.34 found
2020-04-28T12:48:19 1c0ec421 [W] No DHCP records for IP 192.168.1.0/192.168.1.34 found
Exception: No DHCP records for IP 192.168.1.0/192.168.1.34 found
2020-04-28T12:48:19 1c0ec421 [I] Finished GET /dhcp/192.168.1.0/ip/192.168.1.34 with 404 (1.74 ms)
2020-04-28T12:48:19 1c0ec421 [I] Started POST /dhcp/192.168.1.0
2020-04-28T12:48:19 1c0ec421 [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= >
2020-04-28T12:48:19 1c0ec421 [E] Failed to add DHCP reservation for delia-klette.example.de (192.168.1.34 / 00:0e:1e:7a:38:80): No response from DHCP server
2020-04-28T12:48:19 1c0ec421 [W] Failed to add DHCP reservation for delia-klette.example.de (192.168.1.34 / 00:0e:1e:7a:38:80): No response from DHCP server
Proxy::DHCP::Error: Failed to add DHCP reservation for delia-klette.example.de (192.168.1.34 / 00:0e:1e:7a:38:80): 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:98:in `block in <class:DhcpApi>'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1611:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1611:in `block in compile!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:975:in `block (3 levels) in route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:994:in `route_eval'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:975:in `block (2 levels) in route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1015:in `block in process_route'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1013:in `catch'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1013:in `process_route'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:973:in `block in route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:972:in `each'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:972:in `route!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1085:in `block in dispatch!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1067:in `block in invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1067:in `catch'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1067:in `invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1082:in `dispatch!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:907:in `block in call!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1067:in `block in invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1067:in `catch'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1067:in `invoke'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:907:in `call!'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:895:in `call'
/usr/lib/ruby/vendor_ruby/rack/methodoverride.rb:22:in `call'
/usr/share/foreman-proxy/lib/proxy/log.rb:103: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:18: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/nulllogger.rb:9:in `call'
/usr/lib/ruby/vendor_ruby/rack/head.rb:13:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/show_exceptions.rb:25:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:182:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:2013:in `call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1487:in `block in call'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1787:in `synchronize'
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:1487:in `call'
/usr/lib/ruby/vendor_ruby/rack/urlmap.rb:66:in `block in call'
/usr/lib/ruby/vendor_ruby/rack/urlmap.rb:50:in `each'
/usr/lib/ruby/vendor_ruby/rack/urlmap.rb:50:in `call'
/usr/lib/ruby/vendor_ruby/rack/builder.rb:153:in `call'
/usr/lib/ruby/vendor_ruby/rack/handler/webrick.rb:88:in `service'
/usr/lib/ruby/2.5.0/webrick/httpserver.rb:140:in `service'
/usr/lib/ruby/2.5.0/webrick/httpserver.rb:96:in `run'
/usr/lib/ruby/2.5.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'
2020-04-28T12:48:19 1c0ec421 [I] Finished POST /dhcp/192.168.1.0 with 400 (15.19 ms)

/etc/dhcp/dhcpd.conf

# READ: This file was written the foreman-installer and not by the Foreman
# application. Any updates to subnets in the Foreman database are not
# automatically reflected in this configuration and vice versa. Configuration
# updates like DNS servers or adding/removing subnets must be done both in
# Foreman application and in this configuration preferably via
# foreman-installer. Use custom-hiera.yaml for multiple subnets.
omapi-port 7911;
key omapi_key {
  algorithm HMAC-MD5;
  secret "<<secret>>";
}
omapi-key omapi_key;

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


not authoritative;


ddns-update-style none;

option domain-name "example.de";
option domain-name-servers 192.168.1.5 192.168.1.6;
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 192.168.1.17;
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";
# example.de
subnet 192.168.1.0 netmask 255.255.255.192 {

  option subnet-mask 255.255.255.192;
  option routers 192.168.1.1;
}

/etc/foreman-proxy/settings.d/dhcp_isc.yml

---
#
# Configuration file for ISC dhcp provider
#

:config: /etc/dhcp/dhcpd.conf
:leases: /var/lib/dhcp/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: <<secret>>


:omapi_port: 7911

# use :server setting in dhcp.yml if you are managing a dhcp server which is not localhost

option domain-name-servers 192.168.1.5 192.168.1.6; should have a comma between the IPs…