Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: u'ret' when targeting non-exist host with --static option #46876

Open
4815162342lost opened this issue Apr 4, 2018 · 2 comments
Open
Labels
Bug broken, incorrect, or confusing behavior help-wanted Community help is needed to resolve this pending-community-assignment Pending community contributor assignment severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@4815162342lost
Copy link

Hello,

salt-master 2018.3.0 (Oxygen)
salt-minion 2017.7.4 (Nitrogen)

vodka@vodka-PC:~/PycharmProjects/get_security_updates_debian$ salt --versions-report
Salt Version:
           Salt: 2018.3.0
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.0
      docker-py: Not Installed
          gitdb: 2.0.2
      gitpython: 2.1.5
          ioflo: Not Installed
         Jinja2: 2.9.6
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.14 (default, Sep 23 2017, 22:06:14)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.1
            ZMQ: 4.2.1
 
System Versions:
           dist: Ubuntu 17.10 artful
         locale: UTF-8
        machine: x86_64
        release: 4.13.0-38-generic
         system: Linux
        version: Ubuntu 17.10 artful

I am running this command:
sudo salt -L 'cent_os,ppp' pkg.list_upgrades refresh=True --output=json --static --hide-timeout

minion ppp does not exist, but instead of 'No minions matched the target. No command was sent, no jid was assigned' i received python exception:

vodka@vodka-PC:~/PycharmProjects/get_security_updates_debian$ sudo salt -L  'cent_os,ppp' pkg.list_upgrades refresh=True --static  --hide-timeout
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
KeyError: u'ret'
Traceback (most recent call last):
  File "/usr/bin/salt", line 10, in <module>
    salt_main()
  File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 485, in salt_main
    client.run()
  File "/usr/lib/python2.7/dist-packages/salt/cli/salt.py", line 65, in run
    self._run_batch()
  File "/usr/lib/python2.7/dist-packages/salt/cli/salt.py", line 269, in _run_batch
    for res in batch.run():
  File "/usr/lib/python2.7/dist-packages/salt/cli/batch.py", line 262, in run
    ret[minion] = data['ret']
KeyError: u'ret'
Traceback (most recent call last):
  File "/usr/bin/salt", line 10, in <module>
    salt_main()
  File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 485, in salt_main
    client.run()
  File "/usr/lib/python2.7/dist-packages/salt/cli/salt.py", line 65, in run
    self._run_batch()
  File "/usr/lib/python2.7/dist-packages/salt/cli/salt.py", line 269, in _run_batch
    for res in batch.run():
  File "/usr/lib/python2.7/dist-packages/salt/cli/batch.py", line 262, in run
    ret[minion] = data['ret']
KeyError: u'ret'
@garethgreenaway
Copy link
Contributor

@4815162342lost Thanks for the report. This makes sense since the non-existing minion never returns. We should handle this better though.

@garethgreenaway garethgreenaway added this to the Approved milestone Apr 5, 2018
@garethgreenaway garethgreenaway added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P2 Priority 2 labels Apr 5, 2018
@VipuSharma
Copy link

@garethgreenaway Facing the same issue wherein i am running the command:
salt '*' test.ping --output=json --static
And it throws me the similar error. I understand the reason because of which it throws the error but i have many minions, so can you please suggest me a way to make it run and identify which minion among all is causing it to occur. I am using the same versions for master and minion as specified by @4815162342lost in the above post.

meaksh added a commit to meaksh/salt that referenced this issue Jul 3, 2019
We have several issues reporting that salt is throwing exception when
the minion does not respond. This change avoid the exception adding a
default data to the minion when it fails to respond. This patch based
on the patch suggested by @roskens.

Issues saltstack#46876 saltstack#48509 saltstack#50238
bsc#1135507

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
admd pushed a commit to admd/salt-1 that referenced this issue Jan 27, 2020
We have several issues reporting that salt is throwing exception when
the minion does not respond. This change avoid the exception adding a
default data to the minion when it fails to respond. This patch based
on the patch suggested by @roskens.

Issues saltstack#46876 saltstack#48509 saltstack#50238
bsc#1135507

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
meaksh added a commit to meaksh/salt that referenced this issue Mar 10, 2020
We have several issues reporting that salt is throwing exception when
the minion does not respond. This change avoid the exception adding a
default data to the minion when it fails to respond. This patch based
on the patch suggested by @roskens.

Issues saltstack#46876 saltstack#48509 saltstack#50238
bsc#1135507

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
agraul pushed a commit to agraul/salt that referenced this issue Apr 22, 2020
We have several issues reporting that salt is throwing exception when
the minion does not respond. This change avoid the exception adding a
default data to the minion when it fails to respond. This patch based
on the patch suggested by @roskens.

Issues saltstack#46876 saltstack#48509 saltstack#50238
bsc#1135507

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
agraul pushed a commit to agraul/salt that referenced this issue Apr 27, 2020
We have several issues reporting that salt is throwing exception when
the minion does not respond. This change avoid the exception adding a
default data to the minion when it fails to respond. This patch based
on the patch suggested by @roskens.

Issues saltstack#46876 saltstack#48509 saltstack#50238
bsc#1135507

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
@sagetherage sagetherage removed the P2 Priority 2 label Jun 3, 2020
meaksh added a commit to meaksh/salt that referenced this issue Apr 13, 2021
We have several issues reporting that salt is throwing exception when
the minion does not respond. This change avoid the exception adding a
default data to the minion when it fails to respond. This patch based
on the patch suggested by @roskens.

Issues saltstack#46876 saltstack#48509 saltstack#50238
bsc#1135507

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
agraul pushed a commit to agraul/salt that referenced this issue Jun 25, 2021
We have several issues reporting that salt is throwing exception when
the minion does not respond. This change avoid the exception adding a
default data to the minion when it fails to respond. This patch based
on the patch suggested by @roskens.

Issues saltstack#46876 saltstack#48509 saltstack#50238
bsc#1135507

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
agraul pushed a commit to agraul/salt that referenced this issue Jan 21, 2022
We have several issues reporting that salt is throwing exception when
the minion does not respond. This change avoid the exception adding a
default data to the minion when it fails to respond. This patch based
on the patch suggested by @roskens.

Issues saltstack#46876 saltstack#48509 saltstack#50238
bsc#1135507

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
cbosdo pushed a commit to cbosdo/salt that referenced this issue Feb 2, 2022
We have several issues reporting that salt is throwing exception when
the minion does not respond. This change avoid the exception adding a
default data to the minion when it fails to respond. This patch based
on the patch suggested by @roskens.

Issues saltstack#46876 saltstack#48509 saltstack#50238
bsc#1135507

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
@twangboy twangboy modified the milestones: Approved, Argon v3008 Aug 31, 2023
@twangboy twangboy added help-wanted Community help is needed to resolve this pending-community-assignment Pending community contributor assignment labels Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior help-wanted Community help is needed to resolve this pending-community-assignment Pending community contributor assignment severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

5 participants