Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to create dummy0 device on RHEL6 #115

Closed
robbat2 opened this issue Jul 19, 2015 · 9 comments
Closed

Failing to create dummy0 device on RHEL6 #115

robbat2 opened this issue Jul 19, 2015 · 9 comments

Comments

@robbat2
Copy link
Contributor

robbat2 commented Jul 19, 2015

# modprobe dummy && puppet resource network_config dummy0 ensure=present \
  family=inet method=manual onboot=true ipaddress=127.0.0.2 \
  netmask=255.255.255.255 --debug

Debug: Runtime environment: ruby_version=1.8.7, puppet_version=3.8.1, run_mode=user
Debug: Loaded state in 0.04 seconds
Debug: Prefetching redhat resources for network_config
Notice: /Network_config[dummy0]/method: method changed 'static' to 'manual'
Notice: /Network_config[dummy0]/hotplug: defined 'hotplug' as 'true'
Error: /Network_config[dummy0]: Could not evaluate: undefined method `[]=' for :absent:Symbol
Debug: Finishing transaction 70145286721440
Debug: Storing state
Debug: Stored state in 0.17 seconds
network_config { 'dummy0':
  ensure    => 'present',
  family    => 'inet',
  hotplug   => 'true',
  ipaddress => '127.0.0.2',
  method    => 'manual',
  mode      => 'raw',
  netmask   => '255.255.255.255',
  onboot    => 'true',
}
@igalic
Copy link
Contributor

igalic commented Aug 7, 2015

Error: /Network_config[dummy0]: Could not evaluate: undefined method `[]=' for :absent:Symbol

interesting.

@BabisK
Copy link

BabisK commented Nov 30, 2015

Same happens to me on CentOS 7. This happens to some interface for no particular reason while it works for other interfaces with the same configuration.

It has happened both on "physical" interfaces (eth2) and on bridge interfaces.

@igalic
Copy link
Contributor

igalic commented Dec 2, 2015

spooky 👻

:(

@rski
Copy link
Member

rski commented Mar 9, 2016

Here is a stack trace for the problem:

  network_config { 'eth1':
    ensure      => present,
    family      => 'inet',
    ipaddress   => 'xxx.xxx.xxx.xxx',                                                                                                                                                                             
    method      => 'static',
    netmask     => '255.255.255.0',
    onboot      => true,
    reconfigure => true,
  }
Error: /Network_config[eth1]: Could not evaluate: undefined method `[]=' for :absent:Symbol
/var/lib/puppet/lib/puppet/provider/network_config/redhat.rb:188:in `block in format_file'
/var/lib/puppet/lib/puppet/provider/network_config/redhat.rb:186:in `each'
/var/lib/puppet/lib/puppet/provider/network_config/redhat.rb:186:in `format_file'
/var/lib/puppet/lib/puppetx/filemapper.rb:272:in `flush_file'
/var/lib/puppet/lib/puppetx/filemapper.rb:49:in `flush'
/usr/share/ruby/vendor_ruby/puppet/type.rb:990:in `flush'
/usr/share/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:24:in `evaluate'
/usr/share/ruby/vendor_ruby/puppet/transaction.rb:204:in `apply'
/usr/share/ruby/vendor_ruby/puppet/transaction.rb:217:in `eval_resource'
/usr/share/ruby/vendor_ruby/puppet/transaction.rb:147:in `call'
/usr/share/ruby/vendor_ruby/puppet/transaction.rb:147:in `block (2 levels) in evaluate'
/usr/share/ruby/vendor_ruby/puppet/util.rb:335:in `block in thinmark'
/usr/share/ruby/benchmark.rb:296:in `realtime'
/usr/share/ruby/vendor_ruby/puppet/util.rb:334:in `thinmark'
/usr/share/ruby/vendor_ruby/puppet/transaction.rb:147:in `block in evaluate'
/usr/share/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
/usr/share/ruby/vendor_ruby/puppet/transaction.rb:138:in `evaluate'
/usr/share/ruby/vendor_ruby/puppet/resource/catalog.rb:169:in `block in apply'
/usr/share/ruby/vendor_ruby/puppet/util/log.rb:149:in `with_destination'
/usr/share/ruby/vendor_ruby/puppet/transaction/report.rb:112:in `as_logging_destination'
/usr/share/ruby/vendor_ruby/puppet/resource/catalog.rb:168:in `apply'
/usr/share/ruby/vendor_ruby/puppet/configurer.rb:120:in `block in apply_catalog'
/usr/share/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
/usr/share/ruby/benchmark.rb:296:in `realtime'
/usr/share/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
/usr/share/ruby/vendor_ruby/puppet/configurer.rb:119:in `apply_catalog'
/usr/share/ruby/vendor_ruby/puppet/configurer.rb:227:in `run_internal'
/usr/share/ruby/vendor_ruby/puppet/configurer.rb:134:in `block in run'
/usr/share/ruby/vendor_ruby/puppet/context.rb:64:in `override'
/usr/share/ruby/vendor_ruby/puppet.rb:246:in `override'
/usr/share/ruby/vendor_ruby/puppet/configurer.rb:133:in `run'
/usr/share/ruby/vendor_ruby/puppet/agent.rb:47:in `block (4 levels) in run'
/usr/share/ruby/vendor_ruby/puppet/agent/locker.rb:20:in `lock'
/usr/share/ruby/vendor_ruby/puppet/agent.rb:47:in `block (3 levels) in run'
/usr/share/ruby/vendor_ruby/puppet/agent.rb:117:in `with_client'
/usr/share/ruby/vendor_ruby/puppet/agent.rb:44:in `block (2 levels) in run'
/usr/share/ruby/vendor_ruby/puppet/agent.rb:82:in `run_in_fork'
/usr/share/ruby/vendor_ruby/puppet/agent.rb:43:in `block in run'
/usr/share/ruby/vendor_ruby/puppet/application.rb:179:in `call'
/usr/share/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
/usr/share/ruby/vendor_ruby/puppet/agent.rb:41:in `run'
/usr/share/ruby/vendor_ruby/puppet/application/agent.rb:361:in `onetime'
/usr/share/ruby/vendor_ruby/puppet/application/agent.rb:327:in `run_command'
/usr/share/ruby/vendor_ruby/puppet/application.rb:381:in `block (2 levels) in run'
/usr/share/ruby/vendor_ruby/puppet/application.rb:507:in `plugin_hook'
/usr/share/ruby/vendor_ruby/puppet/application.rb:381:in `block in run'
/usr/share/ruby/vendor_ruby/puppet/util.rb:496:in `exit_on_fail'
/usr/share/ruby/vendor_ruby/puppet/application.rb:381:in `run'
/usr/share/ruby/vendor_ruby/puppet/util/command_line.rb:146:in `run'
/usr/share/ruby/vendor_ruby/puppet/util/command_line.rb:92:in `execute'
/usr/bin/puppet:8:in `<main>'

I'll look into the issue myself now, but I'm posting this here too in case it helps anyone else

@rski
Copy link
Member

rski commented Mar 10, 2016

Found a workaround. It basically crashes because it tries to do stuff with provider.options, which if you don't pass to the resource explicitly defaults to :absent. The workaround is to just pass an empty hash there when defining the resource:

network_config { 'eth1':
  ensure      => present,
  family      => 'inet',
  ipaddress   => '127.0.0.2',
  method      => 'static',
  netmask     => '255.255.255.0',
  onboot      => true,
  reconfigure => true,
  options     => {},
}

Hopefully I'll submit a pr to fix that today.

The funny thing is, if you apply the worked-around version and then the one without the hash, it won't break. This probably means that this bug only exists for interfaces that have no configuration.

@rski
Copy link
Member

rski commented Mar 11, 2016

@robbat2 ping
Is it working for you with the current master? It should be fixed now and this issue should be closed

@jyaworski
Copy link
Member

Closing due to fix. If it's not fixed, please comment.

@robbat2
Copy link
Contributor Author

robbat2 commented Mar 11, 2016

I don't have an environment to test this on anymore (it was in a previous job)

@jyaworski
Copy link
Member

@robbat2 no problem. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants