Puppet: System Administration Automated

Support

Ticket #1128 (new defect)

Opened 9 months ago

Last modified 7 months ago

interface errors on centos / redhat

Reported by: otto Assigned to: community
Priority: normal Milestone:
Component: interface Version: 0.24.2
Severity: normal Keywords: interface centos redhat
Cc: acotto@gmail.com Triage Stage: Accepted
Attached Patches: None Complexity: Unknown

Description

I'm trying to use the 'interface' type resource for setting up interface aliases. I'm using Puppet version 0.24.2, CentOS 5.

My interface declaration:

node "dev1" {
  interface { "192.168.10.229":
    interface_type => "alias",
    interface => "eth0",
    ensure => "present",
    netmask => "255.255.255.0",
  }
}

puppetd reports the following error:

err: Could not prefetch interface provider 'redhat': undefined method `bootproto=' for #<Puppet::Type::Interface::ProviderRedhat:0xb78cc8ac>
err: //Node[dev2]/Interface[10.0.1.201]: Failed to retrieve current state of resource: undefined method `[]' for #<Puppet::Type::Interface::ProviderRedhat:0xb7825638>

I removed the BOOTPROTO line from /etc/sysconfig/network-scripts/icfg-eth0, but then it complains about the HWADDR. If I take out HWADDR (which is probably is not a good idea), it complains about NETWORK. If I take out NETWORK, it complains about GATEWAY. If I take out GATEWAY, it complains about BROADCAST. Finally, I take out BROADCAST, and it complains about '[]'.

I've even tried removing both my ifcfg-eth0 and ifcfg-lo files to see what puppet does. I get no errors about

"Could not prefetch interface provider 'redhat'... "

but I still get the same

"Failed to retrieve current state of resource: undefined method `[]'..."

at the bottom of the output.

I see that there was a ticket submitted for what looks like a similar problem, but it was marked as fixed back in November 2007: http://reductivelabs.com/trac/puppet/ticket/762

Below is the puppet output and trace for when my ifcfg* files are in place, but with the mentioned properties commented out in ifcfg-eth0.

My current eth0 interface file (with lots of commenting out):

[root@dev1 network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Realtek Semiconductor Co., Ltd. RTL-8029(AS)
DEVICE=eth0
ONBOOT=yes
#HWADDR=00:1c:42:af:2b:83
IPADDR=192.168.10.228
NETMASK=255.255.255.0
#NETWORK=192.168.10.0
ONBOOT=yes
#GATEWAY=192.168.10.1
#BROADCAST=192.168.10.255

The output and stacktrace from puppetd --test:

[root@dev1 network-scripts]# puppetd --test --trace
notice: Ignoring cache
info: Caching catalog at /var/puppet/state/localconfig.yaml
notice: Starting catalog run
/usr/lib/ruby/site_ruby/1.8/puppet/provider/interface/redhat.rb:63:in `instances'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/interface/redhat.rb:59:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/interface/redhat.rb:59:in `instances'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/interface/redhat.rb:112:in `prefetch'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:492:in `prefetch'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:489:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:489:in `prefetch'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:504:in `prepare'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:301:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/node/catalog.rb:102:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:260:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:212:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:211:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:259:in `run'
/usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:241:in `run'
/usr/sbin/puppetd:429
err: Could not prefetch interface provider 'redhat': undefined method `[]' for #<Puppet::Type::Interface::ProviderRedhat:0xb79870a8>
info: /Schedule[weekly]: Evaluated in 0.00 seconds
info: /Schedule[puppet]: Evaluated in 0.00 seconds
/usr/lib/ruby/site_ruby/1.8/puppet/provider.rb:359:in `name'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/interface/redhat.rb:154:in `file_path'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/interface/redhat.rb:135:in `exists?'
/usr/lib/ruby/site_ruby/1.8/puppet/property.rb:517:in `retrieve'
/usr/lib/ruby/site_ruby/1.8/puppet/metatype/evaluation.rb:103:in `currentpropvalues'
/usr/lib/ruby/site_ruby/1.8/puppet/external/gratr/search.rb:325:in `inject'
/usr/lib/ruby/site_ruby/1.8/puppet/metatype/evaluation.rb:101:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/metatype/evaluation.rb:101:in `inject'
/usr/lib/ruby/site_ruby/1.8/puppet/metatype/evaluation.rb:101:in `currentpropvalues'
/usr/lib/ruby/site_ruby/1.8/puppet/metatype/evaluation.rb:94:in `retrieve'
/usr/lib/ruby/site_ruby/1.8/puppet/metatype/evaluation.rb:23:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:60:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:240:in `eval_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:444:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:443:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:239:in `eval_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:311:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:444:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:443:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:310:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:304:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:304:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/node/catalog.rb:102:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:260:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:212:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:211:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:259:in `run'
/usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:241:in `run'
/usr/sbin/puppetd:429
err: //Node[dev1]/Interface[192.168.10.229]: Failed to retrieve current state of resource: undefined method `[]' for #<Puppet::Type::Interface::ProviderRedhat:0xb797f1c8>
info: //Node[dev1]/Interface[192.168.10.229]: Evaluated in 0.01 seconds
info: /Schedule[monthly]: Evaluated in 0.00 seconds
info: /Schedule[hourly]: Evaluated in 0.00 seconds
info: /Schedule[never]: Evaluated in 0.00 seconds
info: /Schedule[daily]: Evaluated in 0.00 seconds
info: /Filebucket[puppet]: Evaluated in 0.00 seconds
Changes:
Resources:
          Failed: 1
       Scheduled: 8
           Total: 10
Time:
  Config retrieval: 0.84
      Filebucket: 0.00
       Interface: 0.01
        Schedule: 0.00
           Total: 0.85
info: Sent transaction report in 0.11 seconds
notice: Finished catalog run in 0.38 seconds

Change History

03/12/08 16:04:11 changed by otto

Edit: I accidentally copy-pasted the original error message from a different dev machine:

To avoid confusion, the error should read:

err: //Node[dev1]/Interface[192.168.10.229]: Failed to retrieve current state of resource: undefined method `[]' for #<Puppet::Type::Interface::ProviderRedhat:0xb7825638>

03/12/08 19:36:24 changed by luke

  • stage changed from Unreviewed to Accepted.

04/24/08 07:20:30 changed by luke

  • component changed from library to interface.