Repository navigation
Closed
Labels
Corerelates to code central or existential to SaltP2Priority 2bugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
Orchestration/state.orchestrate gives exception when a target listed in the orchestration file does not exist.
Expecting that the exception would be handled and a helpful message displayed instead.
Here's an example orchestration file being used. In this case the target 'app*' does not exist in the environment.
orch.sls
htop:
salt.state:
- tgt: 'app*'
- sls:
- htop
install_vim:
salt.state:
- tgt: '*'
- sls:
- vim
cmd.run:
salt.function:
- tgt: '*'
- arg:
- rm -rf /tmp/foo
Steps to Reproduce Issue
- Run the above listed orchestration file in an env where the target of
app*does not exist. - Here is the command being run:
salt-run state.orchestrate orchestrate.orch - The following exception is printed to the screen:
No minions matched the target. No command was sent, no jid was assigned.
[ERROR ] An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/state.py", line 1703, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1649, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/salt/states/saltmod.py", line 225, in state
cmd_ret = __salt__['saltutil.cmd'](tgt, fun, **cmd_kw)
File "/usr/lib/python2.7/site-packages/salt/modules/saltutil.py", line 894, in cmd
client, tgt, fun, arg, timeout, expr_form, ret, kwarg, **kwargs)
File "/usr/lib/python2.7/site-packages/salt/modules/saltutil.py", line 862, in _exec
for ret_comp in _cmd(**cmd_kwargs):
File "/usr/lib/python2.7/site-packages/salt/client/__init__.py", line 686, in cmd_iter
self._clean_up_subscriptions(pub_data['jid'])
KeyError: 'jid'
- Keep in mind that the other states listed in the orchestration file get run due to the target
'*'and if the targetapp*does exist there are no errors.
Salt Version:
Salt: 2016.3.0rc2
Dependency Versions:
Jinja2: 2.7.2
M2Crypto: 0.21.1
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 14.7.0
Python: 2.7.5 (default, Jun 17 2014, 18:11:42)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.7
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: centos 7.0.1406 Core
machine: x86_64
release: 3.10.0-123.el7.x86_64
system: Linux
version: CentOS Linux 7.0.1406 Core
Metadata
Metadata
Assignees
Labels
Corerelates to code central or existential to SaltP2Priority 2bugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
Only unsub if we have a jid
cachedout commentedon Apr 11, 2016
Really good find here.
ssgward commentedon Apr 11, 2016
Nice. Quick fix. Verified the fix from head of 2016.3 on commit beginning with 20bbabb. Closing.
[develop] Merge forward from 2016.3 to develop (#32494)
beelit94 commentedon May 24, 2016
I'm seeing the same error in 2015.8.10
ssgward commentedon May 24, 2016
Yeah, this is fixed in 2016.3 branch, but needs to get back ported to the 2015.8 branch.
@rallytime
Only unsub if we have a jid
Only unsub if we have a jid