Jira (PUP-11507) macOS agents fails to retrieve password hash - old bug still there

21 views
Skip to first unread message

Daryl Cashville (Jira)

unread,
Apr 13, 2022, 10:26:02 AM4/13/22
to puppe...@googlegroups.com
Daryl Cashville created an issue
 
Puppet / Bug PUP-11507
macOS agents fails to retrieve password hash - old bug still there
Issue Type: Bug Bug
Affects Versions: PUP 7.14.0
Assignee: Unassigned
Created: 2022/04/13 7:25 AM
Priority: Major Major
Reporter: Daryl Cashville

Puppet Version: 7.14.0
Puppet Server Version: 7.6.1
OS Name/Version: MacOS 12.3.1

Puppet user provider fails - see also PUP-8330

Desired Behavior:

No error

Actual Behavior:

Errors

Creating a local user appears to work on some instances of MacOS but at least one agent fails with:

Could not prefetch user provider 'directoryservice': undefined method `unpack' for nil:NilClass

This is similar to the error reported in PUP-8330 but a password change does not fix it.

# puppet resource user pacscan --trace --debug 
Debug: Runtime environment: puppet_version=7.14.0, ruby_version=2.7.5, run_mode=user, default_encoding=US-ASCII
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: Facter: Resolving facts sequentially
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f97428120a0 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Executing command: uname -m &&
           uname -n &&
           uname -p &&
           uname -r &&
           uname -s &&
           uname -v
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f979718c8e8 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f9792abe6a0 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Puppet::Type::User::ProviderUseradd: file useradd does not exist
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f9782149aa8 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Puppet::Type::User::ProviderPw: file pw does not exist
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f978213b4d0 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Puppet::Type::User::ProviderUser_role_add: file useradd does not exist
Debug: Could not find library 'ldap' required to enable feature 'ldap'
Debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
Debug: Puppet::Type::User::ProviderOpenbsd: file useradd does not exist
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f97961814d0 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f9782121e90 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f979213e508 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f9795925f70 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f97820f1ba0 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Puppet::Type::User::ProviderUseradd: file useradd does not exist
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f97958a8868 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Puppet::Type::User::ProviderPw: file pw does not exist
Debug: Facter: resolving fact with user_query: operatingsystem
Debug: Facter: Searching fact: operatingsystem in file: operatingsystem.rb
Debug: Facter: Searching fact: operatingsystem in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x00007f97969273b0 @name="operatingsystem", @fact_class=Facts::Macosx::Os::Name, @user_query="operatingsystem", @type=:legacy, @file=nil>]
Debug: Facter: Loading external facts
Debug: Facter: fact "operatingsystem" has resolved to: Darwin
Debug: Puppet::Type::User::ProviderUser_role_add: file useradd does not exist
Debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
Debug: Puppet::Type::User::ProviderOpenbsd: file useradd does not exist
Debug: Executing: '/usr/bin/dscl -plist . readall /Users'
Debug: Executing: '/usr/bin/dscl -plist . readall /Groups'
Debug: Converting binary plist to hash
Debug: Converting binary plist to hash
Debug: Converting binary plist to hash
Error: Could not run: undefined method `unpack' for nil:NilClass
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/user/directoryservice.rb:211:in `get_salted_sha512_pbkdf2'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/user/directoryservice.rb:151:in `generate_attribute_hash'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/user/directoryservice.rb:88:in `block in instances'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/user/directoryservice.rb:87:in `collect'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/user/directoryservice.rb:87:in `instances'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1186:in `block in instances'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1185:in `collect'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1185:in `instances'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/resource/ral.rb:14:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:223:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/resource.rb:231:in `block in find_or_save_resources'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:302:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/resource.rb:228:in `find_or_save_resources'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/resource.rb:147:in `block in main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:302:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/resource.rb:142:in `main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:437:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:744:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:421:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 20, 2022, 11:23:02 AM4/20/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 20, 2022, 11:23:03 AM4/20/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 20, 2022, 5:05:03 PM4/20/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 20, 2022, 5:05:03 PM4/20/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11507
 
Re: macOS agents fails to retrieve password hash - old bug still there

I think this can be reproduced by specifying a salt as hex encoded string of length less then 64 characters, as puppet will partially create the user, but leave the salt field in the SALTED-SHA512-PBKDF2 plist invalid/missing. Then the next time you run puppet, it will try to load the plist and fail trying to call "unpack" on nil: https://github.com/puppetlabs/puppet/blob/f5a23ce87b380241feb1ffc6d390ce1696354617/lib/puppet/provider/user/directoryservice.rb#L211

Josh Cooper (Jira)

unread,
Apr 20, 2022, 5:21:03 PM4/20/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.17.0
Fix Version/s: PUP 6.28.0

Nirupama Mantha (Jira)

unread,
Apr 21, 2022, 11:18:02 AM4/21/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 21, 2022, 11:21:03 AM4/21/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Acceptance Criteria: If the current salt or iterations for the user is missing or corrupt, puppet should gracefully treat it as missing so that the correct desired version can be set the next time puppet runs. For example, if you try to manage the user using a salt with the wrong length, it should fail. If you then correct the salt and try to run again, puppet should enforce the desired state. It shouldn't take two runs to converge.
Story Points: 2

Nirupama Mantha (Jira)

unread,
Apr 21, 2022, 11:49:04 AM4/21/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 22, 2022, 11:55:03 AM4/22/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 26, 2022, 11:59:02 PM4/26/22
to puppe...@googlegroups.com

Aria Li (Jira)

unread,
May 3, 2022, 7:07:03 PM5/3/22
to puppe...@googlegroups.com

Tony Vu (Jira)

unread,
May 11, 2022, 11:10:02 AM5/11/22
to puppe...@googlegroups.com
Tony Vu updated an issue
Change By: Tony Vu
Sprint: Phoenix 2022-05-11 , Phoenix 2022-05-25

Aria Li (Jira)

unread,
May 17, 2022, 4:59:01 PM5/17/22
to puppe...@googlegroups.com
Aria Li assigned an issue to Unassigned
Change By: Aria Li
Assignee: Aria Li

Josh Cooper (Jira)

unread,
May 19, 2022, 11:24:01 AM5/19/22
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages