Fix Windows user add.
While fixing bug #4484 I came across this error. Once #4484 was fixed, you can now create the user. But now the second time you run the state you get this error:
ubuntu@ip-10-195-227-27:/srv/salt$ sudo salt 'lk*' state.sls testuser
lkjlkj:
----------
State: - user
Name: testuser
Function: present
Result: True
Comment: New user testuser created
Changes: comment:
profile:
name: testuser
groups: ['Users']
active: Yes
home:
fullname:
logonscript:
ubuntu@ip-10-195-227-27:/srv/salt$ sudo salt 'lk*' state.sls testuser
lkjlkj:
----------
State: - user
Name: testuser
Function: present
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "C:\salt\python27\lib\site-packages\salt\state.py", line 1217, in call
ret = self.states[cdata['full']](*cdata['args'])
File "C:\salt\python27\lib\site-packages\salt\states\user.py", line 255, in present
homephone)
File "C:\salt\python27\lib\site-packages\salt\states\user.py", line 69, in _changes
if __salt__['file.gid_to_group'](gid or lusr['gid']) in \
KeyError: 'gid'
Changes:
ubuntu@ip-10-195-227-27:/srv/salt$
Can you help me with this issue please?
I am running salt-0.16.3.win32. My usermgt.sls reads like this:
Jenkins:
user.present:
- fullname: 'Continuous Integration Account'
- groups:
- JenkinsGroup
When running "salt-call state.highstate", I receive this error:
State: - user←[0m
←[0;31mName: Jenkins←[0m
←[0;31mFunction: present←[0m
←[0;31mResult: False←[0m
←[0;31mComment: An exception occurred in this state: Traceback (most r
ecent call last):
File "salt/state.py", line 1239, in call
File "salt/states/user.py", line 367, in present
TypeError: add() got an unexpected keyword argument 'createhome'
←[0m
←[0;31m Changes: ←[0m
FWIW: Just prior to running salt-call, I had deleted the user Jenkins which I had created manually.
Ah, I think this was an issue that was fixed for 0.16.4 and 0.17.0. Could you try upgrading?
will do, thanks.
I've had absolutely no luck in my attempts to upgrade from 16.3 to 17.0. I received a "msgpack.exceptions.UnpackValueError" error when running salt-call even though I'd removed 16.3 from the server prior to the 17.0 installation. I've attempted the 17.0 installation several times to no avail.
This is a known issue with upgrading to 0.17.0. Remove C:\salt\var\cache\salt (or whatever the path is to the salt cachedir), and that error should clear.
ah, but I did. I removed all of c:\salt.
Did you restart the salt-minion service?
I ensured the service was removed after each un-install.
And ensured it was re-installed and started prior to my salt-call test.
After several tries, I reverted back to a 16.3 install and no error.
I haven't tried a reboot because that's a rather drastic measure in my environment.