Bug #15240
closedCouldn't enable plugin dhcp: Parameter 'subnets' is expected to have a non-empty value
Description
Hi,
after upgrading my smart proxy nodes to 1.11.2 and theforeman-foreman_proxy to 2.5.0 I can't use DHCP any more. I'm getting an error on the SP nodes that subnets can't be a non-empty array but I can't really set this parameter via the module. As far as I can see this parameter is introduced in the master branch of the Puppet module.
proxy.log
E, [2016-05-31T12:46:39.160714 #23759] ERROR -- : Couldn't enable plugin dhcp: Parameter 'subnets' is expected to have a non-empty value E, [2016-05-31T12:47:58.615590 #23904] ERROR -- : Couldn't enable plugin dhcp: Parameter 'subnets' is expected to have a non-empty value
dhcp.yaml
--- # Enable DHCP management # Can be true, false, or http/https to enable just one of the protocols :enabled: https # valid providers: # - dhcp_isc (ISC dhcp server) # - dhcp_native_ms (Microsoft native implementation) # - dhcp_virsh (simple implementation for libvirt) :use_provider: dhcp_isc :server: 127.0.0.1 # subnets restricts the subnets queried to a subset, to reduce the query time. #:subnets: [192.168.205.0/255.255.255.128, 192.168.205.128/255.255.255.128]
Updated by Dominic Cleal over 8 years ago
- Category set to DHCP
- Translation missing: en.field_release set to 159
Do you have DEBUG level logs from the smart proxy? It'd be useful to see precisely what it's logging about the settings set.
Updated by Dominic Cleal over 8 years ago
- Subject changed from foreman_proxy Puppet module ver. 2.5.0 not compatible with smart_proxy 1.11.2 to Couldn't enable plugin dhcp: Parameter 'subnets' is expected to have a non-empty value
Updated by Dominic Cleal over 8 years ago
- Related to Bug #15143: DHCP :subnet: parameter no longer optional added
Updated by Dominic Cleal over 8 years ago
- Related to Bug #14952: dhcp_isc not respecting the :subnets: settings anymore added
Updated by Martin Dobrev over 8 years ago
Dominic Cleal wrote:
Do you have DEBUG level logs from the smart proxy? It'd be useful to see precisely what it's logging about the settings set.
cat proxy.log I, [2016-05-31T13:41:17.382929 #30819] INFO -- : 'discovery' settings were initialized with default values: :node_port: 8443, :node_scheme: https I, [2016-05-31T13:41:17.386399 #30819] INFO -- : Finished initialization of module 'discovery' I, [2016-05-31T13:41:17.386633 #30819] INFO -- : 'foreman_proxy' settings were initialized with default values: :enabled: true I, [2016-05-31T13:41:17.390027 #30819] INFO -- : Finished initialization of module 'foreman_proxy' I, [2016-05-31T13:41:17.390715 #30819] INFO -- : 'dns_nsupdate' settings were initialized with default values: :enabled: false I, [2016-05-31T13:41:17.397689 #30819] INFO -- : Finished initialization of module 'dns_nsupdate' I, [2016-05-31T13:41:17.400295 #30819] INFO -- : Finished initialization of module 'dns' I, [2016-05-31T13:41:17.402767 #30819] INFO -- : Finished initialization of module 'templates' I, [2016-05-31T13:41:17.405031 #30819] INFO -- : Finished initialization of module 'tftp' I, [2016-05-31T13:41:17.405638 #30819] INFO -- : 'dhcp_isc' settings were initialized with default values: :enabled: false I, [2016-05-31T13:41:17.414037 #30819] INFO -- : Finished initialization of module 'dhcp_isc' I, [2016-05-31T13:41:17.414259 #30819] INFO -- : 'dhcp' settings were initialized with default values: :subnets: E, [2016-05-31T13:41:17.414459 #30819] ERROR -- : Couldn't enable plugin dhcp: Parameter 'subnets' is expected to have a non-empty value D, [2016-05-31T13:41:17.414507 #30819] DEBUG -- : ["/usr/share/foreman-proxy/lib/proxy/plugin_validators.rb:27:in `validate!'", "/usr/share/foreman-proxy/lib/proxy/pluggable.rb:43:in `execute_validators'", "/usr/share/foreman-proxy/lib/proxy/pluggable.rb:43:in `each'", "/usr/share/foreman-proxy/lib/proxy/pluggable.rb:43:in `execute_validators'", "/usr/share/foreman-proxy/lib/proxy/pluggable.rb:38:in `validate!'", "/usr/share/foreman-proxy/lib/proxy/plugin.rb:132:in `validate!'", "/usr/share/foreman-proxy/lib/proxy/plugin.rb:150:in `configure_plugin'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:31:in `configure_plugins'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:29:in `each'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:29:in `configure_plugins'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:5:in `initialize_plugins'", "/usr/share/foreman-proxy/lib/launcher.rb:114:in `configure_plugins'", "/usr/share/foreman-proxy/lib/launcher.rb:124:in `launch'", "/usr/share/foreman-proxy/bin/smart-proxy:6"] D, [2016-05-31T13:41:17.416828 #30819] DEBUG -- : Log buffer API initialized, available capacity: 2000/1000 I, [2016-05-31T13:41:17.416942 #30819] INFO -- : Finished initialization of module 'logs' I, [2016-05-31T13:41:17.549088 #30821] INFO -- : WEBrick 1.3.1 I, [2016-05-31T13:41:17.549694 #30821] INFO -- : WEBrick 1.3.1 I, [2016-05-31T13:41:17.550189 #30821] INFO -- : ruby 1.8.7 (2013-06-27) [x86_64-linux] I, [2016-05-31T13:41:17.550389 #30821] INFO -- : ruby 1.8.7 (2013-06-27) [x86_64-linux] D, [2016-05-31T13:41:17.554123 #30821] DEBUG -- : TCPServer.new(0.0.0.0, 8443) D, [2016-05-31T13:41:17.555387 #30821] DEBUG -- : TCPServer.new(0.0.0.0, 8080) D, [2016-05-31T13:41:17.555750 #30821] DEBUG -- : TCPServer.new(::, 8443) D, [2016-05-31T13:41:17.555875 #30821] DEBUG -- : TCPServer.new(::, 8080) W, [2016-05-31T13:41:17.556146 #30821] WARN -- : TCPServer Error: Address already in use - bind(2) W, [2016-05-31T13:41:17.556300 #30821] WARN -- : TCPServer Error: Address already in use - bind(2) I, [2016-05-31T13:41:17.557972 #30821] INFO -- : Certificate: <removed> D, [2016-05-31T13:41:17.560786 #30821] DEBUG -- : Rack::Handler::WEBrick is mounted on /. D, [2016-05-31T13:41:17.561279 #30821] DEBUG -- : Rack::Handler::WEBrick is mounted on /. I, [2016-05-31T13:41:17.561548 #30821] INFO -- : WEBrick::HTTPServer#start: pid=30821 port=8080 I, [2016-05-31T13:41:17.561677 #30821] INFO -- : WEBrick::HTTPServer#start: pid=30821 port=8443
Updated by Dominic Cleal over 8 years ago
Thanks, that's very useful. There's a difference here which is interesting:
I, [2016-05-31T13:41:17.414259 #30819] INFO -- : 'dhcp' settings were initialized with default values: :subnets:
My test at http://projects.theforeman.org/issues/15143#note-2 logged this instead:
I, [2016-05-24T13:05:59.136996 #23459] INFO -- : 'dhcp' settings were initialized with default values: :subnets: []
and hence worked. My only guess might be a difference in Ruby versions or monkey patches (e.g. Puppet's) affecting behaviour.
Updated by Anonymous over 8 years ago
It seems that the issue affects/can only be replicated on ruby 1.8.7.
Updated by Martin Dobrev over 8 years ago
Dmitri Dolguikh wrote:
It seems that the issue affects/can only be replicated on ruby 1.8.7.
Indeed I see this problem only with CentOS 6.x nodes, Ruby is 1.8.7
Updated by The Foreman Bot over 8 years ago
- Status changed from New to Ready For Testing
- Assignee set to Anonymous
- Pull request https://github.com/theforeman/smart-proxy/pull/423 added
Updated by The Foreman Bot over 8 years ago
- Pull request https://github.com/theforeman/smart-proxy/pull/424 added
Updated by Josh Gray over 8 years ago
I am seeing this too on CentOS 6.7 with Ruby 1.8.7
I found a workaround is adding this:
:subnets: [192.168.1.0/255.255.255.0]
to:
/etc/foreman-proxy/settings.d/dhcp.yml
And restarting the smart proxy service. DHCP is then discovered as a smart proxy feature.
Updated by Anonymous over 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 222cf1783487b9f2cd232c9cdad90ac679396c1c.