Skip to content

Stop embedding master opts in relenv minion config to fix ARG_MAX - #70194

Open
twangboy wants to merge 1 commit into
saltstack:3008.xfrom
twangboy:fix/70186/3008.x
Open

Stop embedding master opts in relenv minion config to fix ARG_MAX#70194
twangboy wants to merge 1 commit into
saltstack:3008.xfrom
twangboy:fix/70186/3008.x

Conversation

@twangboy

Copy link
Copy Markdown
Contributor

What does this PR do?

salt.client.ssh.Single.__init__ set self.minion_opts["__master_opts__"] = self.context["master_opts"] for relenv targets, embedding the master's entire own config (395 keys in a typical test master) into the minion config file shipped to and read by salt-call on the remote target.

__master_opts__ is a master-side-only convention: every other reader of it (salt/client/ssh/wrapper/cmdmod.py, cp.py, publish.py, salt/client/ssh/state.py, salt/roster/__init__.py) pulls it from the Python wrapper opts dict while running on the master; nothing on the remote target ever reads it back out of its own minion config.

self.context["master_opts"] is an alias for the master's own opts, which gets mutated as nested Single/wrapper calls restore/adjust the master cachedir (#69605, #68458). Embedding it in the relenv minion config meant that config grew, unbounded, with every nested Single created during a single state run, until it exceeded the kernel's ARG_MAX and the ssh invocation failed with "Argument list too long".

Root-caused via a temporary debug patch tracing argv sizes across a full CI run — see #70186 for the full write-up and evidence (argv growth measured at ~20 KB → ~120 KB → ~207 KB within a single state.apply call before failing).

What issues does this PR fix or reference?

Fixes #70186

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

  • Docs
  • Changelog
  • Tests written/updated

Commits signed with GPG?

Yes

salt.client.ssh.Single.__init__ set
self.minion_opts["__master_opts__"] = self.context["master_opts"] for
relenv targets, embedding the master's entire own config (395 keys in a
typical test master) into the minion config file shipped to and read by
salt-call on the remote target.

__master_opts__ is a master-side-only convention: every other reader of
it (salt/client/ssh/wrapper/cmdmod.py, cp.py, publish.py,
salt/client/ssh/state.py, salt/roster/__init__.py) pulls it from the
Python wrapper opts dict while running on the master; nothing on the
remote target ever reads it back out of its own minion config.

self.context["master_opts"] is an alias for the master's own opts,
which gets mutated as nested Single/wrapper calls restore/adjust the
master cachedir (saltstack#69605, saltstack#68458). Embedding it in the relenv minion
config meant that config grew, unbounded, with every nested Single
created during a single state run, until it exceeded the kernel's
ARG_MAX and the ssh invocation failed with "Argument list too long".

Fixes saltstack#70186.
@twangboy
twangboy requested a review from a team as a code owner August 31, 2026 03:34
@twangboy twangboy self-assigned this Aug 31, 2026
@twangboy twangboy added the test:full Run the full test suite label Aug 31, 2026
@twangboy twangboy added this to the Argon v3008.3 milestone Aug 31, 2026
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