Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-2011

Puppet 3.4.3 fails to run on OS X 10.9.2

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.4.2, PUP 3.4.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      OS X 10.9.2 and 10.7
      Puppet 3.4.3
      Facter 1.7.5
      Ruby 2.0.0p247

    • Template:

      Description

      Summary:
      Puppet 3.4.2 and 3.4.3 fails when running in the default root environment on Mac OS X 10.9.2. It fails with the same error when run as a Launch Daemon or manually in root's shell. Running in a user shell with sudo (thus preserving environment variables) or with the LANG environment (tested values are 'en_US.UTF-8', 'en_GB.UTF-8' and 'de_DE.UTF-8') set in the root shell resolves the issue.

      It also fails (differently) under the same circumstances on OS X 10.7, but only if the SSL private key isn't already present. Once a private key is present (created by running puppet in a shell with LANG present) it runs fine in a root environment without LANG set.

      10.9.2:
      Error: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: undefined method `each' for nil:NilClass

      10.7:
      Error: Could not request certificate: Could not write /etc/puppet/ssl/private_keys/10-7mac.home.pem to privatekeydir: Permission denied - /etc/puppet/ssl/private_keys/10-7mac.home.pem
      I'm not entirely sure it's related, but the same workaround resolves it. If you need a trace for 10.7 let me know.

      I haven't been able to confirm on a vanilla 10.9 machine yet.

      As a workaround I've added the environment variable to my Launch Daemon plist and to my bootstrap script.

      Steps to Reproduce:
      Install puppet 3.4.3 and Facter 1.7.5 on OS X 10.9.2.
      Open a root shell:
      sudo su -
      Run puppet
      Install Puppetlabs example Launch Daemon plist
      Load launchdaemon using launchctl
      Monitor console and error log

      Expected Results:
      Puppet runs without error in a vanilla root environment without modification to environment variables

      Actual Results:
      Puppet fails to run and only runs with modified environment variables

      Notes:
      Mac:~ root# puppet --version
      3.4.3

      Mac:~ root# facter --version
      1.7.5

      Mac:~ root# puppet agent --debug --trace --verbose
      Debug: Failed to load library 'selinux' for feature 'selinux'
      Debug: Using settings: adding file resource 'confdir': 'File[/etc/puppet]{:path=>"/etc/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
      Debug: Failed to load library 'shadow' for feature 'libshadow'
      Debug: Puppet::Type::User::ProviderUseradd: file useradd does not exist
      Debug: Failed to load library 'ldap' for feature 'ldap'
      Debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
      Debug: Puppet::Type::User::ProviderPw: file pw does not exist
      Debug: Puppet::Type::User::ProviderUser_role_add: file useradd does not exist
      Debug: /User[puppet]: Provider directoryservice does not support features libuser; not managing attribute forcelocal
      Debug: Executing '/usr/bin/dscl . read /Users/puppet'
      Debug: Puppet::Type::Group::ProviderGroupadd: file groupadd does not exist
      Debug: Failed to load library 'ldap' for feature 'ldap'
      Debug: Puppet::Type::Group::ProviderLdap: feature ldap is missing
      Debug: Puppet::Type::Group::ProviderPw: file pw does not exist
      Debug: /Group[puppet]: Provider directoryservice does not support features libuser; not managing attribute forcelocal
      Error: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: undefined method `each' for nil:NilClass
      /Library/Ruby/Site/facter/macosx.rb:39:in `<top (required)>'
      /Library/Ruby/Site/facter/util/loader.rb:95:in `load'
      /Library/Ruby/Site/facter/util/loader.rb:95:in `load_file'
      /Library/Ruby/Site/facter/util/loader.rb:46:in `block (2 levels) in load_all'
      /Library/Ruby/Site/facter/util/loader.rb:41:in `each'
      /Library/Ruby/Site/facter/util/loader.rb:41:in `block in load_all'
      /Library/Ruby/Site/facter/util/loader.rb:38:in `each'
      /Library/Ruby/Site/facter/util/loader.rb:38:in `load_all'
      /Library/Ruby/Site/facter/util/collection.rb:115:in `load_all'
      /Library/Ruby/Site/facter.rb:248:in `loadfacts'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:94:in `get_macosx_version_major'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:181:in `fail_if_wrong_version'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:193:in `get_exec_preamble'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:110:in `list_all_present'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:161:in `single_report'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:581:in `getinfo'
      /Library/Ruby/Site/puppet/provider/nameservice.rb:200:in `exists?'
      /Library/Ruby/Site/puppet/type/group.rb:185:in `exists?'
      /Library/Ruby/Site/puppet/settings.rb:765:in `service_group_available?'
      /Library/Ruby/Site/puppet/settings/file_setting.rb:52:in `safe_to_use_settings_value?'
      /Library/Ruby/Site/puppet/settings/file_setting.rb:43:in `value'
      /Library/Ruby/Site/puppet/settings/file_setting.rb:100:in `group'
      /Library/Ruby/Site/puppet/settings/file_setting.rb:155:in `to_resource'
      /Library/Ruby/Site/puppet/settings.rb:878:in `block in to_catalog'
      /Library/Ruby/Site/puppet/settings.rb:875:in `each'
      /Library/Ruby/Site/puppet/settings.rb:875:in `to_catalog'
      /Library/Ruby/Site/puppet/settings.rb:936:in `use'
      /Library/Ruby/Site/puppet/application/agent.rb:403:in `setup'
      /Library/Ruby/Site/puppet/application.rb:362:in `block (2 levels) in run'
      /Library/Ruby/Site/puppet/application.rb:470:in `plugin_hook'
      /Library/Ruby/Site/puppet/application.rb:362:in `block in run'
      /Library/Ruby/Site/puppet/util.rb:478:in `exit_on_fail'
      /Library/Ruby/Site/puppet/application.rb:362:in `run'
      /Library/Ruby/Site/puppet/util/command_line.rb:137:in `run'
      /Library/Ruby/Site/puppet/util/command_line.rb:91:in `execute'
      /usr/bin/puppet:4:in `<main>'
      Error: Could not prepare for execution: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: undefined method `each' for nil:NilClass
      undefined method `each' for nil:NilClass
      /Library/Ruby/Site/facter/macosx.rb:39:in `<top (required)>'
      /Library/Ruby/Site/facter/util/loader.rb:95:in `load'
      /Library/Ruby/Site/facter/util/loader.rb:95:in `load_file'
      /Library/Ruby/Site/facter/util/loader.rb:46:in `block (2 levels) in load_all'
      /Library/Ruby/Site/facter/util/loader.rb:41:in `each'
      /Library/Ruby/Site/facter/util/loader.rb:41:in `block in load_all'
      /Library/Ruby/Site/facter/util/loader.rb:38:in `each'
      /Library/Ruby/Site/facter/util/loader.rb:38:in `load_all'
      /Library/Ruby/Site/facter/util/collection.rb:115:in `load_all'
      /Library/Ruby/Site/facter.rb:248:in `loadfacts'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:94:in `get_macosx_version_major'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:181:in `fail_if_wrong_version'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:193:in `get_exec_preamble'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:110:in `list_all_present'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:161:in `single_report'
      /Library/Ruby/Site/puppet/provider/nameservice/directoryservice.rb:581:in `getinfo'
      /Library/Ruby/Site/puppet/provider/nameservice.rb:200:in `exists?'
      /Library/Ruby/Site/puppet/type/group.rb:185:in `exists?'
      /Library/Ruby/Site/puppet/settings.rb:765:in `service_group_available?'
      /Library/Ruby/Site/puppet/settings/file_setting.rb:52:in `safe_to_use_settings_value?'
      /Library/Ruby/Site/puppet/settings/file_setting.rb:43:in `value'
      /Library/Ruby/Site/puppet/settings/file_setting.rb:100:in `group'
      /Library/Ruby/Site/puppet/settings/file_setting.rb:155:in `to_resource'
      /Library/Ruby/Site/puppet/settings.rb:878:in `block in to_catalog'
      /Library/Ruby/Site/puppet/settings.rb:875:in `each'
      /Library/Ruby/Site/puppet/settings.rb:875:in `to_catalog'
      /Library/Ruby/Site/puppet/settings.rb:936:in `use'
      /Library/Ruby/Site/puppet/application/agent.rb:403:in `setup'
      /Library/Ruby/Site/puppet/application.rb:362:in `block (2 levels) in run'
      /Library/Ruby/Site/puppet/application.rb:470:in `plugin_hook'
      /Library/Ruby/Site/puppet/application.rb:362:in `block in run'
      /Library/Ruby/Site/puppet/util.rb:478:in `exit_on_fail'
      /Library/Ruby/Site/puppet/application.rb:362:in `run'
      /Library/Ruby/Site/puppet/util/command_line.rb:137:in `run'
      /Library/Ruby/Site/puppet/util/command_line.rb:91:in `execute'
      /usr/bin/puppet:4:in `<main>'

      Mac:~ root# cat /etc/puppet/puppet.conf
      [main]
      logdir=/var/log/puppet
      vardir=/var/lib/puppet
      ssldir=/var/lib/puppet/ssl
      #rundir=/var/run/puppet
      factpath=$vardir/lib/facter
      templatedir=$confdir/templates

      [master]

      1. These are needed when the puppetmaster is run by passenger
      2. and can safely be removed if webrick is used.
        ssl_client_header = SSL_CLIENT_S_DN
        ssl_client_verify_header = SSL_CLIENT_VERIFY

      [agent]
      report=true
      pluginsync=true%

      Mac:~ root# env
      TERM=xterm-256color
      SHELL=/bin/sh
      USER=root
      PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
      PWD=/var/root
      SHLVL=1
      HOME=/var/root
      _=/usr/bin/env

      Mac:~ root# sw_vers
      ProductName: Mac OS X
      ProductVersion: 10.9.2
      BuildVersion: 13C64

      Mac:~ root# ruby --version
      ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

      Mac:~ root# ls -lah /usr/lib/ruby/
      total 8
      drwxr-xr-x 6 root wheel 204B Mar 5 18:07 .
      drwxr-xr-x 7 root wheel 238B Mar 5 18:07 ..
      drwxr-xr-x 113 root wheel 3.8K Aug 24 2013 2.0.0
      drwxr-xr-x 3 root wheel 102B Aug 24 2013 gems
      lrwxr-xr-x 1 root wheel 44B Mar 5 18:06 site_ruby -> ../../../../../../../../../Library/Ruby/Site
      drwxr-xr-x 3 root wheel 102B Aug 24 2013 vendor_ruby

      Mac:~ root# cat /Library/LaunchDaemons/com.puppetlabs.puppet.plist
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
      <plist version="1.0">
      <dict>
      <key>EnvironmentVariables</key>
      <dict>
      <key>PATH</key>
      <string>/sbin:/usr/sbin:/bin:/usr/bin</string>
      <key>RUBYLIB</key>
      <string>/usr/lib/ruby/site_ruby/1.8/</string>
      </dict>
      <key>Label</key>
      <string>com.puppetlabs.puppet</string>
      <key>OnDemand</key>
      <false/>
      <key>ProgramArguments</key>
      <array>
      <string>/usr/bin/puppet</string>
      <string>agent</string>
      <string>--verbose</string>
      <string>--no-daemonize</string>
      <string>--logdest</string>
      <string>console</string>
      </array>
      <key>RunAtLoad</key>
      <true/>
      <key>ServiceDescription</key>
      <string>Puppet Daemon</string>
      <key>ServiceIPC</key>
      <false/>
      <key>StandardErrorPath</key>
      <string>/var/log/puppet/puppet.err</string>
      <key>StandardOutPath</key>
      <string>/var/log/puppet/puppet.out</string>
      </dict>
      </plist>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              khoury Khoury Brazil
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support