(Translated by https://www.hiragana.jp/)
[BUG] beacons module do not load if the first master in multimaster list is not reachable when minion starts · Issue #66717 · saltstack/salt · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] beacons module do not load if the first master in multimaster list is not reachable when minion starts #66717

Open
amalaguti opened this issue Jul 15, 2024 · 2 comments
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@amalaguti
Copy link

amalaguti commented Jul 15, 2024

Description
I created a custom beacon module and noticed that in my Windows and Linux minions, which are set using multimaster list, if the first master in the list is not reachable/available when the minion starts, the beacon module does not load, despite the second master being available and the minion responding to this master.

Setup
Set minion in multimaster (active/active), create and deploy a custom beacon module, sync/provision the module to the Windows minion, stop the minion, stop the master service on the first master, start the minion service, check the minion log, despite the minion connected to the second master, the beacon module is not loaded.

This can be workaround by using the minion config option beacons_before_connect: True. But maybe not ideal in all cases.

I think the beacon module should load if any of the masters is reachable.

@amalaguti amalaguti added Bug broken, incorrect, or confusing behavior needs-triage labels Jul 15, 2024
@dwoz
Copy link
Contributor

dwoz commented Jul 30, 2024

@amalaguti Can you provide the version you are running please?

@amalaguti
Copy link
Author

amalaguti commented Jul 30, 2024

@dwoz Salt Minion is on Windows, 3006.8. Master is 3007.1

Additional info, as said, beacon won't load if the first master is not available, even the minion is connect to the 2nd master on start.
A few seconds after the first master is started up, and the minion is able to establish connection, the beacon is triggered in the given interval. So definetely it's waiting for the first master to be enabled

Here a trivial beacon module, does nothing else than running test.version, it does not send events.

import logging
import salt.utils.beacons

__virtualname__ = "saltversion"
log = logging.getLogger(__name__)


def validate(config):
    """
    Beacon config validation
    """
    config = salt.utils.beacons.list_to_dict(config)

    if not isinstance(config, dict):
        msg = "config is not valid, must be a dict"
        log.error("Beacon error: %s" % msg)
        return False, msg

    return True, "valid config"


def beacon(config):
    """
    Execute test.version
    """
    events = []
    ret = __salt__["test.version"]()
    log.info(">>>> Salt version: %s" % ret)

    return events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

2 participants