salt: MacOS El Capitan user.present cause execution error
I’m just testing on a Mac minion, with a simple user.present state test. The user already exists, and the minion throws:
ID: a-human
Function: user.present
Name: '***username***'
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/salt/state.py", line 1703, in call
**cdata['kwargs'])
File "/Library/Python/2.7/site-packages/salt/loader.py", line 1649, in wrapper
return f(*args, **kwargs)
File "/Library/Python/2.7/site-packages/salt/states/user.py", line 457, in present
win_description)
File "/Library/Python/2.7/site-packages/salt/states/user.py", line 92, in _changes
lshad = __salt__['shadow.info'](name)
File "/Library/Python/2.7/site-packages/salt/modules/mac_shadow.py", line 151, in info
'login_failed_count': get_login_failed_count(name),
File "/Library/Python/2.7/site-packages/salt/modules/mac_shadow.py", line 246, in get_login_failed_count
ret = _get_account_policy_data_value(name, 'failedLoginCount')
File "/Library/Python/2.7/site-packages/salt/modules/mac_shadow.py", line 110, in _get_account_policy_data_value
raise CommandExecutionError('Unknown error: {0}'.format(exc.strerror))
CommandExecutionError: Unknown error: Command Failed: dscl . -readpl /Users/leon accountPolicyData failedLoginCount
Return Code: 181
Output: No such plist path: failedLoginCount
Error: <dscl_cmd> DS Error: -14261 (eDSUnknownMatchType)
Started: 13:34:57.497287
Duration: 64.237 ms
Master:
Salt Version:
Salt: 2016.3.1
Dependency Versions:
cffi: 1.7.0
cherrypy: 6.0.2
dateutil: 2.5.3
gitdb: 0.6.4
gitpython: 2.0.6
ioflo: 1.5.5
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: 1.4.5
M2Crypto: 0.24.0
Mako: 1.0.4
msgpack-pure: 0.1.3
msgpack-python: 0.4.7
mysql-python: 1.2.5
pycparser: 2.14
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
python-gnupg: 0.3.8
PyYAML: 3.11
PyZMQ: 14.7.0
RAET: 0.6.5
smmap: 0.9.0
timelib: 0.2.4
Tornado: 4.2.1
ZMQ: 4.0.5
System Versions:
dist: centos 7.2.1511 Core
machine: x86_64
release: 3.10.0-327.22.2.el7.x86_64
system: Linux
version: CentOS Linux 7.2.1511 Core
Minion:
Salt Version:
Salt: 2016.3.0
Dependency Versions:
cffi: 1.5.2
cherrypy: 5.1.0
dateutil: 1.5
gitdb: 0.6.4
gitpython: 1.0.2
ioflo: 1.5.1
Jinja2: 2.8
libgit2: 0.23.4
libnacl: 1.4.4
M2Crypto: 0.24.0
Mako: 1.0.4
msgpack-pure: 0.1.3
msgpack-python: 0.4.7
mysql-python: 1.2.5
pycparser: 2.14
pycrypto: 2.6.1
pygit2: 0.23.3
Python: 2.7.10 (default, Jul 14 2015, 19:46:27)
python-gnupg: 0.3.8
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: 0.6.5
smmap: 0.9.0
timelib: 0.2.4
Tornado: 4.3
ZMQ: 4.1.2
System Versions:
dist:
machine: x86_64
release: 14.5.0
system: Darwin
version: 10.10.5 x86_64
SLS:
a-human:
user.present:
- name: '***username***'
- fullname: human-name
- password: '***chopped***'
- groups:
- an-existing-group
- require:
- group: an-existing-group
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 22 (11 by maintainers)
Happening on macOS 11.1 Big Sur, as well, with more recent Salt versions.
Created a new trivial user via state.apply with this SLS:
Successfully created the account, and home directory, as expected, but subsequent state applications yield the error from the OP:
Salt Master:
Salt Minion:
The above PR should fix the issue with the stacktrace.