Bug #5047

puppet agent --mkuser fails to create puppet group on FreeBSD 8.1

Added by Al Hoang over 1 year ago. Updated about 1 year ago.

Status:Accepted Start date:10/20/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:agent
Target version:-
Affected Puppet version:2.6.2 Branch:
Keywords:freebsd
Votes: 0

Description

When trying to create a user with the puppet agent command under FreeBSD. I see a stack trace (shown below). If I use puppet master —mkuser this works fine however it would be nicer if puppet agent —mkuser also worked.

    
# facter operatingsystem
FreeBSD
# facter kernelrelease
8.1-STABLE
# puppet agent --mkuser --trace --debug
warning: iconv couldn't be loaded, which is required for UTF-8/UTF-16 conversions
debug: Failed to load library 'rubygems' for feature 'rubygems'
debug: Failed to load library 'selinux' for feature 'selinux'
debug: Failed to load library 'shadow' for feature 'libshadow'
debug: Puppet::Type::File::ProviderMicrosoft_windows: feature microsoft_windows is missing
debug: Puppet::Type::User::ProviderUseradd: file chage 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::ProviderDirectoryservice: file /usr/bin/dscl does not exist
debug: Puppet::Type::User::ProviderUser_role_add: file chage does not exist
debug: /File[/etc/puppet/puppet.conf]: Autorequiring File[/etc/puppet]
debug: /File[/etc/puppet/ssl/private]: Autorequiring User[puppet]
debug: /File[/etc/puppet/ssl/private]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/etc/puppet/ssl]: Autorequiring User[puppet]
debug: /File[/etc/puppet/ssl]: Autorequiring File[/etc/puppet]
debug: /File[/etc/puppet/ssl/private_keys]: Autorequiring User[puppet]
debug: /File[/etc/puppet/ssl/private_keys]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/puppet/client_yaml]: Autorequiring File[/var/puppet]
debug: /File[/var/puppet/log]: Autorequiring File[/var/puppet]
debug: /File[/var/puppet/clientbucket]: Autorequiring File[/var/puppet]
debug: /File[/var/puppet/facts]: Autorequiring File[/var/puppet]
debug: /File[/etc/puppet/ssl/certificate_requests]: Autorequiring User[puppet]
debug: /File[/etc/puppet/ssl/certificate_requests]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/puppet/state]: Autorequiring File[/var/puppet]
debug: /File[/var/puppet/lib]: Autorequiring File[/var/puppet]
debug: /File[/var/puppet/state/graphs]: Autorequiring File[/var/puppet/state]
debug: /File[/etc/puppet/ssl/public_keys]: Autorequiring User[puppet]
debug: /File[/etc/puppet/ssl/public_keys]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/etc/puppet/ssl/certs]: Autorequiring User[puppet]
debug: /File[/etc/puppet/ssl/certs]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/puppet/client_data]: Autorequiring File[/var/puppet]
debug: User[puppet](provider=pw): Executing '/usr/sbin/pw useradd puppet -g puppet'
/usr/local/lib/ruby/site_ruby/1.8/puppet/provider/nameservice.rb:170:in `create'
/usr/local/lib/ruby/site_ruby/1.8/puppet/type/user.rb:39:in `set_present'
/usr/local/lib/ruby/site_ruby/1.8/puppet/property.rb:81:in `send'
/usr/local/lib/ruby/site_ruby/1.8/puppet/property.rb:81:in `call_valuemethod'
/usr/local/lib/ruby/site_ruby/1.8/puppet/property.rb:241:in `set'
/usr/local/lib/ruby/site_ruby/1.8/puppet/property.rb:295:in `sync'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction/change.rb:34:in `apply'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:21:in `apply_changes'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:20:in `each'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:20:in `apply_changes'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:90:in `evaluate'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:49:in `apply'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:114:in `eval_children_and_apply_resource'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:92:in `eval_resource'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:143:in `evaluate'
/usr/local/lib/ruby/site_ruby/1.8/puppet/util.rb:422:in `thinmark'
/usr/local/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/local/lib/ruby/site_ruby/1.8/puppet/util.rb:421:in `thinmark'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:142:in `evaluate'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:135:in `each'
/usr/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:135:in `evaluate'
/usr/local/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:144:in `apply'
/usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:632:in `use'
/usr/local/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:615:in `use'
/usr/local/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:220:in `setup'
/usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:286:in `run'
/usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:393:in `exit_on_fail'
/usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:286:in `run'
/usr/local/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in `execute'
/usr/local/bin/puppet:4
err: /User[puppet]/ensure: change from absent to present failed: Could not create user puppet: Execution of '/usr/sbin/pw useradd puppet -g puppet' returned 67: pw: group `puppet' does not exist

notice: /File[/etc/puppet/ssl]: Dependency User[puppet] has failures: true
warning: /File[/etc/puppet/ssl]: Skipping because of failed dependencies
notice: /File[/etc/puppet/ssl/public_keys]: Dependency User[puppet] has failures: true
warning: /File[/etc/puppet/ssl/public_keys]: Skipping because of failed dependencies
notice: /File[/etc/puppet/ssl/certs]: Dependency User[puppet] has failures: true
warning: /File[/etc/puppet/ssl/certs]: Skipping because of failed dependencies
notice: /File[/etc/puppet/ssl/certificate_requests]: Dependency User[puppet] has failures: true
warning: /File[/etc/puppet/ssl/certificate_requests]: Skipping because of failed dependencies
notice: /File[/etc/puppet/ssl/private_keys]: Dependency User[puppet] has failures: true
warning: /File[/etc/puppet/ssl/private_keys]: Skipping because of failed dependencies
notice: /File[/etc/puppet/ssl/private]: Dependency User[puppet] has failures: true
warning: /File[/etc/puppet/ssl/private]: Skipping because of failed dependencies
debug: Finishing transaction 17215989880
/usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:636:in `use'
/usr/local/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:157:in `apply'
/usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:632:in `use'
/usr/local/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:615:in `use'
/usr/local/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:220:in `setup'
/usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:286:in `run'
/usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:393:in `exit_on_fail'
/usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:286:in `run'
/usr/local/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in `execute'
/usr/local/bin/puppet:4
Could not prepare for execution: Got 1 failure(s) while initializing: change from absent to present failed: Could not create user puppet: Execution of '/usr/sbin/pw useradd puppet -g puppet' returned 67: pw: group `puppet' does not exist

Related issues

related to Puppet - Bug #6445: Incorrect program specified in lib/puppet/reference/confi... Closed 02/24/2011

History

Updated by Markus Roberts over 1 year ago

  • Status changed from Unreviewed to Investigating
  • Assignee set to Markus Roberts

This is ringing a bell… #4336? #4867? #4501? #4284?

sigh

Updated by Ben Hughes about 1 year ago

As per #6445 you should use “puppet master —mkusers” because generally the puppet agent needs to run as root, where as the puppet master generally runs as the puppet user.

However, it still shouldn’t stack trace! (:

Updated by Ben Hughes about 1 year ago

This is still present in 2.6.4 and FreeBSD 8.2.

Now to find out why.

Updated by Ben Hughes about 1 year ago

  • Status changed from Investigating to Accepted

The mkuser arg should be moved out of general and put in just the “:master” section of default.rb so it’s only used by the correct application.

Updated by James Turnbull about 1 year ago

  • Assignee changed from Markus Roberts to Ben Hughes

Ben – you fancy making that change and submitting the patch?

Updated by Ben Hughes about 1 year ago

  • Assignee deleted (Ben Hughes)

Right, well the problem isn’t as simple as it appears, so I’m documenting it here so a grown up can make the chances required.

puppet/util/settings.rb has a function called “add_user_resources”, this adds the user if need be.

If that’s invoked up the guise of “puppet master” then setting.group, group and catalog.resource(:group, group) are able to set (basically the group variable then). If called as “puppet agent” then those never are. See http://pastie.org/1649842 for examples of hacked up debug output during their runs.

I believe this to be because puppet/defaults.rb:

  setdefaults(:master,
    :user => ["puppet", "The user puppet master should run as."],
    :group => ["puppet", "The group puppet master should run as."],

Lets see if adding that to :agent makes it work. Nope!

So I dunno, but that’s the debugging so far.

Also available in: Atom PDF