Project

General

Profile

Actions

Bug #21237

open

MS DHCP exclusion range not supported

Added by Anthony Chevalet over 6 years ago. Updated over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
DHCP
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

On MS DHCP WS2012 the smart proxy does not give an IP address when full range is excluded, ex:

Adress range for distribution: 192.168.1.10-192.168.1.250
Range excluded from distribution: 192.168.1.10-192.168.1.250

It timed out with this error:

E, [2017-10-07T22:51:24.773402 ] ERROR -- : undefined method `find_subnet' for nil:NilClass
D, [2017-10-07T22:51:24.773402 ] DEBUG -- : undefined method `find_subnet' for nil:NilClass (NoMethodError)
c:/smart-proxy/modules/dhcp_common/server.rb:40:in `get_subnet'
c:/smart-proxy/modules/dhcp_common/server.rb:87:in `unused_ip'
c:/smart-proxy/modules/dhcp/dhcp_api.rb:34:in `block in <class:DhcpApi>'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1632:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1632:in `block in compile!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:991:in `block (3 levels) in route!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1010:in `route_eval'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:991:in `block (2 levels) in route!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1037:in `block in process_route'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1035:in `catch'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1035:in `process_route'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:989:in `block in route!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:988:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:988:in `route!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1094:in `block in dispatch!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `block in invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `catch'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1091:in `dispatch!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:923:in `block in call!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `block in invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `catch'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:923:in `call!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:913:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/method_override.rb:22:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:231:in `call'
c:/smart-proxy/lib/proxy/log.rb:109:in `call'
c:/smart-proxy/lib/proxy/request_id_middleware.rb:9:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/xss_header.rb:18:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/path_traversal.rb:16:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/json_csrf.rb:26:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/base.rb:50:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/base.rb:50:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/frame_options.rb:31:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/null_logger.rb:9:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/head.rb:12:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/show_exceptions.rb:22:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:194:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1955:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1499:in `block in call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1726:in `synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1499:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/urlmap.rb:68:in `block in call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/urlmap.rb:53:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/urlmap.rb:53:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:153:in `call'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rack-2.0.3/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:290:in `block in start_thread'


Files

snap_20171008_021429.png View snap_20171008_021429.png 3.97 KB Anthony Chevalet, 10/07/2017 08:16 PM
Actions #1

Updated by Anonymous over 6 years ago

It appears dhcp module isn't using ms dhcp provider. Could you check if there are any dhcp module-related errors on proxy startup (please enable debug-level logging if you haven't done so already). If so, could you post the log here?

Actions #2

Updated by Anthony Chevalet over 6 years ago

It seems to be correctly loaded on startup:

W, [2017-10-07T23:42:33.880426 ]  WARN -- : Couldn't find settings file c:/smart-proxy/config/settings.d/facts.yml. Using default settings.
D, [2017-10-07T23:42:33.904423 ] DEBUG -- : 'dns' settings: 'dns_ttl': 86400 (default), 'enabled': true, 'use_provider': dns_dnscmd
W, [2017-10-07T23:42:33.904423 ]  WARN -- : Couldn't find settings file c:/smart-proxy/config/settings.d/templates.yml. Using default settings.
W, [2017-10-07T23:42:33.905428 ]  WARN -- : Couldn't find settings file c:/smart-proxy/config/settings.d/tftp.yml. Using default settings.
D, [2017-10-07T23:42:33.924426 ] DEBUG -- : 'dhcp' settings: 'enabled': true, 'server': localhost, 'subnets': ["10.3.28.0/255.255.255.0"], 'use_provider': dhcp_native_ms
W, [2017-10-07T23:42:33.925428 ]  WARN -- : Couldn't find settings file c:/smart-proxy/config/settings.d/puppetca.yml. Using default settings.
W, [2017-10-07T23:42:33.925428 ]  WARN -- : Couldn't find settings file c:/smart-proxy/config/settings.d/puppet.yml. Using default settings.
W, [2017-10-07T23:42:33.925428 ]  WARN -- : Couldn't find settings file c:/smart-proxy/config/settings.d/bmc.yml. Using default settings.
W, [2017-10-07T23:42:33.926428 ]  WARN -- : Couldn't find settings file c:/smart-proxy/config/settings.d/realm.yml. Using default settings.
D, [2017-10-07T23:42:33.927429 ] DEBUG -- : 'logs' settings: 'enabled': true (default)
D, [2017-10-07T23:42:33.928428 ] DEBUG -- : Providers ['dns_dnscmd'] are going to be configured for 'dns'
D, [2017-10-07T23:42:33.928428 ] DEBUG -- : Providers ['dhcp_native_ms'] are going to be configured for 'dhcp'
D, [2017-10-07T23:42:33.932429 ] DEBUG -- : 'dns_dnscmd' settings: 'dns_server': localhost (default), 'dns_ttl': 86400, 'use_provider': dns_dnscmd
D, [2017-10-07T23:42:34.040444 ] DEBUG -- : 'dhcp_native_ms' settings: 'disable_ddns': true (default), 'server': localhost, 'subnets': ["10.3.28.0/255.255.255.0"], 'use_provider': dhcp_native_ms
I, [2017-10-07T23:42:34.041444 ]  INFO -- : Successfully initialized 'foreman_proxy'
I, [2017-10-07T23:42:34.041444 ]  INFO -- : Successfully initialized 'dns_dnscmd'
I, [2017-10-07T23:42:34.042443 ]  INFO -- : Successfully initialized 'dns'
I, [2017-10-07T23:42:34.042443 ]  INFO -- : Successfully initialized 'dhcp_native_ms'
I, [2017-10-07T23:42:34.042443 ]  INFO -- : Successfully initialized 'dhcp'
D, [2017-10-07T23:42:34.042443 ] DEBUG -- : Log buffer API initialized, available capacity: 2000/1000
I, [2017-10-07T23:42:34.042443 ]  INFO -- : Successfully initialized 'logs'

ps: It works if I remove the exclusion range

Actions #3

Updated by Anonymous over 6 years ago

I'm not sure what's going on: whether range is used or not, the call is exactly the same, so both calls (with or without range parameters) should either work, or they both should fail. The original stacktrace shows that the code from the base implementation of a dhcp provider is being called, which will always fail for ms dhcp. In this light could you:

- try requesting unused_ip with different range parameters, and
- mix these requests with ones without any parameters (without restarting the proxy)

If you continue to see the same behaviour, could you re-download smart-proxy sources, and then try again?
If the problem still persists, could you reinstall ruby or perhaps try a different version of it?

Actions #4

Updated by Anthony Chevalet over 6 years ago

It's not about the DHCP range configured in Foreman, but the exclusion range configured on the MS DHCP, see attached.

Actions #5

Updated by Anonymous over 6 years ago

The gist of my comment above is that I think there are issues with your environment that are causing the problem you are seeing. Either the smart-proxy source is corrupted/modified, or the ruby vm is corrupted. Please try re-installing smart-proxy and/or ruby vm.

Actions #6

Updated by Anthony Chevalet over 6 years ago

I've re-installed smart-proxy and ruby and the issue is still there.

Actions #7

Updated by Anonymous over 6 years ago

Actually get_free_ip_address (or ms api) does not return IPs part of an exclusion range, that's probably why it fails when the full range is excluded.

Actions

Also available in: Atom PDF