saltstack / saltstack/salt

[BUG] "master_job_cache" option failed in CentOS7

Open
#62,355 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Duplicate needs-triage Returners Salt-SSH
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
"master_job_cache" option failed in CentOS7 with "postgres", "postgres_local_cache" and "pgjsonb" returners, when I execute any "salt-ssh" command.

Setup

master_job_cache: postgres
event_return: postgres
returner.postgres.host: '127.0.0.1'
returner.postgres.user: 'salt'
returner.postgres.pass: 'salt'
returner.postgres.db: 'salt'
returner.postgres.port: 5432
keep_jobs: 24
archive_jobs: True

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

  • VM Vagrant with CentOS7 box
  • VM running on a cloud service with CentOS7 image

Steps to Reproduce the behavior

$ salt-ssh --user=vagrant --passwd=vagrant --sudo "192.168.10.2" -ir "echo hi"

[ERROR   ] An un-handled exception was caught by salt's global exception handler:
KeyError: 'postgres.prep_jid'
Traceback (most recent call last):
  File "/bin/salt-ssh", line 11, in <module>
    load_entry_point('salt==3004.2', 'console_scripts', 'salt-ssh')()
  File "/usr/lib/python3.6/site-packages/salt/scripts.py", line 459, in salt_ssh
    client.run()
  File "/usr/lib/python3.6/site-packages/salt/cli/ssh.py", line 22, in run
    ssh.run()
  File "/usr/lib/python3.6/site-packages/salt/client/ssh/__init__.py", line 738, in run
    jid = self.returners[fstr](passed_jid=jid or self.opts.get("jid", None))
  File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 334, in __getitem__
    super().__getitem__(item)  # try to get the item from the dictionary
  File "/usr/lib/python3.6/site-packages/salt/utils/lazy.py", line 105, in __getitem__
    raise KeyError(key)
KeyError: 'postgres.prep_jid'
Traceback (most recent call last):
  File "/bin/salt-ssh", line 11, in <module>
    load_entry_point('salt==3004.2', 'console_scripts', 'salt-ssh')()
  File "/usr/lib/python3.6/site-packages/salt/scripts.py", line 459, in salt_ssh
    client.run()
  File "/usr/lib/python3.6/site-packages/salt/cli/ssh.py", line 22, in run
    ssh.run()
  File "/usr/lib/python3.6/site-packages/salt/client/ssh/__init__.py", line 738, in run
    jid = self.returners[fstr](passed_jid=jid or self.opts.get("jid", None))
  File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 334, in __getitem__
    super().__getitem__(item)  # try to get the item from the dictionary
  File "/usr/lib/python3.6/site-packages/salt/utils/lazy.py", line 105, in __getitem__
    raise KeyError(key)
KeyError: 'postgres.prep_jid'

Expected behavior
Execute correctly the "salt-ssh" command and returns "hi".

Versions Report

salt --versions-report
Salt Version:
          Salt: 3004.2
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: unknown
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.11.1
       libgit2: Not Installed
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: Not Installed
        Python: 3.6.8 (default, Nov 16 2020, 16:55:22)
  python-gnupg: Not Installed
        PyYAML: 3.13
         PyZMQ: 17.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.1.4
 
System Versions:
          dist: centos 7 Core
        locale: ANSI_X3.4-1968
       machine: x86_64
       release: 3.10.0-1127.el7.x86_64
        system: Linux
       version: CentOS Linux 7 Core

Additional context
I've tested this config on RockyLinux8 and runs perfectly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with salt/client/ssh/init.py at the call reported near line 738, following the salt-ssh entry point through salt/cli/ssh.py. Reproduce the CentOS 7 configuration with the postgres, postgres_local_cache, and pgjsonb returners, then compare the behavior with Rocky Linux 8. Done means the command completes and returns "hi" without the KeyError for postgres.prep_jid.

Written by the indexing model from the issue text.

Assessment

Tech stack
centos, postgresql, python
Domain
cli, databases, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.