Repository navigation
Description
When a failover is detected by a minion it correctly fails over to the second master in the list. If the original master is fixed and then the secondary master is taken down the minion does not connect back to the original master.
As mentioned here: https://docs.saltstack.com/en/latest/topics/highavailability/index.html
" If the master does not respond, the minion will attempt to connect to the next master in the list. If the minion runs out of masters, the list will be recycled in case dead masters have been restored."
This does not seem to be happening. It detects the first master server dying.. but after that it does not.
Minion config:
master:
- smaster2-dusw.xxxx.com
- smaster1-dusw.xxxx.com
master_type: failover
master_alive_interval: 10
retry_dns: 0
The debug logs show that it has other errors and timeouts.. but doesn't properly detect the failed master
[DEBUG ] schedule.handle_func: Incrementing jobcount, now 2, maxrunning is 2
[DEBUG ] schedule.handle_func: The scheduled job __master_alive was not started, 2 already running
[DEBUG ] Handling event '_minion_mine\n\n\x85\xa5clear\xc2\xa3cmd\xa5_mine\xa4data\x80\xa2id\xafdusw1-content17\xa6_stamp\xba2016-01-06T19:05:06.160415'
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'dusw1-content17', 'tcp://172.31.47.127:4506', 'aes')
[DEBUG ] Initializing new SAuth for ('/etc/salt/pki/minion', 'dusw1-content17', 'tcp://172.31.47.127:4506')
[DEBUG ] SaltReqTimeoutError, retrying. (1/3)
[DEBUG ] SaltReqTimeoutError, retrying. (1/3)
[DEBUG ] SaltReqTimeoutError, retrying. (1/3)
[DEBUG ] SaltReqTimeoutError, retrying. (2/3)
[DEBUG ] SaltReqTimeoutError, retrying. (2/3)
[DEBUG ] SaltReqTimeoutError, retrying. (2/3)
[DEBUG ] SaltReqTimeoutError, retrying. (3/3)
[DEBUG ] SaltReqTimeoutError, retrying. (3/3)
[DEBUG ] SaltReqTimeoutError, retrying. (3/3)
[ERROR ] Unhandled exception running status.master
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/schedule.py", line 710, in handle_func
channel.send(load)
File "/usr/lib/python2.7/dist-packages/salt/utils/async.py", line 73, in wrap
ret = self._block_future(ret)
File "/usr/lib/python2.7/dist-packages/salt/utils/async.py", line 83, in _block_future
return future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 231, in send
ret = yield self._crypted_transfer(load, tries=tries, timeout=timeout)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 199, in _crypted_transfer
ret = yield _do_transfer()
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 185, in _do_transfer
tries=tries,
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "<string>", line 3, in raise_exc_info
SaltReqTimeoutError: Message timed out
[DEBUG ] schedule.handle_func: Removing /var/cache/salt/minion/proc/20160106190435406223
[ERROR ] Unhandled exception running status.master
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/schedule.py", line 710, in handle_func
channel.send(load)
File "/usr/lib/python2.7/dist-packages/salt/utils/async.py", line 73, in wrap
ret = self._block_future(ret)
File "/usr/lib/python2.7/dist-packages/salt/utils/async.py", line 83, in _block_future
return future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 231, in send
ret = yield self._crypted_transfer(load, tries=tries, timeout=timeout)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 199, in _crypted_transfer
ret = yield _do_transfer()
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 185, in _do_transfer
tries=tries,
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "<string>", line 3, in raise_exc_info
SaltReqTimeoutError: Message timed out
[DEBUG ] schedule.handle_func: Removing /var/cache/salt/minion/proc/20160106190445406152
[WARNING ] Unable to send mine data to master.
[DEBUG ] Handling event '__master_disconnected\n\n\x82\xa6_stamp\xba2016-01-06T19:09:05.604375\xa6master\xbasmaster1-dusw.xxxx.com'
[INFO ] Running scheduled job: __master_alive
[DEBUG ] schedule: This job was scheduled with jid_include, adding to cache (jid_include defaults to True)
[DEBUG ] schedule: This job was scheduled with a max number of 2
[DEBUG ] schedule.handle_func: Checking job against fun status.master: {'fun': 'mine.update', 'jid': '20160106190606192342', 'pid': 23297, 'id': 'dusw1-content17', 'schedule': '__mine_interval'}
[DEBUG ] schedule.handle_func: Checking job against fun status.master: {'fun': 'mine.update', 'jid': '20160106190506155653', 'pid': 23219, 'id': 'dusw1-content17', 'schedule': '__mine_interval'}
[DEBUG ] schedule.handle_func: Checking job against fun status.master: {'fun': 'status.master', 'jid': '20160106190905597199', 'pid': 23478, 'id': 'dusw1-content17', 'schedule': '__master_alive'}
[DEBUG ] schedule.handle_func: Incrementing jobcount, now 1, maxrunning is 2
[DEBUG ] schedule.handle_func: adding this job to the jobcache with data {'fun': 'status.master', 'jid': '20160106190906344335', 'pid': 23520, 'id': 'dusw1-content17', 'schedule': '__master_alive'}
[ERROR ] Exception in callback <functools.partial object at 0x7fc734412310>
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/tornado/ioloop.py", line 592, in _run_callback
ret = callback()
File "/usr/lib/python2.7/dist-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/tornado/ioloop.py", line 598, in <lambda>
self.add_future(ret, lambda f: f.result())
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 230, in wrapper
yielded = next(result)
File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1537, in handle_event
raise Exception()
Exception
[DEBUG ] Handling event '_minion_mine\n\n\x85\xa5clear\xc2\xa3cmd\xa5_mine\xa4data\x80\xa2id\xafdusw1-content17\xa6_stamp\xba2016-01-06T19:06:06.197242'
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'dusw1-content17', 'tcp://172.31.47.127:4506', 'aes')
[DEBUG ] Initializing new SAuth for ('/etc/salt/pki/minion', 'dusw1-content17', 'tcp://172.31.47.127:4506')
[DEBUG ] SaltEvent PUB socket URI: ipc:///var/run/salt/minion/minion_event_a6604d7069_pub.ipc
[DEBUG ] SaltEvent PULL socket URI: ipc:///var/run/salt/minion/minion_event_a6604d7069_pull.ipc
[DEBUG ] Sending event - data = {'_stamp': '2016-01-06T19:09:06.359705', 'master': 'smaster2-dusw.xxxx.com'}
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'dusw1-content17', 'tcp://172.31.47.127:4506', 'aes')
[DEBUG ] Initializing new SAuth for ('/etc/salt/pki/minion', 'dusw1-content17', 'tcp://172.31.47.127:4506')
[DEBUG ] Error deleting fd from IOLoop
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/tornado/ioloop.py", line 715, in remove_handler
self._impl.unregister(fd)
File "/usr/lib/python2.7/dist-packages/zmq/eventloop/ioloop.py", line 125, in unregister
return self._poller.unregister(fd)
File "/usr/lib/python2.7/dist-packages/zmq/sugar/poll.py", line 80, in unregister
idx = self._map.pop(socket)
KeyError: None
[DEBUG ] SaltReqTimeoutError, retrying. (1/3)
[DEBUG ] SaltReqTimeoutError, retrying. (1/3)
[DEBUG ] SaltReqTimeoutError, retrying. (2/3)
[DEBUG ] Error deleting fd from IOLoop
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/tornado/ioloop.py", line 715, in remove_handler
self._impl.unregister(fd)
File "/usr/lib/python2.7/dist-packages/zmq/eventloop/ioloop.py", line 125, in unregister
return self._poller.unregister(fd)
File "/usr/lib/python2.7/dist-packages/zmq/sugar/poll.py", line 80, in unregister
idx = self._map.pop(socket)
KeyError: None
[DEBUG ] SaltReqTimeoutError, retrying. (2/3)
[DEBUG ] SaltReqTimeoutError, retrying. (3/3)
[DEBUG ] SaltReqTimeoutError, retrying. (3/3)
[WARNING ] Unable to send mine data to master.
[DEBUG ] Handling event '_minion_mine\n\n\x85\xa5clear\xc2\xa3cmd\xa5_mine\xa4data\x80\xa2id\xafdusw1-content17\xa6_stamp\xba2016-01-06T19:11:06.310601'
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'dusw1-content17', 'tcp://172.31.47.127:4506', 'aes')
[DEBUG ] Initializing new SAuth for ('/etc/salt/pki/minion', 'dusw1-content17', 'tcp://172.31.47.127:4506')
[ERROR ] Unhandled exception running status.master
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/schedule.py", line 710, in handle_func
channel.send(load)
File "/usr/lib/python2.7/dist-packages/salt/utils/async.py", line 73, in wrap
ret = self._block_future(ret)
File "/usr/lib/python2.7/dist-packages/salt/utils/async.py", line 83, in _block_future
return future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 231, in send
ret = yield self._crypted_transfer(load, tries=tries, timeout=timeout)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 199, in _crypted_transfer
ret = yield _do_transfer()
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python2.7/dist-packages/salt/transport/zeromq.py", line 185, in _do_transfer
tries=tries,
File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "<string>", line 3, in raise_exc_info
SaltReqTimeoutError: Message timed out
[DEBUG ] schedule.handle_func: Removing /var/cache/salt/minion/proc/20160106190906344335
Salt info
Salt Version:
Salt: 2015.8.3
Dependency Versions:
Jinja2: 2.7.2
M2Crypto: 0.22
Mako: 0.9.1
PyYAML: 3.10
PyZMQ: 14.0.1
Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.4
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.2
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.3.0
mysql-python: 1.2.3
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: Ubuntu 14.04 trusty
machine: x86_64
release: 3.13.0-74-generic
system: Ubuntu 14.04 trusty
Activity
jakehilton commentedon Jan 6, 2016
I do see an event from above where it seem to notice the master is disconnected.. but then it throws an exception
mou commentedon Feb 2, 2016
Is it possible what problem hides in next rows? For me it's looks like replacing list of masters from config with a single value.
cachedout commentedon Feb 2, 2016
Likely already fixed here: #30796
mou commentedon Feb 2, 2016
Thanks @cachedout. Was this fix released?
cachedout commentedon Feb 2, 2016
@mou No. It was merged just this morning.
mou commentedon Feb 2, 2016
Think i was wrong. But there are still assignment to self.opts['master']. What does yield returns? Does it return a list if there was a list of masters?
Ch3LL commentedon Feb 4, 2016
I tested this new change and it introduces a new problem, now it won't even failover once. Test case:
4.. the minion does not even fail over now. I just see the following:
And I have let this sit for 20 minutes with no successful failover.
Here are my settings:
I also tested the following test-case:
And i'm seeing similar behavior as it never fails over and i just continue to see
Process manager iterationin the logDmitryKuzmenko commentedon Feb 26, 2016
#31512 together with #30796 fix this.
I've tested this case on develop branch.