dwr123123d12
dwr123123d12

Reputation: 69

SaltClient Error

There seems to be an issue with my salt client and I cannot seem to pin point where the issue is.

Anytime I try to run any of the following commands:

sudo salt 'minion' pkg.refresh_db -l debug

I'm given the following error:

[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Including configuration from '/etc/salt/master.d/master.conf'
[DEBUG   ] Reading configuration from /etc/salt/master.d/master.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: ECS-141abdb2.ecs.ads.autodesk.com
[DEBUG   ] Missing configuration file: /root/.saltrc
[DEBUG   ] Configuration file path: /etc/salt/master
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Including configuration from '/etc/salt/master.d/master.conf'
[DEBUG   ] Reading configuration from /etc/salt/master.d/master.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: ECS-141abdb2.ecs.ads.autodesk.com
[DEBUG   ] Missing configuration file: /root/.saltrc
[DEBUG   ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'ECS-141abdb2.ecs.ads.autodesk.com_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG   ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] LazyLoaded local_cache.get_load
[DEBUG   ] Reading minion list from /var/cache/salt/master/jobs/37/32a84ef669f42a36e76c07f738738c/.minions.p
[DEBUG   ] get_iter_returns for jid 20161114145741459046 sent to set(['dss']) will timeout at 14:57:46.468061
[DEBUG   ] Checking whether jid 20161114145741459046 is still running
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'ECS-141abdb2.ecs.ads.autodesk.com_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG   ] Passing on saltutil error. This may be an error in saltclient. 'retcode'
[DEBUG   ] Checking whether jid 20161114145741459046 is still running
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'ECS-141abdb2.ecs.ads.autodesk.com_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG   ] Passing on saltutil error. This may be an error in saltclient. 'retcode'
[DEBUG   ] jid 20161114145741459046 return from dss
[DEBUG   ] LazyLoaded nested.output
dss:
The minion function caused an exception: Traceback (most recent call last):
  File "C:\salt\bin\lib\site-packages\salt\minion.py", line 1332, in _thread_return
    return_data = executor.execute()
  File "C:\salt\bin\lib\site-packages\salt\executors\direct_call.py", line 28, in execute
    return self.func(*self.args, **self.kwargs)
  File "C:\salt\bin\lib\site-packages\salt\modules\win_pkg.py", line 376, in refresh_db
    genrepo(saltenv=saltenv)
  File "C:\salt\bin\lib\site-packages\salt\modules\win_pkg.py", line 431, in genrepo
    for version, repodata in six.iteritems(versions):
  File "C:\salt\bin\lib\site-packages\salt\ext\six.py", line 583, in iteritems
    return iter(d.iteritems(**kw))
AttributeError: 'str' object has no attribute 'iteritems'
[DEBUG   ] jid 20161114145741459046 found all minions set(['dss'])

My master configuration file looks like this:

The name of the top file where all the packages are specified

For basic Stingray BM
state_top: Win10.sls

 For Scaleform
 state_top: scaleform-setup.sls

 The location of the top file
 file_roots:
 base:
    - /srv/salt/

 winrepo_dir: /srv/salt/win/repo-ng

fileserver_backend:
  - git
  - roots
winrepo_dir_ng: '/srv/salt/win/repo-ng'
winrepo_provider: gitpython
win_repo_mastercachefile: '/srv/salt/win/repo-ng/salt-winrepo-ng/winrepo.p

It was strangely working before. I was installing cygwin on a minion and for some reason now it doesn't work. I can't remember if I changed some file, but the the things I've tried include removing cygwin from minion, clearing master cache, clearing repo, reinstalling the minion, updating master and minion to the newest version (2016.3.4 for both). No idea what the issue is here.

Upvotes: 2

Views: 1304

Answers (1)

dahrens
dahrens

Reputation: 3959

Digging through the trace upwards finally answers the question.

Somewhere in your configured win_repo there must be versions mentioned which is a string and not a dictionary as expected. Salt just does not handle this properly which leads to the error.

If you don't want to check the windows states manually you might open this file on your minion located at C:\salt\bin\lib\site-packages\salt\modules\win_pkg.py and temporarily add print(pkgname) - it will look like that afterwards:

for pkgname, versions in six.iteritems(config):
    print(pkgname)
    for version, repodata in six.iteritems(versions):

Afterwards run salt locally on the minion using salt-call pkg.refresh_db -l debug - never did this on windows, but it should be available - i guess C:\salt\bin includes it.

The sls file, that includes the yaml code which let's your module currently explode should be outputted directly above the stacktrace.

Upvotes: 1

Related Questions