我的盐客户端似乎存在问题,我似乎无法确定问题所在。
我随时尝试运行以下任何命令:
sudo salt 'minion' pkg.refresh_db -l debug
我发出以下错误:
[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'])
我的主配置文件如下所示:
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
之前很奇怪。我在小兵身上安装了cygwin,由于某种原因现在它不起作用。我无法记住我是否更改了某些文件,但我尝试过的内容包括从minion删除cygwin,清除主缓存,清除repo,重新安装minion,将master和minion更新到最新版本(2016.3) .4两者)。不知道这里的问题是什么。
答案 0 :(得分:1)
向上挖掘追踪最终回答了问题。
在您配置的win_repo
中的某处必须提到版本,这是一个字符串,而不是预期的字典。 Salt只是没有正确处理这导致错误。
如果您不想手动检查窗口状态,可以在位于C:\salt\bin\lib\site-packages\salt\modules\win_pkg.py
且暂时添加print(pkgname)
的小兵上打开this file - 它之后看起来会像那样:
for pkgname, versions in six.iteritems(config):
print(pkgname)
for version, repodata in six.iteritems(versions):
然后使用salt-call pkg.refresh_db -l debug
在minion上本地运行salt - 从未在Windows上执行此操作,但是it should be available - 我猜C:\salt\bin
包含它。
sls文件,包括让您的模块当前爆炸的yaml代码应该直接输出到堆栈跟踪上方。