Scheduler config in pillar is broken for salt 0.17.5
I still have this exact same problem as Issue #6201 in salt 0.17.5 on CentOS 6.5
I have this in /srv/pillar/schedule.sls
schedule:
highstate:
function: state.highstate
minutes: 10
log-loadavg:
function: cmd.run
seconds: 30
args:
- 'logger -t salt < /proc/loadavg'
kwargs:
stateful: False
shell: True
And in /srv/pillar/top.sls I have this:
base:
'*':
- schedule
- collectd
- rsyslog
If I run salt "webnode1" pillar.data I can see this at the very end:
schedule:
----------
highstate:
----------
function:
state.highstate
minutes:
10
log-loadavg:
----------
args:
- logger -t salt < /proc/loadavg
function:
cmd.run
kwargs:
----------
shell:
True
stateful:
False
seconds:
30
I would expect at least to have the load average passed to the logs but it doesn't happen. Of course, if I run manually logger -t salt < /proc/loadavg it work fine.
How do I even debug?
Does the highstate run as expected every 10 minutes? Or do none of the scheduled functions run?
None of the scheduled functions run. I added both of them so I could see there is not somthing specific to the highstate and so I could debug faster.
On Thu, Feb 20, 2014 at 7:40 PM, Colton Myers [email protected]:
Does the highstate run as expected every 10 minutes? Or do none of the scheduled functions run?
Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/10621#issuecomment-35647936 .
Hi Guys, just confirming this is working for me, using 0.17.5 on Centos 6.5.
@rhormaza To double check, you're configuring the scheduler inside of Pillar in 0.17.5 and the scheduled functions are running correctly?
@basepi Yes, that's exactly how I'm doing it (using Pillar) and every works just fine.
Thanks for the update! I'll have to try to reproduce this myself, there may be just a small syntax error or something that's preventing @bogdanr from success.
does not work for me either... 0.17.5 @ ubuntu 12.04 pillar.items shows that scheduler is filled with highstate command exactly as bogdanr rote above and nothing gets executes (when schedule is defined via pillar)
it works if i move it to /etc/salt/minion ;-/
For those who still see broken behavior, can you please try running salt '*' saltutil.sync_all and see if it resolves the issue?
I upgrade to salt 2014.1.0 and even though the highstate function works, the cmd.run function still doesn't work even after running saltutil.sync_all.
I just installed a salt 2014.1.0 setup with a master and minion and a very similar config on a clean Debian 7.4 environment and it doesn't run anything from schedule. Both state.highstate and cmd.run don't work from schedule. Of course, they work when issued from the master. Even though they work when issued from the master I still get this message which seems to be wrong!?
[salt.crypt ][ERROR ] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
Scheduler definitely needs better logs. I really can't tell when it runs or not. When I was observing it earlier it never executed the highstate. Apparently at some point, probably after I pushed the highstate from the master the scheduler started to work but only for the highstate.
For the cmd.run function I would expect to see the load average in logs, just as I see it when I run the command manually but the logs are completely clean.
So, at some point after I pushed the highstate from the master, the scheduler started to run the highstate from the minion but not the cmd.run function.
So scheduler config in pillar seems to be working, but that particular cmd.run example is not. We'll definitely investigate this.
Additionally, you're right, we need to improve logging around scheduling so it's blatantly obvious what's going on.
Hi @bogdanr.
I tested your configuration today. The problem is in shell: True. The shell argument for cmd.run is to specify a shell in which to execute the given command -- not a boolean. If you take that out, the pillar scheduler works as designed. A stacktrace indicating the problem did appear on the master in my testing.
Please let me know if this works for you. Thanks!
Indeed, if I remove shell: True it works. Thanks a lot.
Still, please consider improving logging with the scheduler.
Most of the logging that's done with the scheduler is done at the debug level. I'll move some of the more important items up to the info level.