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

directoryservice user provider crashes if no ShadowHashData is found

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • PUP 4.5.2
    • PUP 4.6.0
    • None
    • None
    • macOS 10.11.5

    • 0
    • Client 2016-06-29, Client 2016-07-13 (HA, 1.5.3)
    • Bug Fix
    • This change fixes an issue with the directoryservice user provider in OSX, where puppet would crash in certain circumstances while fetching bad ShadowHashData from the system. Puppet now handles this gracefully.

    Description

      Possibly related to link PUP-6410, if the user/directoryservice provider's get_attribute_from_dscl method returns nil when trying to fetch ShadowHashData, the whole thing explodes.

      We've only seen this rarely, and only when the provider's trying to read an empty username (which is probably another bug that should be handled).

      Debug: Prefetching directoryservice resources for user
      Debug: Executing: '/usr/bin/dscl -plist . readall /Users'
      Debug: Executing: '/usr/bin/dscl -plist . read /Users// ShadowHashData'
      Debug: Failed with NoMethodError on : #<NoMethodError: undefined method `elements' for nil:NilClass>
      Debug: Executing: '/usr/bin/dscl -plist . readall /Groups'
      Debug: Storing state
      Debug: Stored state in 0.00 seconds
      Error: Failed to apply catalog: undefined method `empty?' for nil:NilClass
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/provider/user/directoryservice.rb:144:in `generate_attribute_hash'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/provider/user/directoryservice.rb:87:in `block in instances'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/provider/user/directoryservice.rb:86:in `collect'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/provider/user/directoryservice.rb:86:in `instances'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/provider/user/directoryservice.rb:73:in `prefetch'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/transaction.rb:305:in `prefetch'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/transaction.rb:205:in `prefetch_if_necessary'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/transaction.rb:97:in `block in evaluate'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/graph/relationship_graph.rb:116:in `call'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/graph/relationship_graph.rb:116:in `traverse'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/transaction.rb:142:in `evaluate'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/resource/catalog.rb:222:in `block in apply'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/util/log.rb:155:in `with_destination'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/transaction/report.rb:118:in `as_logging_destination'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/resource/catalog.rb:221:in `apply'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/configurer.rb:171:in `block in apply_catalog'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/util.rb:223:in `block in benchmark'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/util.rb:222:in `benchmark'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/configurer.rb:170:in `apply_catalog'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/configurer.rb:315:in `run_internal'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/configurer.rb:186:in `block in run'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/context.rb:65:in `override'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet.rb:240:in `override'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/configurer.rb:185:in `run'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/application/apply.rb:350:in `apply_catalog'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/application/apply.rb:274:in `block in main'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/context.rb:65:in `override'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet.rb:240:in `override'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/application/apply.rb:225:in `main'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/application/apply.rb:170:in `run_command'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/application.rb:344:in `block in run'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/util.rb:540:in `exit_on_fail'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/application.rb:344:in `run'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/util/command_line.rb:128:in `run'
      /Library/GoogleCorpSupport/Ruby/lib/ruby/site_ruby/puppet/util/command_line.rb:72:in `execute'
      /Library/GoogleCorpSupport/bin/puppet:5:in `<main>'
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ccaviness Clay Caviness
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support