Skip to content

Surface per-minion detail when salt.state orchestrate fails (#68326)#69425

Open
dwoz wants to merge 1 commit into
saltstack:3006.xfrom
dwoz:fix/issue-68326
Open

Surface per-minion detail when salt.state orchestrate fails (#68326)#69425
dwoz wants to merge 1 commit into
saltstack:3006.xfrom
dwoz:fix/issue-68326

Conversation

@dwoz

@dwoz dwoz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds per-minion failure detail to the comment that salt.state writes when an orchestrate target minion fails to return a state-result dict, so operators see why an orchestrate run failed instead of just Run failed on minions: <minion>.

What issues does this PR fix or reference?

Fixes #68326

Previous Behavior

When salt-run state.orchestrate targeted a minion that returned False (e.g. state.sls hit a pre-compilation error, a queue conflict, or the master-level saltutil.cmd flagged the response as failed with no useful payload), the orchestrate state reported only:

Comment: Run failed on minions: <minion>
Changes:
  <minion>:
    False

with no indication of what False meant or what actually went wrong on the wire. The reporter had no way to diagnose without re-running with extra logging.

New Behavior

When the minion's return value is not a state-result dict the orchestrate comment now appends a per-minion detail line, distinguishing three cases:

  • the minion did not return a state result at all,
  • the minion returned a list of error strings (queue conflict, pillar errors, etc.), and
  • the minion returned a scalar (typically False) instead of a state result.

For example, the reporter's scenario now produces:

Comment: Run failed on minions: 10.xx.91.215
         Minion 10.xx.91.215 returned False instead of a state result.

When the minion did return a valid state-result dict (the historical happy-path-with-failed: True shape covered by the existing test_state_failed_and_expected_minions), the comment text is unchanged because the structured changes payload already speaks for itself.

Merge requirements satisfied?

  • Docs
  • Changelog
  • Tests written/updated

Commits signed with GPG?

Yes

@dwoz dwoz requested a review from a team as a code owner June 12, 2026 00:14
@dwoz dwoz added this to the Sulphur v3006.26 milestone Jun 12, 2026
@dwoz dwoz added the test:full Run the full test suite label Jun 12, 2026
@dwoz dwoz force-pushed the fix/issue-68326 branch from 6282984 to bf03dfb Compare June 12, 2026 23:17
When a minion targeted by the salt.state orchestrate state returned
False (e.g. state.sls hit a pre-compilation error or the master-level
saltutil.cmd response was flagged failed with no useful ret payload),
the orchestrate run reported only "Run failed on minions: <minion>"
and an opaque False in changes. Operators had to re-run with extra
logging to find out anything about why their orchestrate failed.

Capture per-minion failure detail during the loop over cmd_ret and
append it to the orchestrate comment. The detail distinguishes three
cases:

- the minion returned no usable ret at all,
- the minion returned a list of error strings (queue conflict, pillar
  errors, etc.), and
- the minion returned a scalar (typically False) instead of a state
  result.

A new helper, _format_failure_detail, encapsulates the formatting and
deliberately returns an empty string when the minion's ret is a dict so
the existing pre-existing comment shape ("Run failed on minions: X") is
preserved for that path; the structured changes payload already speaks
for itself there.

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

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant