Puppet agent fails with "Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: undefined method `exists?' for nil:NilClass"
Environment
- Red Hat Satellite v.6.5
- Red Hat Satellite v.6.4
- Red Hat Satellite v.6.3.x
Issue
- Puppet agent fails with below error, on client registered to Satellite 6.x.
Error: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: undefined method `exists?' for nil:NilClass
Error: Could not prepare for execution: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: undefined method `exists?' for nil:NilClass
undefined method `exists?' for nil:NilClass
Resolution
- Reset the file
permissionandownershipto default values, for the rpmshadow-utils.
# rpm --setugids shadow-utils
# rpm --setperms shadow-utils
- Verify the results, following output is expected.
# ll /usr/sbin/usermod
-rwxr-x---. 1 root root 113856 Feb 1 2019 /usr/sbin/usermod
For more KB articles/solutions related to Red Hat Satellite 6.x Puppet Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Puppet Issues
Diagnostic Steps
- Analyze the debug output for puppet agent execution.
# puppet agent -t --trace --debug
Debug: Applying settings catalog for sections main, agent, ssl
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Deleted text domain :production: false
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Deleted text domain :production: false
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Deleted text domain :production: false
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Using settings: adding file resource 'confdir': 'File[/etc/puppetlabs/puppet]{:path=>"/etc/puppetlabs/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
Debug: Using settings: adding file resource 'codedir': 'File[/etc/puppetlabs/code]{:path=>"/etc/puppetlabs/code", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
Debug: Evicting cache entry for environment 'production'
Debug: Deleted text domain :production: false
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Deleted text domain :production: false
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Failed to load library 'cfpropertylist' for feature 'cfpropertylist': cannot load such file -- cfpropertylist
Debug: Puppet::Type::User::ProviderUseradd: file usermod does not exist
Debug: Failed to load library 'ldap' for feature 'ldap': cannot load such file -- 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 usermod does not exist
Debug: Puppet::Type::User::ProviderOpenbsd: file usermod does not exist
Debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dsimport does not exist
Debug: Puppet::Type::User::ProviderUseradd: file usermod does not exist
Debug: Failed to load library 'ldap' for feature 'ldap': cannot load such file -- 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 usermod does not exist
Debug: Puppet::Type::User::ProviderOpenbsd: file usermod does not exist
Debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dsimport does not exist
Error: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: undefined method `exists?' for nil:NilClass
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/user.rb:497:in `exists?'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:805:in `service_user_available?'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/file_setting.rb:52:in `safe_to_use_settings_value?'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/file_setting.rb:43:in `value'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/file_setting.rb:106:in `owner'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/file_setting.rb:160:in `to_resource'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:949:in `block in to_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:945:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:945:in `to_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:1010:in `use'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:419:in `setup'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:367:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:667:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:367:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:139:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `
- Verify rpm, which reflects that the files are modified.
# rpm -Va shadow-utils
.M...UG.. /usr/sbin/usermod
SBR
Product(s)
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.