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

Windows Group resource reports errors incorrectly when specifying an invalid group member

    Details

    • Template:
    • Story Points:
      1
    • Sprint:
      Windows 2015-06-17
    • Release Notes:
      Bug Fix

      Description

      Because of the bug described in PUP-1542, extraneous messages may be output from Puppet when error message generation for an event fails in the resource harness sync_if_needed method.

      There are 2 issues specifically in the Windows group code:

      • members_to_s expects a string, but is passed an array when trying to create the message, which is an easily correctable issue
      • members_to_s tries to resolve bad usernames to sid objects, then tries to access the account member of nil sid object

      Initially spiked a solution for both of these issues in: https://github.com/Iristyle/puppet/commit/a6393b07772146101ae1894381e96cea25f05ed2

      Simple repo example. Assume that the current system has:

      bundle exec puppet resource group guests
       
      group { 'guests':
        ensure  => 'present',
        gid     => 'S-1-5-32-546',
        members => ['Guest', 'Administrator'],
      }
      

      Trying to apply the following manifest with a bad user:

      group { 'guests':
        ensure => present,
        members => ['Guest', 'Administrator', ''],
      }
       
      # generates
       
      Notice: Compiled catalog for vagrant-2008r2.corp.puppetlabs.net in environment production in 0.22 seconds Error: Could not resolve username:
      Error: /Group[Guests]: Could not evaluate: Puppet::Util::Log requires a message
      Notice: Finished catalog run in 0.05 seconds
      

      This spiked change does not lose error detail, nor trigger an extraneous /
      misleading message:

      Notice: Compiled catalog for vagrant-2008r2.corp.puppetlabs.net in environment production in 0.22 seconds Error: Could not resolve username:
      Error: /Stage[main]/Main/Group[Guests]/members: change from VAGRANT-2008R2\Guest,VAGRANT-2008R2\Administrator to ["Guest", "Administrator", ""] failed: Could not resolve username:
      Notice: Finished catalog run in 0.05 seconds
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  ethan Ethan Brown
                  QA Contact:
                  Ryan Gard
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: