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.18k stars 5.48k forks source link

Returner 'splunk' does not support function prep_jid #46498

Closed spyd3r closed 10 months ago

spyd3r commented 6 years ago

Description of Issue/Question

2018-03-12 19:01:59,318 [salt.utils.job ][ERROR ][17077] Returner 'splunk' does not support function prep_jid 2018-03-12 19:01:59,318 [salt.master ][ERROR ][17077] Error in function _return: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/salt/master.py", line 1629, in run_func ret = getattr(self, func)(load) File "/usr/lib/python2.7/dist-packages/salt/master.py", line 1434, in _return self.opts, load, event=self.event, mminion=self.mminion) File "/usr/lib/python2.7/dist-packages/salt/utils/job.py", line 43, in store_job raise KeyError(emsg) KeyError: "Returner 'splunk' does not support function prep_jid"

Setup

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

Steps to Reproduce Issue

Add splunk_http_forwarder and master_job_cache as defined above to /etc/salt/master Restart salt-master salt-call test.ping --return splunk tail /var/log/salt/master and see the error message

Versions Report

Salt Version: Salt: 2017.7.2

Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: 2.6.1 docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed Jinja2: 2.7.2 libgit2: Not Installed libnacl: Not Installed M2Crypto: Not Installed Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pycryptodome: Not Installed pygit2: Not Installed Python: 2.7.6 (default, Nov 23 2017, 15:49:48) python-gnupg: Not Installed PyYAML: 3.10 PyZMQ: 14.0.1 RAET: Not Installed smmap: Not Installed timelib: Not Installed Tornado: 4.2.1 ZMQ: 4.0.5

System Versions: dist: Ubuntu 14.04 trusty locale: UTF-8 machine: x86_64 release: 3.13.0-100-generic system: Linux version: Ubuntu 14.04 trusty

spyd3r commented 6 years ago

What release will this be fixed in?

thenoid commented 6 years ago

Curious when this will be addressed as well.

rallytime commented 6 years ago

There isn't anyone currently working on it, but we would greatly appreciate a PR if someone wants to take a stab at it.

davisj commented 6 years ago

I'm hitting this issue on 2018.3.2 using the pgjsonb returner. It does have the prep_jid function defined:

https://github.com/saltstack/salt/blob/9d8cc0b3f414ca2059b65bf3bc960cb8a9c78c0a/salt/returners/pgjsonb.py#L415

So it's not clear to me why it would be raising a key error.

ipmb commented 6 years ago

@davisj I saw the same thing and it was a result of the Python psycogp2 not being installed.

davisj commented 6 years ago

@ipmb Indeed, that seem to have solved the problem for me. Thank you very much!

whytewolf commented 10 months ago

not everything is good as a master_job_cache. a master_job_cache needs to be able to save AND get job information. splunk is not a job database. this won't be fixed for the same reason syslog isn't a good master_job_cache. splunk does have the event_return function which means it can be an event_return which is what everyone trying to use splunk as a master_job_cache actually wants.