You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If a minion is setup in Multi-Master mode and each master is a domain name and none of the domain names can be resolved then the minion only continues to try the last master and never attempts to try the first one again, even if the master_failback parameter is set.
Please be as specific as possible and give set-up details.
on-prem machine
VM (Virtualbox, KVM, etc. please specify)
VM running on a cloud service, please be explicit and add details
container (Kubernetes, Docker, containerd, etc. please specify)
or a combination, please be explicit
jails if it is FreeBSD
classic packaging
onedir packaging
used bootstrap to install
Steps to Reproduce the behavior
Don't setup master on network to simulate master being down or disconnected.
Setup minion with the configuration file above and run salt-minion.
Expected behavior
Minion fails back to trying to resolve first master if it cannot resolve the last master (because the first master might now be up).
Versions Report
salt --versions-report
No difference in salt versions between master and minion.
Salt Version:
Salt: 3007.0Python Version:
Python: 3.10.13 (main, Feb 19 2024, 03:31:20) [GCC 11.2.0]Dependency Versions:
cffi: 1.16.0cherrypy: 18.8.0dateutil: 2.8.2docker-py: Not Installedgitdb: Not Installedgitpython: Not InstalledJinja2: 3.1.3libgit2: Not Installedlooseversion: 1.3.0M2Crypto: Not InstalledMako: Not Installedmsgpack: 1.0.7msgpack-pure: Not Installedmysql-python: Not Installedpackaging: 23.1pycparser: 2.21pycrypto: Not Installedpycryptodome: 3.19.1pygit2: Not Installedpython-gnupg: 0.5.2PyYAML: 6.0.1PyZMQ: 25.1.2relenv: 0.15.1smmap: Not Installedtimelib: 0.3.0Tornado: 6.3.3ZMQ: 4.3.4Salt Package Information:
Package Type: onedirSystem Versions:
dist: ubuntu 22.04.4 jammylocale: utf-8machine: x86_64release: 6.5.0-28-genericsystem: Linuxversion: Ubuntu 22.04.4 jammy
Additional context
I help to manage 50 laptops we use for various events. The setup has to be flexible and work on different networks so we try to use multicast DNS names for resolution. Some networks don't support mDNS but do resolve the hostname. Therefore, we've found decent success by including both the salt-master's hostname and its hostname.local. Unfortunately neither of these name resolution techniques are very reliable so it would be useful for the salt minions to continue to try both rather than just the last one.
Potentially why this is occurring
Without diving too deep into the code base here is what I've observing:
At line 687 in Minion.py, opts["master"] which originally was a list is set to just one of the masters: opts["master"] = master
Since none of the master names get resolved the error on line 702 is raised: raise SaltClientError(msg)
The coroutine waits according to acceptance_wait_time parameter in minion config
The routine loop repeats and the eval_master is called and since opts["master"] is now a string the conditional on line 600: elif isinstance(opts["master"], str) and ("master_list" not in opts): is taken instead of the failed conditional on line 611: elif failed: which would set opts["master"] back to the list.
Potential Solution
I don't plan on opening a pull request since I am not familiar enough with Salt to know if this break anything else but changing line 600 in minion.py to elif isinstance(opts["master"], str) and ("master_list" not in opts) and not failed: seemed to fix the issue.
Temporary Workaround
Adding an IP address such as 127.0.0.1 to the list of masters fixes this issue.
The text was updated successfully, but these errors were encountered:
Description
If a minion is setup in Multi-Master mode and each master is a domain name and none of the domain names can be resolved then the minion only continues to try the last master and never attempts to try the first one again, even if the master_failback parameter is set.
Setup
minion config:
Please be as specific as possible and give set-up details.
Steps to Reproduce the behavior
Expected behavior
Minion fails back to trying to resolve first master if it cannot resolve the last master (because the first master might now be up).
Versions Report
salt --versions-report
No difference in salt versions between master and minion.Additional context
I help to manage 50 laptops we use for various events. The setup has to be flexible and work on different networks so we try to use multicast DNS names for resolution. Some networks don't support mDNS but do resolve the hostname. Therefore, we've found decent success by including both the salt-master's hostname and its hostname.local. Unfortunately neither of these name resolution techniques are very reliable so it would be useful for the salt minions to continue to try both rather than just the last one.
Potentially why this is occurring
Without diving too deep into the code base here is what I've observing:
opts["master"]
which originally was a list is set to just one of the masters:opts["master"] = master
raise SaltClientError(msg)
acceptance_wait_time
parameter in minion configopts["master"]
is now a string the conditional on line 600:elif isinstance(opts["master"], str) and ("master_list" not in opts):
is taken instead of the failed conditional on line 611:elif failed:
which would setopts["master"]
back to the list.Potential Solution
I don't plan on opening a pull request since I am not familiar enough with Salt to know if this break anything else but changing line 600 in minion.py to
elif isinstance(opts["master"], str) and ("master_list" not in opts) and not failed:
seemed to fix the issue.Temporary Workaround
Adding an IP address such as 127.0.0.1 to the list of masters fixes this issue.
The text was updated successfully, but these errors were encountered: