saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.1k stars 5.47k forks source link

[BUG] KeyError: "Returner 'splunk' does not support function prep_jid" #59270

Closed ssoto2 closed 9 months ago

ssoto2 commented 3 years ago

Description Attempting to use the Splunk returner and receiving errors when running

Setup Master config has the follow:

splunk_http_forwarder:
  token: REMOVED
  indexer: REMOVED
  sourcetype: json
  index: REMOVED
  master_job_cache: splunk

Steps to Reproduce the behavior 1) add the following to the master config

splunk_http_forwarder:
  token: REMOVED
  indexer: REMOVED
  sourcetype: json
  index: REMOVED
  master_job_cache: splunk

2) restart salt-master 3) attempt to run the following command : salt-run cache.clear_git_lock gitfs type=update

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

[INFO    ] Executing command 'pdbedit -V' in directory '/root'
[ERROR   ] Returner 'splunk' does not support function prep_jid
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
KeyError: "Returner 'splunk' does not support function prep_jid"
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/salt/utils/job.py", line 75, in store_job
    mminion.returners[jidstore_fstr](False, passed_jid=load["jid"])
  File "/usr/lib/python3.6/site-packages/salt/loader.py", line 1283, in __getitem__
    func = super().__getitem__(item)
  File "/usr/lib/python3.6/site-packages/salt/utils/lazy.py", line 108, in __getitem__
    raise KeyError(key)
KeyError: 'splunk.prep_jid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bin/salt-run", line 11, in <module>
    load_entry_point('salt==3002.2', 'console_scripts', 'salt-run')()
  File "/usr/lib/python3.6/site-packages/salt/scripts.py", line 465, in salt_run
    client.run()
  File "/usr/lib/python3.6/site-packages/salt/cli/run.py", line 41, in run
    ret = runner.run()
  File "/usr/lib/python3.6/site-packages/salt/runner.py", line 296, in run
    daemonize=False,
  File "/usr/lib/python3.6/site-packages/salt/client/mixins.py", line 507, in _proc_function
    return self.low(fun, low, full_return=False)
  File "/usr/lib/python3.6/site-packages/salt/client/mixins.py", line 434, in low
    mminion=self.mminion,
  File "/usr/lib/python3.6/site-packages/salt/utils/job.py", line 79, in store_job
    raise KeyError(emsg)
KeyError: "Returner 'splunk' does not support function prep_jid"
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/salt/utils/job.py", line 75, in store_job
    mminion.returners[jidstore_fstr](False, passed_jid=load["jid"])
  File "/usr/lib/python3.6/site-packages/salt/loader.py", line 1283, in __getitem__
    func = super().__getitem__(item)
  File "/usr/lib/python3.6/site-packages/salt/utils/lazy.py", line 108, in __getitem__
    raise KeyError(key)
KeyError: 'splunk.prep_jid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bin/salt-run", line 11, in <module>
    load_entry_point('salt==3002.2', 'console_scripts', 'salt-run')()
  File "/usr/lib/python3.6/site-packages/salt/scripts.py", line 465, in salt_run
    client.run()
  File "/usr/lib/python3.6/site-packages/salt/cli/run.py", line 41, in run
    ret = runner.run()
  File "/usr/lib/python3.6/site-packages/salt/runner.py", line 296, in run
    daemonize=False,
  File "/usr/lib/python3.6/site-packages/salt/client/mixins.py", line 507, in _proc_function
    return self.low(fun, low, full_return=False)
  File "/usr/lib/python3.6/site-packages/salt/client/mixins.py", line 434, in low
    mminion=self.mminion,
  File "/usr/lib/python3.6/site-packages/salt/utils/job.py", line 79, in store_job
    raise KeyError(emsg)
KeyError: "Returner 'splunk' does not support function prep_jid"

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) ``` Salt Version: Salt: 3002.2 Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: Not Installed docker-py: Not Installed gitdb: 0.6.4 gitpython: 1.0.1 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: 0.9.0 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.1.4 System Versions: dist: centos 7 Core locale: UTF-8 machine: x86_64 release: 3.10.0-1160.11.1.el7.x86_64 system: Linux version: CentOS Linux 7 Core ```

Additional context Add any other context about the problem here.

s0undt3ch commented 3 years ago

The splunk returner does not, in fact, implement, the prep_jid method.

whytewolf commented 9 months ago

master_job_caches need to make sense. a master_job_cache needs to be able to save AND get information from the location. splunk is a send only system. it doesn't mke a good master_job_cache. which is why it doesn't impliment the functions needed for it to do a master_job_caches job.

splunk does have an event_return function which is what people normally want when they are trying to setup splunk as a master_job_cache. event_returns will send the information into splunk but not need to get the information out for processing.

Closing this because splunk is not going to be a master_job_cache returner.