Puppet-master/foreman “undefined method `[]’ for nil:NilClass on node” after update

foremanpuppetpuppetmaster

After updating my puppet-master from 2.7 to 3.6.2 I get the following message when running puppet agent on a node:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `[]' for nil:NilClass on node fqdn

Unfortunately I can't provide anymore information. I the puppet-master debug log shows this:

Jul 11 17:53:40 handsoff puppet-master[6197]: Caching node for fqdn
Jul 11 17:53:40 handsoff puppet-master[6197]: undefined method `[]' for nil:NilClass on node fqdn
Jul 11 17:53:40 handsoff puppet-master[6197]: undefined method `[]' for nil:NilClass on node fqdn
Jul 11 17:53:40 handsoff puppet-master[6197]: undefined method `[]' for nil:NilClass on node fqdn

I'm running Puppet with foreman in these versions:

# dpkg -l | grep foreman
ii  foreman                            1.5.1-1                       amd64        Systems management web interface
ii  foreman-installer                  1.5.1-1                       all          Automated puppet-based installer for The Foreman
ii  foreman-postgresql                 1.5.1-1                       all          metapackage providing PostgreSQL dependencies for Foreman
ii  foreman-proxy                      1.5.1-1                       all          RESTful proxies for DNS, DHCP, TFTP, and Puppet
ii  ruby-foreman-api                   0.1.11-1                      all          Ruby bindings for Forman's rest API
ii  ruby-foreman-bootdisk              2.0.8                         all          Foreman Bootdisk Plugin
ii  ruby-foreman-setup                 2.0.4                         all          Foreman

# dpkg -l | grep puppet
ii  facter                             2.1.0-1puppetlabs1            amd64        Ruby module for collecting simple facts about a host operating system
ii  foreman-installer                  1.5.1-1                       all          Automated puppet-based installer for The Foreman
ii  hiera                              1.3.4-1puppetlabs1            all          A simple pluggable Hierarchical Database.
ii  puppet                             3.6.2-1puppetlabs1            all          Centralized configuration management - agent startup and compatibility scripts
ii  puppet-common                      3.6.2-1puppetlabs1            all          Centralized configuration management
ii  puppetdb                           2.1.0-1puppetlabs1            all          PuppetDB Centralized Storage.
ii  puppetdb-terminus                  2.1.0-1puppetlabs1            all          Connect Puppet to PuppetDB by setting up a terminus for PuppetDB.
ii  puppetlabs-release                 1.0-7                         all          "Package to install Puppet Labs gpg key and apt repo"
ii  puppetmaster                       3.6.2-1puppetlabs1            all          Centralized configuration management - master startup and compatibility scripts
ii  puppetmaster-common                3.6.2-1puppetlabs1            all          Puppet master common scripts
ii  ruby-kafo                          0.5.3-1                       all          If you write puppet modules for installing your software, you can use kafo to create powerful installer
ii  ruby-rgen                          0.6.5-1puppetlabs1            all          A framework supporting Model Driven Software Development (MDSD)

Any help is greatly appreciated. I'm all out of ideas here.

Best Answer

Between Puppet 2 and 3, config.ru (used by Passenger to run the Puppet master under Apache) needs updating as Puppet's initialisation changed.

See the release notes here for the diff: Puppet 3 release notes: Puppet Master Rack Configuration Is Changed

Foreman's installer sets this file up at /etc/puppet/rack/config.ru, but Debian users using puppetmaster-passenger may find it under /usr/share/puppet/rack/puppetmasterd/.

Foreman users should also note the change to sudoers required for Puppet CA integration: Upgrade Puppet from v2 to v3 gotchas.

Related Topic