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

salt-run jobs.list_jobs has Target: unknown-target #48734

Closed
oddfellow opened this issue Jul 24, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@oddfellow
Copy link

commented Jul 24, 2018

Description of Issue/Question

If I do a salt "srv-kamptest1" test.version from the master, wait for successful return and then try to find the job with salt-run jobs.list_jobs search_function="test.version" I get:

20180724124431069093:
    ----------
    Arguments:
    Function:
        test.version
    StartTime:
        2018, Jul 24 12:44:31.069093
    Target:
        unknown-target
    Target-type:
        list
    User:
        root

Here the Target is unknown-target and the Target-type is list which is not correct.
If I do a salt-call test.version from the minion, I get the correct job return fields with the jobs runner:

20180724125130189347:
    ----------
    Arguments:
    Function:
        test.version
    StartTime:
        2018, Jul 24 12:51:30.189347
    Target:
        srv-kamptest1
    Target-type:
        glob
    User:
        root

Without the correct Target field the default job cache is missing very important information because we cannot use salt-run jobs.list_jobs search_function="test.version" search_target="srv-kamptest1"

Setup

Nothing specially configured (only the file_roots and pillar_roots, the dirs itself are empty), standard Debian install with repo.saltstack.com

Steps to Reproduce Issue

Installed salt-saster 2018.3.2
Installed salt-minion 2018.3.2
configured file_roots and pillar_roots
accepted salt key
ran above commands

Versions Report

Master:

Salt Version:
           Salt: 2018.3.2

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
      docker-py: Not Installed
          gitdb: 2.0.0
      gitpython: 2.1.1
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   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.13 (default, Nov 24 2017, 17:33:09)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.1
        timelib: Not Installed
        Tornado: 4.4.3
            ZMQ: 4.2.1

System Versions:
           dist: debian 9.5
         locale: UTF-8
        machine: x86_64
        release: 4.4.110-x86_64-jb1
         system: Linux
        version: debian 9.5

Minion: (but happens also with older Linux minions)

Salt Version:
           Salt: 2018.3.2

Dependency Versions:
           cffi: 1.10.0
       cherrypy: 10.2.1
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.3
          ioflo: Not Installed
         Jinja2: 2.9.6
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.6
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.17
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500
64 bit (AMD64)]
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.3
           RAET: Not Installed
          smmap: 2.0.3
        timelib: 0.2.4
        Tornado: 4.5.1
            ZMQ: 4.1.6

System Versions:
           dist:
         locale: cp1252
        machine: AMD64
        release: 2012ServerR2
         system: Windows
        version: 2012ServerR2 6.3.9600  Multiprocessor Free
@garethgreenaway

This comment has been minimized.

Copy link
Member

commented Jul 24, 2018

@oddfellow Thanks for the report. I was able to duplicate the results above.

@rallytime

This comment has been minimized.

Copy link
Contributor

commented Aug 3, 2018

This was caused by the changes in #43454.

@rallytime rallytime added the Regression label Aug 3, 2018

@rallytime rallytime self-assigned this Aug 3, 2018

Jlin317 added a commit to Jlin317/salt that referenced this issue Sep 11, 2018

Revert "Remove redundant check and add try/except"
This is to fix regression saltstack#48734

This reverts commit 847710c.

Jlin317 added a commit to Jlin317/salt that referenced this issue Sep 12, 2018

rallytime added a commit to rallytime/salt that referenced this issue Oct 31, 2018

rallytime added a commit to rallytime/salt that referenced this issue Oct 31, 2018

Fix issue saltstack#48734
A regression was caused in the local_cache returner with PR saltstack#43454.

PR saltstack#43454 fixes an issue where `jobs.lookup_jid` was not working correctly
with external job caches.

However, when this issue was fixed, there was a slight logic error that
was overlooked for the local_cache. This fixes the issue with the local_cache
so that the "Target" and "Target Type" data is restored to their previous
values.
@rallytime

This comment has been minimized.

Copy link
Contributor

commented Oct 31, 2018

Hi @oddfellow - This should be fixed now with #50328.

@oddfellow

This comment has been minimized.

Copy link
Author

commented Nov 1, 2018

Hi @rallytime I applied c684c29 to a 2018.3.3 master installation and can confirm salt-run now returns the correct values for the test case mentioned above. Thank you!

@rallytime

This comment has been minimized.

Copy link
Contributor

commented Nov 1, 2018

@oddfellow Excellent! Thank you for testing and confirming. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.