1

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.

Kai
  • 315
  • 1
  • 4
  • 14
  • Is the logging on the puppet master process cranked up to `--debug`? – Shane Madden Jul 11 '14 at 16:12
  • yes, but all the other output isn't relevant to this error. I can paste it if you think it might help though. – Kai Jul 11 '14 at 17:06
  • 2
    Have you restarted apache2 since upgrading? Also see http://projects.theforeman.org/projects/foreman/wiki/FAQ#Upgrade-puppet-from-v2-to-v3-gotchas, especially the note about config.ru as that can cause strange issues if not changed. – Dominic Cleal Jul 11 '14 at 17:36
  • 1
    You could try adding `--trace` to the puppet master too so you get a full strack trace - this might point to the area causing it. – Dominic Cleal Jul 11 '14 at 17:37
  • m0dlx: hero of the day you are :) Fixed the config.ru and now all is good. If you post this as an answer I will accept it. – Kai Jul 11 '14 at 19:18
  • Great, I'm glad it worked! – Dominic Cleal Jul 12 '14 at 11:26

1 Answers1

3

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.

Dominic Cleal
  • 3,160
  • 19
  • 16