I upgrade our infrastructure (mostly RHEL5, some RHEL6) from 3.1 to puppet-3.2.1-1.el5. Ruby sits at ruby-1.8.7.370-1.el5. I ran some tests and everything seemed good so I pushed it out. Since then, all my puppet clients are failing with this: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `[]'' for nil:NilClass at /etc/puppet/modules/site/manifests/init.pp:7 on node maps-cs-vm-03u.streamsage.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run Googling shows that this is a common error that crops up for any number of reasons. I wonder what my reason is in this case. I use Cobbler as my ENC, so I have no node statements. Since I''m not using hiera yet, my site/init.pp looks like this: class site { if $::operatingsystem == "RedHat" { include puppet include ypbind include sudo if $::ipaddress =~ /^192\.168\./ { Class["puppet"] -> Class["ypbind"] -> Class["sudo"] } else { include snmp Class["puppet"] -> Class["snmp"] -> Class["ypbind"] -> Class["sudo"] } if $::hostname =~ /[dqcpu]$/ { include yum include java } # Fixes for mayhem caused by Dell & Puppet repos package {"dell-omsa-repository": ensure => absent } file {"/etc/yum.repos.d/dell-omsa-repository.repo": ensure => absent } file {"/etc/yum.repos.d/puppet-delete-me.repo": ensure => absent} notify {"ENV == ${environment}":} package { "koan": ensure => latest, } # artifact of setting the OOB IP in Cobbler file { "/etc/sysconfig/network-scripts/ifcfg-oob": ensure => absent; } } elsif $::operatingsystem == "Ubuntu" { notify {"Howdies! I am running Ubuntu!": } include ntp include puppet Class[''ntp''] -> Class[''puppet''] } } Line 7 is "include sudo". This is a modified version of saz-sudo-2.0.2. Any ideas? Thanks. -- \*..+.- --Greg Chavez +//..;}; -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Patrick Carlisle
2013-Jun-18 22:02 UTC
Re: [Puppet Users] undefined method `[]'' for nil:NilClass
To diagnose this you''ll want to get a full stack trace. Since the error is on the master you run the master with --trace and then find the stack trace in the log. On Tue, Jun 18, 2013 at 11:08 AM, Greg Chavez <greg.chavez@gmail.com> wrote:> I upgrade our infrastructure (mostly RHEL5, some RHEL6) from 3.1 to > puppet-3.2.1-1.el5. Ruby sits at ruby-1.8.7.370-1.el5. I ran some > tests and everything seemed good so I pushed it out. > > Since then, all my puppet clients are failing with this: > > Error: Could not retrieve catalog from remote server: Error 400 on > SERVER: undefined method `[]'' for nil:NilClass at > /etc/puppet/modules/site/manifests/init.pp:7 on node > maps-cs-vm-03u.streamsage.com > Warning: Not using cache on failed catalog > Error: Could not retrieve catalog; skipping run > > Googling shows that this is a common error that crops up for any > number of reasons. I wonder what my reason is in this case. I use > Cobbler as my ENC, so I have no node statements. Since I''m not using > hiera yet, my site/init.pp looks like this: > > class site { > > if $::operatingsystem == "RedHat" { > > include puppet > include ypbind > include sudo > > if $::ipaddress =~ /^192\.168\./ { > > Class["puppet"] -> Class["ypbind"] -> Class["sudo"] > > } else { > > include snmp > Class["puppet"] -> Class["snmp"] -> Class["ypbind"] -> > Class["sudo"] > > } > > if $::hostname =~ /[dqcpu]$/ { > include yum > include java > } > > # Fixes for mayhem caused by Dell & Puppet repos > package {"dell-omsa-repository": ensure => absent } > file {"/etc/yum.repos.d/dell-omsa-repository.repo": ensure => absent > } > file {"/etc/yum.repos.d/puppet-delete-me.repo": ensure => absent} > > > > notify {"ENV == ${environment}":} > > package { "koan": > ensure => latest, > } > > # artifact of setting the OOB IP in Cobbler > file { "/etc/sysconfig/network-scripts/ifcfg-oob": > ensure => absent; > } > > } elsif $::operatingsystem == "Ubuntu" { > > notify {"Howdies! I am running Ubuntu!": } > > include ntp > include puppet > > Class[''ntp''] -> Class[''puppet''] > > } > > } > > > Line 7 is "include sudo". This is a modified version of saz-sudo-2.0.2. > > Any ideas? Thanks. > -- > \*..+.- > --Greg Chavez > +//..;}; > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.