Problem:
When creating a new host, the remote foreman-proxy (Ubuntu 3.1.1-1) can’t create a DHCP lease in isc-dhcp-server (4.4.1-2.1ubuntu5.20.04.2) via omapi. If I look in /var/lib/dhcp/dhcpd.leases I can find the just (failed) created DHCP lease as expected.
The Foreman-proxy server was upgraded from 1.24 to 3.1 recently during distribution upgrades. The Foreman server itself can’t be upgraded at this time but will be upgraded in the near future.
Expected outcome:
Create DHCP lease in order to continue VM creation.
Foreman and Proxy versions:
Foreman server:
Foreman = 1.24.3-2
Foreman-proxy server:
Foreman Proxy = 3.1.1-1
isc-dhcp-server = 4.4.1-2.1ubuntu5.20.04.2
Foreman and Proxy plugin versions:
Foreman server: 1.24.3
Foreman proxy: 3.1.1 (proxy, DHCP, DNS, TFTP). Discovery at version 1.0.3.
Distribution and version:
Foreman server: Ubuntu 16.04.7
Foreman-proxy: Ubuntu 20.04.3
Other relevant data:
Foreman-proxy log during the creation of DHCP lease
2022-01-28T12:47:53 20e04c92 [I] Started GET /tftp/serverName
2022-01-28T12:47:53 20e04c92 [I] Finished GET /tftp/serverName with 200 (16.19 ms)
2022-01-28T12:47:53 20e04c92 [I] Started POST /dhcp/10.20.0.0
2022-01-28T12:47:53 20e04c92 [E] Omshell failed: omshell= > > > obj: <null>
omshell= > obj: host
omshell= > obj: host
omshell= name = "new_vm.domain.tld"
omshell= > obj: host
omshell= name = "new_vm.domain.tld"
omshell= ip-address = 0a:14:00:af
omshell= > obj: host
omshell= name = "new_vm.domain.tld"
omshell= ip-address = 0a:14:00:af
omshell= hardware-address = 00:50:56:81:b5:95
omshell= > obj: host
omshell= name = "new_vm.domain.tld"
omshell= ip-address = 0a:14:00:af
omshell= hardware-address = 00:50:56:81:b5:95
omshell= hardware-type = 1
omshell= > obj: host
omshell= name = "new_vm.domain.tld"
omshell= ip-address = 0a:14:00:af
omshell= hardware-address = 00:50:56:81:b5:95
omshell= hardware-type = 1
omshell= statements = "filename = "pxelinux.0"; next-server = 0a:14:00:22; option host-name = "new_vm.domain.tld";"
omshell= > can't open object: connection reset by peer
omshell= obj: host
omshell= name = "new_vm.domain.tld"
omshell= ip-address = 0a:14:00:af
omshell= hardware-address = 00:50:56:81:b5:95
omshell= hardware-type = 1
omshell= statements = "filename = "pxelinux.0"; next-server = 0a:14:00:22; option host-name = "new_vm.domain.tld";"
omshell= >
2022-01-28T12:47:53 20e04c92 [E] Failed to add DHCP reservation for new_vm.domain.tld (10.20.0.175 / 00:50:56:81:b5:95)
2022-01-28T12:47:53 20e04c92 [W] Error details for Failed to add DHCP reservation for new_vm.domain.tld (10.20.0.175 / 00:50:56:81:b5:95): <Proxy::DHCP::Error>: Failed to add DHCP reservation for new_vm.domain.tld (10.20.0.175 / 00:50:56:81:b5:95)
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:109:in `report'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:87:in `om_disconnect'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:60:in `om_add_record'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:36:in `add_record'
/usr/share/foreman-proxy/modules/dhcp/dhcp_api.rb:97: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'
2022-01-28T12:47:53 20e04c92 [W] Failed to add DHCP reservation for new_vm.domain.tld (10.20.0.175 / 00:50:56:81:b5:95): <Proxy::DHCP::Error>: Failed to add DHCP reservation for new_vm.domain.tld (10.20.0.175 / 00:50:56:81:b5:95)
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:109:in `report'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:87:in `om_disconnect'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:60:in `om_add_record'
/usr/share/foreman-proxy/modules/dhcp_common/isc/omapi_provider.rb:36:in `add_record'
/usr/share/foreman-proxy/modules/dhcp/dhcp_api.rb:97: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'
2022-01-28T12:47:53 20e04c92 [I] Finished POST /dhcp/10.20.0.0 with 400 (135.07 ms)