Unable to obtain IP address from DHCP server

Hello,

We just provisioned Katello 3.7 on CentOS 7.5, and are having issues obtaining an IP address from one particular network. Our DHCP server is a Microsoft DHCP server running the Katello Proxy Server v1.18.0.

We receive the following following error from Katello:
Failed to fetch a free IP from proxy dhcp01.example.com (http://dhcp01.example.com:8443): ERF12-8202 [ProxyAPI::ProxyException]: Unable to retrieve unused IP ([RestClient::BadRequest]: 400 Bad Request) for proxy http://dhcp01.example.com:8443/dhcp

The Katello Proxy server then spits out this error:

D, [2018-08-10T19:55:09.471068 42606010] DEBUG -- : #<Proxy::DHCP::Reservation:0x0000000003462be0 @type="reservation", @    name="kafka9.example.com", @subnet=#<Proxy::DHCP::Subnet:0x0000000003468298 @network="10.90.56.0", @netmask="255.255.255.0", @ipaddr=#<IPAddr: IPv4:10.90.56.0/255.255.255.0>, @options={}, @m=#<Monitor:0x0000000003462dc0 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x0000000003462ca8>>>, @ip="10.90.56.198", @mac="00:0a:f7:e4:26:dc", @options={:deleteable=>true, :hostname=>"kafka9.example.com"}>
D, [2018-08-10T19:55:09.471068 42606010] DEBUG -- : #<Proxy::DHCP::Reservation:0x000000000344a680 @type="reservation", @name="kafka10.example.com", @subnet=#<Proxy::DHCP::Subnet:0x000000000344b990 @network="10.90.56.0", @netmask="255.255.255.0", @ipaddr=#<IPAddr: IPv4:10.90.56.0/255.255.255.0>, @options={}, @m=#<Monitor:0x000000000344a7e8 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x000000000344a720>>>, @ip="10.90.56.199", @mac="00:0a:f7:e3:c7:18", @options={:deleteable=>true, :hostname=>"kafka10.example.com"}>
E, [2018-08-10T19:55:09.502316 42606010] ERROR -- : undefined local variable or method `opts' for ms dhcp server:Proxy::DHCP::NativeMS::Provider
D, [2018-08-10T19:55:09.502316 42606010] DEBUG -- : undefined local variable or method `opts' for ms dhcp server:Proxy::DHCP::NativeMS::Provider (NameError)
C:/smart-proxy-1.18.0/modules/dhcp_native_ms/dhcp_native_ms_main.rb:224:in `rescue in build_lease'
C:/smart-proxy-1.18.0/modules/dhcp_native_ms/dhcp_native_ms_main.rb:212:in `build_lease'
C:/smart-proxy-1.18.0/modules/dhcp_native_ms/dhcp_native_ms_main.rb:209:in `block in all_leases'
C:/smart-proxy-1.18.0/modules/dhcp_native_ms/dhcp_native_ms_main.rb:209:in `map'
C:/smart-proxy-1.18.0/modules/dhcp_native_ms/dhcp_native_ms_main.rb:209:in `all_leases'
C:/smart-proxy-1.18.0/modules/dhcp_native_ms/dhcp_native_ms_main.rb:109:in `unused_ip'
C:/smart-proxy-1.18.0/modules/dhcp/dhcp_api.rb:34:in `block in <class:DhcpApi>'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1635:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1635:in `block in compile!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:992:in `block (3 levels) in route!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1011:in `route_eval'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:992:in `block (2 levels) in route!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1040:in `block in process_route'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1038:in `catch'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1038:in `process_route'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:990:in `block in route!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:989:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:989:in `route!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1097:in `block in dispatch!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `block in invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `catch'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1094:in `dispatch!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:924:in `block in call!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `block in invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `catch'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:924:in `call!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:913:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.5/lib/rack/method_override.rb:22:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.5/lib/rack/common_logger.rb:33:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:231:in `call'
C:/smart-proxy-1.18.0/lib/proxy/log.rb:109:in `call'
C:/smart-proxy-1.18.0/lib/proxy/request_id_middleware.rb:9:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/xss_header.rb:18:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/path_traversal.rb:16:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/json_csrf.rb:26:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/base.rb:50:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/base.rb:50:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/frame_options.rb:31:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.5/lib/rack/null_logger.rb:9:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.5/lib/rack/head.rb:12:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/show_exceptions.rb:22:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:194:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1958:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1502:in `block in call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1729:in `synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1502:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in `block in call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.5/lib/rack/builder.rb:153:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.5/lib/rack/handler/webrick.rb:86:in `service'
C:/Ruby24-x64/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
C:/Ruby24-x64/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
C:/Ruby24-x64/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
I, [2018-08-10T19:55:09.517943 42606010]  INFO -- : 
10.90.4.100 - - [10/Aug/2018:19:55:09 +0000] "GET /dhcp/10.90.56.0/unused_ip?mac=00:50:56:aa:23:d6&from=10.90.56.31&to=10.90.56.200 HTTP/1.1" 400 92 0.2031
10.90.4.100 - - [10/Aug/2018:19:55:09 Coordinated Universal Time] "GET /dhcp/10.90.56.0/unused_ip?mac=00:50:56:aa:23:d6&from=10.90.56.31&to=10.90.56.200 HTTP/1.1" 400 92
- -> /dhcp/10.90.56.0/unused_ip?mac=00:50:56:aa:23:d6&from=10.90.56.31&to=10.90.56.200
D, [2018-08-10T19:55:09.533568 ] DEBUG -- : close: 10.90.4.100:38918

The interesting thing is that this only happens with the 10.90.56.x network. We have 15 other vlans, and this does not happen. Any idea on how I can rectify this?

Any help would be greatly appreciated. Thank you.

This is a bug introduced by DHCP module refactoring in rescue block, fix the two lines, restart and see the real cause of the error:

This fixed the issue. Thank you.