Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] file.directory 'LookupAccountSid' error on Windows #60458

Open
ovybach opened this issue Jun 29, 2021 · 3 comments
Open

[BUG] file.directory 'LookupAccountSid' error on Windows #60458

ovybach opened this issue Jun 29, 2021 · 3 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt Execution-Module P3 Priority 3 Windows

Comments

@ovybach
Copy link

ovybach commented Jun 29, 2021

Description
Salt is throwing en exeption when tries to change the owner of the folder using file.directory state.
salt.exceptions.CommandExecutionError: Error resolving "PySID:S-1-5-21-1958111064-2302302258-2862197922-1010": No mapping between account names and security IDs was done.
Issue happens when folder's owner is set to SID that doesn't belong to any existing username (account was removed after folder was created by him).

Steps to Reproduce the behavior
Execute the following sls file:

create_user:
  user.present:
    - name: testuser
    - password: 'MySuper!Str0ngPassw0rd'
    
create_dir:
  file.directory:
    - name: 'C:\ProgramData\test'
    - makedirs: True
    - user: testuser
    - win_owner: testuser

delete_user:
  user.absent:
    - name: testuser
    - purge: True

change_owner:
  file.directory:
    - name: 'C:\ProgramData\test'
    - makedirs: True
    - win_owner: Administrators

Expected behavior
Last file.directory state (change_owner) should finish successfully without exception. Owner should be changed as stated in sls file.

Screenshots
Debug logs from minion - debug.log
Salt output - bug.txt

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3003.1

Dependency Versions:
          cffi: 1.14.5
      cherrypy: 18.6.0
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: 4.0.5
     gitpython: 3.1.13
        Jinja2: 2.11.3
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: 1.1.4
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.20
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
        Python: 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
  python-gnupg: 0.4.6
        PyYAML: 5.4.1
         PyZMQ: 18.0.1
         smmap: 3.0.4
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.1

System Versions:
          dist: msys_nt-10.0-19042 3.1.7
        locale: cp1251
       machine: AMD64
       release: 10
        system: Windows
       version: 10 10.0.19041 SP0
@ovybach ovybach added Bug broken, incorrect, or confusing behavior needs-triage labels Jun 29, 2021
@welcome
Copy link

welcome bot commented Jun 29, 2021

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@smokeytheblair
Copy link

@twangboy can you help take a look at this?

@twangboy twangboy added Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt Execution-Module P3 Priority 3 and removed needs-triage labels Aug 17, 2021
@twangboy twangboy added this to the Approved milestone Aug 17, 2021
@twangboy
Copy link
Contributor

Yep, this is a bug

@twangboy twangboy modified the milestones: Approved, Chlorine v3007.0 Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt Execution-Module P3 Priority 3 Windows
Projects
None yet
Development

No branches or pull requests

5 participants