saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.19k stars 5.48k forks source link

[BUG] Minions data missing from MySQL job cache #61242

Open xzenor opened 3 years ago

xzenor commented 3 years ago

Description The json output of list_job with local jobcache is different than a mysql jobcache.

Setup Very basic setup with CentOS 8 Stream

Please be as specific as possible and give set-up details.

Steps to Reproduce the behavior Just run jobs.list_job [ID] with local and with mysql output to see the difference.

This is the output with local jobcache # salt-run jobs.list_job 20211116131018012776 --out=json

{
    "jid": "20211116131018012776",
    "Function": "test.ping",
    "Arguments": [],
    "Target": "*",
    "Target-type": "glob",
    "User": "root",
    "Minions": [
        "server-mgt01.REDACTED",
        "server-tst01.REDACTED",
        "server-tst02.REDACTED"
    ],
    "StartTime": "2021, Nov 16 13:10:18.012776",
    "Result": {
        "server-tst01.REDACTED": {
            "return": true,
            "retcode": 0,
            "success": true
        },
        "server-tst02.REDACTED": {
            "return": true,
            "retcode": 0,
            "success": true
        },
        "server-mgt01.REDACTED": {
            "return": true,
            "retcode": 0,
            "success": true
        }
    }
}
[INFO    ] Runner completed: 20211116131204988971

This is the output with mysql jobcache $ salt-run jobs.list_job 20211116114342060929 --out=json

{
    "jid": "20211116114342060929",
    "Function": "test.ping",
    "Arguments": [],
    "Target": "*",
    "Target-type": "glob",
    "User": "root",
    "StartTime": "2021, Nov 16 11:43:42.060929",
    "Result": {
        "server-tst01.REDACTED": {
            "cmd": "_return",
            "id": "server-tst01.REDACTED",
            "success": true,
            "return": true,
            "retcode": 0,
            "jid": "20211116114342060929",
            "fun": "test.ping",
            "fun_args": [],
            "_stamp": "2021-11-16T11:43:42.305608"
        },
        "server-tst02.REDACTED": {
            "cmd": "_return",
            "id": "server-tst02.REDACTED",
            "success": true,
            "return": true,
            "retcode": 0,
            "jid": "20211116114342060929",
            "fun": "test.ping",
            "fun_args": [],
            "_stamp": "2021-11-16T11:43:42.365949"
        },
        "server-mgt01.REDACTED": {
            "cmd": "_return",
            "id": "server-mgt01.REDACTED",
            "success": true,
            "return": true,
            "retcode": 0,
            "jid": "20211116114342060929",
            "fun": "test.ping",
            "fun_args": [],
            "_stamp": "2021-11-16T11:43:42.483357"
        }
    }
}
[INFO    ] Runner completed: 20211116125620672471

While the MySQL one provides a lot more output in the Result section, it is completely missing the minions section.

Expected behavior At least the sections in the json output should be the same. This breaks scripts and 3rd party software that depends on the json sections.

Screenshots Console output already provided in the steps to reproduce behavior.

Versions Report

# salt --versions-report
Salt Version:
          Salt: 3004

Dependency Versions:
          cffi: 1.11.5
      cherrypy: unknown
      dateutil: 2.6.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10.1
       libgit2: Not Installed
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: 1.4.6
     pycparser: 2.14
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: Not Installed
        Python: 3.6.8 (default, Oct 19 2021, 05:14:06)
  python-gnupg: Not Installed
        PyYAML: 3.12
         PyZMQ: 19.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: centos 8
        locale: UTF-8
       machine: x86_64
       release: 4.18.0-348.el8.x86_64
        system: Linux
       version: CentOS Stream 8

Minion versions are the same. One is same centos 8 version as the master, the other is centos 7. The master is a minion as well.

Additional context Discovered this while trying to get SaltGUI working on salt with MySQL jobcache. Figured it was a bug in SaltGUI but it turns out Salt gives 2 different kinds of results.

If it's of any use, here's the bugreport for SaltGUI: https://github.com/erwindon/SaltGUI/issues/399

OrangeDog commented 3 years ago

Can you edit the title please: [BUG] Minions data missing from MySQL job cache

OrangeDog commented 3 years ago

Possible duplicate of #61222?

xzenor commented 3 years ago

Possible duplicate of #61222?

Doesn't seem like it. I just confirmed that the result with redis is the same as with mysql. No list of minions.

61222 appears to be a purely MySQL issue.