Issue #18796 has been reported by Josh Cooper.

----------------------------------------
Bug #18796: Puppet fails to start if there is no suitable user and/or group 
provider and running as root
https://projects.puppetlabs.com/issues/18796

Author: Josh Cooper
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


Commit 5ee66027 added an `exists?` method to the user type that delegates to 
the provider. This code was added in 0.25.0 and gets called during startup when 
applying the settings catalog. However, if there is no suitable user provider, 
then following error occurs and puppet does not start:

<pre>
# puppet apply -e "notice ''"
...
Error: Could not create resources for managing Puppet's files and directories 
in sections [:main, :ssl, :agent]: undefined method `exists?' for nil:NilClass
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/type/user.rb:367:in
 `exists?'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings.rb:713:in
 `service_user_available?'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings/file_setting.rb:54:in
 `send'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings/file_setting.rb:54:in
 `safe_to_use_settings_value?'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings/file_setting.rb:45:in
 `value'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings/file_setting.rb:108:in
 `owner'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings/file_setting.rb:156:in
 `to_resource'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings.rb:847:in
 `to_catalog'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings.rb:844:in
 `each'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings.rb:844:in
 `to_catalog'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings.rb:906:in
 `use'
/usr/local/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/settings.rb:900:in
 `use'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/configurer.rb:55:in
 `initialize'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/application/apply.rb:264:in
 `new'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/application/apply.rb:264:in
 `apply_catalog'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/application/apply.rb:213:in
 `main'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/application/apply.rb:146:in
 `run_command'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/application.rb:364:in
 `run'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/application.rb:456:in
 `plugin_hook'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/application.rb:364:in
 `run'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/util.rb:504:in 
`exit_on_fail'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/application.rb:364:in
 `run'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/util/command_line.rb:132:in
 `run'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/lib/puppet/util/command_line.rb:86:in
 `execute'
/usr/local/lib/ruby/gems/1.8/gems/puppet-3.1.0.rc1/bin/puppet:4
/usr/local/bin/puppet:23:in `load'
/usr/local/bin/puppet:23
</pre>

A similar change was made in 006c5def, to the group type, added in 3.1.0rc1 for 
#9862.

To reproduce, I was on openbsd, which doesn't have the `chage` command which 
renders the useradd provider unsuitable, and there are no others. Creating an 
empty but executable files, enables puppet to run.

Note the issue with the user type existed prior to 3.0.0, so the fix for #9862 
did not cause the problem.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to