salt '*' highstate returns 'minion did not return', salt [minion] highstate works
There's an apparent difference in targeting '*' and a host directly. (0.17.2 all the way now)
I have this state that updates salt to the latest version:
salt-minion:
pkg:
- latest
- order: last #zodat een upgrade niet de states halvewege vernielt
service.running:
- require:
- pkg: salt-minion
- enable: true
- watch:
- file: /etc/salt/minion.d/id.conf
- file: /etc/salt/minion.d/tcp-keepalive.conf
It should be a no-op, since I'm on the latest version (I checked this time :)
It returns with a no-op when targeted directly, but it doesn't return at all when targeted with '*'. It does run, I can see that because I run the minion on the console with salt-minion -d debug.
So, to re-iterate:
salt '*' state.sls all-salt-minion-config
gives me
[lots of output]
idd0010:
Minion did not return
[more output]
but
salt idd0010 state.sls all-salt-minion-config
gives me
root@salt-master:/home/salt/conf# salt idd0010 state.sls all-salt-minion-config
Executing job with jid 20131119222944774230
-------------------------------------------
Execution is still running on idd0010
idd0010:
Summary
-----------
Succeeded: 0
Failed: 0
-----------
Total: 0
Complete output from salt-minion -d debug is on http://pastebin.com/10h2YETr
That's very strange. Is it just the one minion that is acting this way? And have you modified the default timeout at all? What OS is the minion?
Ubuntu 12.04, all the way. No, it happens across all minions. Haven't edited the timeout afaik.
Stranger still! The only difference between '*' targeting and exact match targeting is that we only wait for the required minions to return in the latter case. I can't imagine why the targeting would be affecting this output. I'll have to think about this.
What timeouts are there to tune by the way? A 'ls' works for all minions, for example.
The weird part is that (I always run with -v, aliased 'salt' as 'salt -v') the periodic logging of 'Execution is still running on XXX' batches of servers get progressively smaller, if you get my drift.
With salt -v -t 60 I do get results. Is it perhaps that there is a max to the number of times a minion is queried?
What kind of networking setup do you have? Could it be an issue of salt not gracefully failing to communicate with minions?
Nothing changed (AFAIK) to the network setup recently. However: Most of the minions are VMs, distributed over seven physical servers (also minions), distributed over two locations. Between the locations is a layer2 VPN, so that all minions see the same internal network.
The second location is quite small, I would recognize the set of minions over there. Everything else is either on the same switch or even on the same physical machine. I don't think the network is an issue, there's no high amounts of traffic on the times I see this (backups are overnight).
I am not claiming something has changed with your network that now prevents salt to work. I'm claiming that salt might have had a regression regarding how it communicates with other minions. What happens when you disconnect the VPN?
Can you show us the logs of a hanging minion? Can you show us system logs?
I also experienced this bug. Unfortunatelly it's not directly replicable. In the next run the minion returns. I'm targeting all (~10) minions. In the next run the minion return without problems. I try to increase the timeout to 120s and see if it appears again. But it looks that it "does not respond" much later than current timeout of 5s.
This bug affects me as well :( 2014.1.3
@zamotivator Can you elaborate? Does it happen every time? Same minions? Reproducible?
@basepi #12246
@zamotivator Ah, thanks.
@basepi
I think this bug is the "salt randomly does nothing" bug that I've complained about.
$ salt 'specific-machine' state.sls specific-state
real 0m9.794s
user 0m0.523s
sys 0m0.150s
I've had trouble reporting it in the past because it only happens one in hundreds of times and I've not been able to reproduce it before. Finally, it was happening repeatedly so I ran with -ldebug:
$ salt -ldebug 'specific-machine' state.sls specific-state
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/disable-state-events.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/disable-state-events.conf
[DEBUG ] Missing configuration file: /home/pwaller/.salt
[DEBUG ] Configuration file path: /etc/salt/master
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/disable-state-events.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/disable-state-events.conf
[DEBUG ] Missing configuration file: /home/pwaller/.salt
[DEBUG ] LocalClientEvent PUB socket URI: ipc:///var/run/salt/master/master_event_pub.ipc
[DEBUG ] LocalClientEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc
[DEBUG ] Checking whether jid 20140618160754499734 is still running
[DEBUG ] get_returns for jid 20140618160759507638 sent to set(['specific-machine']) will timeout at 17:08:01
[INFO ] jid 20140618160759507638 minions set(['specific-machine']) did not return in time
real 0m9.844s
user 0m0.504s
sys 0m0.222s
In this case, it turns out the minion had stopped on specific-machine. It's unhelpful that salt gives no indication as to what is wrong. And it has definitely happened in the past when the minion was running.
Well, keep us posted if it happens again when the minion is running. Hopefully we'll be able to track down what's going wrong there.
I have a feeling that it must be the minion crashing or being killed by the OOM killer or something of this form. My complaint is that the salt master doesn't give any output to tell you what might have gone wrong.
And then there is nothing in the logs to indicate something went wrong.
Since it's pretty rare, we should prepare now rather than wait until it next happens. What should I do to prepare the system for understanding what's wrong? The minion is very quiet by default, which I find surprising.
So there's nothing in the minion config, or nothing in the master config?
This is relevant for reporting back to master: #11631
As far as the minion goes, if there was an uncaught exception or something, I would definitely expect it to be in the log. Maybe change the log to debug mode on your minions in the hopes that there's information there? I'm not sure I've ever heard of a minion just stopping without putting anything in the logs, unless it was stopped externally, maybe.
I keep seeing this fairly regularly with windows minions in 2014.1.4 :(
I observe this on 2014.1.10: salt '' state.highstate : returns nothing, no errors in master nor minion logs. salt -v '' state.highstate : Lots of "Minion did not return". Usually only 1 or 2 minions respond properly. Still nothing in logs. salt -v -t 10 '*' state.highstate : Problem solved!(?)
Highstate is kind of a promise all hosts are OK, so I find this critical for the confidense in Saltstacks ability to keep the systems in a controlled state.