Repository navigation
Closed
Labels
Corerelates to code central or existential to SaltP2Priority 2bugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
Description of Issue/Question
When running masterless minion, I am unable to query the job cache. I end up getting an empty response:
# salt-call test.ping
[INFO ] Determining pillar cache
local:
True
# salt-call saltutil.runner jobs.list_jobs
[INFO ] Determining pillar cache
[INFO ] Runner completed: 20160425103635664870
local:
----------
# salt-call saltutil.find_job 20160425103635664870
[INFO ] Determining pillar cache
local:
----------
# salt-call saltutil.find_cached_job 20160425103635664870
[INFO ] Determining pillar cache
local:
Local jobs cache directory /var/cache/salt/minion/minion_jobs/20160425103635664870 not found
I do see that the job cache is being populated in /var/cache/salt/master/jobs/ though.
Setup
/etc/salt/minion.d/salt-minion.conf:
file_client: local
cache_jobs: True
Steps to Reproduce Issue
1.) Setup masterless salt
2.) use config above for masterless minion
3.) run the following command: salt-call test.ping
4.) run the following command: salt-call saltutil.runner jobs.list_jobs
Versions Report
# salt-minion --versions-report
Salt Version:
Salt: 2015.8.8.2
Dependency Versions:
Jinja2: 2.7.2
M2Crypto: 0.21.1
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 14.7.0
Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
cffi: Not Installed
cherrypy: Not Installed
dateutil: 1.5
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.7
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: centos 7.2.1511 Core
machine: x86_64
release: 3.10.0-327.13.1.el7.x86_64
system: CentOS Linux 7.2.1511 Core
Metadata
Metadata
Assignees
Labels
Corerelates to code central or existential to SaltP2Priority 2bugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
jfindlay commentedon Apr 26, 2016
Thanks for reporting, @beardedeagle.
rallytime commentedon May 3, 2016
@beardedeagle Just an update here, and some clarifications on your issue. For
saltutil.runner, this is expected functionality. The docs for thesaltutil.runnerfunction say:For the
saltutil.find_jobfunction, that is also the expected functionality for a job that has already completed. Thefind_jobfunction appears to be working correctly at the HEAD of the 2015.8 and 2016.3 branches.First, I set a longish-running job:
Then I can check what jobs are running (in a different terminal window):
Then I can find that job specifically:
But once the original
test.sleephas finished, I see the same result you posted (which is expected):I will add a note to the documentation about this behavior so that is more clear for future users.
However, I am able to reproduce what you're seeing with
saltutil.find_cached_jobwith a masterless minion. I need to look into that more to see what is going on there. The function appears to be working correctly when using a master/minion set up, but when running functions via salt-call, no jobs are getting populated in the/var/cache/salt/minion/minion_jobs/directory. Only jobs run viasaltare present there.rallytime commentedon May 6, 2016
@beardedeagle I have fixed the remaining issue with salt-call jobs not populating the local minion job cache. You can now query for jobs that were generated using salt-call.
See #33100 for the fix. Here's what the behavior looks like with that change:
beardedeagle commentedon May 9, 2016
Excellent. Looking at the pr. Thank you.
If cache_jobs: True is set, populate the local job cache
If cache_jobs: True is set, populate the local job cache when running…