Skip to content

cluster bootstrap emits hard ERROR logs on every minion startup when Raft is still catching up #70727

Closed

Description

@dwoz

Observed behavior

On every bringup of a salt-master cluster, each minion emits three hard [ERROR] lines during the race window where the minion authenticates before the clustered master's Raft has caught up:

[ERROR   ] Master did not return a session key for pillar request (cluster not ready)
[ERROR   ] Error while bringing up minion for multi-master. Is master at 10.77.0.11 responding? The error message was Exception getting pillar.
Traceback (most recent call last):
  ...
salt.exceptions.SaltClientError: Exception getting pillar.
[ERROR   ] This Minion was scheduled to stop. Not running Minion.tune_in()

The minion retries and eventually connects, and the cluster reaches steady state. But operators reviewing minion logs see three ERROR stacks every bringup and reasonably assume something went wrong.

Root cause chain

  1. salt/channel/client.py:269 — AsyncReqChannel.crypted_transfer_decode_dictentry raises AuthenticationError("Master did not return a session key for pillar request (cluster not ready)") when the master defers with the cluster_retry sentinel. This is intentional (PR Retry a clustered master's deferral instead of decrypting it #70564) — the sentinel means "my Raft isn't ready, retry shortly."
  2. salt/pillar/__init__.py:271-273 — catches this AuthenticationError, logs exc.message at log.error, re-raises as SaltClientError("Exception getting pillar.").
  3. salt/minion.py:1985-1991 — _connect_minion catches SaltClientError and logs log.error("Error while bringing up minion for multi-master. Is master at %s responding?...", exc_info=True), calls minion.destroy(), sleeps, and loops.
  4. minion.destroy() sets self._running = False. On the next (successful) iteration, minion.tune_in(start=False) calls _pre_tune() which sees _running is False and logs log.error("This Minion was scheduled to stop. Not running Minion.tune_in()") — then returns without binding.

Step 4 is actually a latent correctness bug: the retry-after-destroy path never rebinds. In practice the minion survives because a sibling _connect_minion task (for another master) succeeds without having gone through the retry/destroy path. But the log line is misleading AND the retry-and-recover case silently loses that master connection.

Proposed fix

  • salt/pillar/__init__.py: when the AuthenticationError carries the cluster-not-ready sentinel, log at DEBUG instead of ERROR. The condition is a routine, self-healing transient during bringup.
  • salt/minion.py::_connect_minion: detect the cluster-not-ready SaltClientError and log at INFO with a short message ("master still catching up, retrying") instead of a full log.error(..., exc_info=True) traceback. Non-cluster errors keep the existing ERROR path.
  • salt/minion.py::_connect_minion: reset self._running = None after destroy() so the next successful iteration doesn't trip the "scheduled to stop" branch and actually binds the minion.

Reproduction

tests/monitoring/cluster-5node/ in the salt repo — bring up stack cold, docker logs c5-salt-minion-1 shows all three ERROR lines on every startup.

Impact

  • Operators report spurious failures from routine startups.
  • Silent correctness gap: the retry-and-recover path on the first master never binds that minion instance (hidden by sibling masters succeeding).
  • No functional outage observed because sibling master tasks keep the minion alive; failover still works.

Fix target: 3008.x.

Activity

  1. added this to the Argon v3008.7 milestone on Nov 7, 2026
  2. dwoz commented on Nov 10, 2026

    @dwoz
    ContributorAuthor

    Resolved by #70756 (merge commit a40f817 on 3008.x).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions