You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exception when using user.present with Windows #24196
P1Priority 1PlatformRelates to OS, containers, platform-based utilities like FS, system based appsWindowsbugbroken, incorrect, or confusing behaviorhelp-wantedCommunity help is needed to resolve thisseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
@johnccfm Could you please provide the OS Version you're using as well as the salt versions_report (salt '*' test.version_report)? Also a copy of your state file would be nice.
To reproduce this error you execute your state file with user.present twice. The first time it creates the user. The second time it throws the stack trace. It fails if the user exists.
Windows 8.1
Versions Report:
salt 'g*' test.versions_report
gringo:
Salt: 2014.7.6-50-gd7a9999
Python: 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)]
Jinja2: 2.7.3
M2Crypto: 0.21.1
msgpack-python: 0.4.6
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.11
ioflo: Not Installed
PyZMQ: 14.6.0
RAET: Not Installed
ZMQ: 4.0.5
Mako: Not Installed
State File:
testuser01:
user.present:
- name: testuser01
- fullname: Test User 01
- password: 'PassWord1!'
- groups:
- Administrators
Result:
salt 'g*' state.sls test.adduser
gringo:
----------
ID: testuser01
Function: user.present
Result: True
Comment: New user testuser01 created
Started: 11:50:38.932000
Duration: 571.0 ms
Changes:
----------
active:
True
comment:
fullname:
Test User 01
gid:
groups:
- Administrators
home:
None
logonscript:
name:
testuser01
passwd:
PassWord1!
profile:
None
uid:
S-1-5-21-3611017389-930713959-1986937
370-1006
Summary
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Result when user exists:
salt 'g*' state.sls test.adduser
gringo:
----------
ID: testuser01
Function: user.present
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "c:\salt-dev\salt\salt\state.py", line 1542, in call
**cdata['kwargs'])
File "c:\salt-dev\salt\salt\states\user.py", line 362, in present
expire)
File "c:\salt-dev\salt\salt\states\user.py", line 112, in _changes
if not os.path.isdir(newhome):
TypeError: coercing to Unicode: need string or buffer, NoneType found
Started: 12:02:52.712000
Duration: 117.0 ms
Changes:
Summary
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
P1Priority 1PlatformRelates to OS, containers, platform-based utilities like FS, system based appsWindowsbugbroken, incorrect, or confusing behaviorhelp-wantedCommunity help is needed to resolve thisseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
jfindlay commentedon Jun 4, 2015
@johnccfm, thanks for the report.
twangboy commentedon Jun 12, 2015
@johnccfm Could you please provide the OS Version you're using as well as the salt versions_report (
salt '*' test.version_report)? Also a copy of your state file would be nice.twangboy commentedon Jun 12, 2015
To reproduce this error you execute your state file with user.present twice. The first time it creates the user. The second time it throws the stack trace. It fails if the user exists.
Windows 8.1
Versions Report:
State File:
Result:
Result when user exists:
johnccfm commentedon Jun 14, 2015
Thanks for looking at this @twangboy. Seems like you're way ahead there. Do you still need anything from me at this point?
twangboy commentedon Jun 15, 2015
@johnccfm No, I was just waiting for the PR to be merged. I think we can close the issue. I will do that now.