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

Puppet errors when deleting a Windows user with no user profile and when managehome=true

    XMLWordPrintable

    Details

    • Template:
      PUP Bug Template
    • Team:
      Night's Watch
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      When Puppet attempts to delete a user with no user profile, the Windows user provider errors the run with an unreadable error message. For example, running

      puppet resource user jimmy ensure=absent password=foo managehome=true
      

      when the user jimmy existed but did not have a user profile results in

      Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
          OLE error code:80070002 in SWbemServicesEx
            The system cannot find the file specified.
          HRESULT error code:0x80020009
            Exception occurred.
      Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
          OLE error code:80070002 in SWbemServicesEx
            The system cannot find the file specified.
          HRESULT error code:0x80020009
            Exception occurred.
      Wrapped exception:
      (in OLE method `Delete': )
          OLE error code:80070002 in SWbemServicesEx
            The system cannot find the file specified.
          HRESULT error code:0x80020009
            Exception occurred.
      Error: /User[jimmy_two]/ensure: change from 'present' to 'absent' failed: Could not set 'absent' on ensure: (in OLE method `Delete': )
          OLE error code:80070002 in SWbemServicesEx
            The system cannot find the file specified.
          HRESULT error code:0x80020009
            Exception occurred.
      

      The reason this happens is because of https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/windows/adsi.rb#L496 – specifically since the user does not have a user profile, no user profile's SID will match the user's SID. We should probably rescue this error code there.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            enis.inan Enis Inan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support