Skip to content

fix: initialize self.tok on sub-proxies to prevent AttributeError [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #70073

Open
waterWang wants to merge 1 commit into
saltstack:masterfrom
waterWang:salt-70071-tok
Open

fix: initialize self.tok on sub-proxies to prevent AttributeError [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]#70073
waterWang wants to merge 1 commit into
saltstack:masterfrom
waterWang:salt-70071-tok

Conversation

@waterWang

Copy link
Copy Markdown

What does this PR do?

Fixes #70071 — deltaproxy sub-proxies raise AttributeError: 'ProxyMinion' object has no attribute 'tok' when dispatching events.

Why?

Sub-proxies are constructed via ProxyMinion(proxyopts) directly in subproxy_post_master_init and never run connect_master, so self.tok is never set by the usual master-connection path. Any code path that references self.tok (e.g. _fire_master_prepare, _register_resources, _mine_send) raises AttributeError.

Fix

Set _proxy_minion.tok = None after construction in subproxy_post_master_init. This is safe because the channel layer's _package_load regenerates the token via self.auth.gen_token(b"salt") on every send, overwriting whatever value was in the load dict.

Tests

  • test_subproxy_post_master_init_packs_per_minion_grains already exercises the sub-proxy creation path; added assertion that _proxy_minion.tok is set (not AttributeError).

New behavior

Sub-proxies can now fire events to the master without raising AttributeError.

Sub-proxies are constructed via ProxyMinion(proxyopts) directly in
subproxy_post_master_init and never run connect_master, so self.tok
is never set by the usual master-connection path. Any event path
that references self.tok (e.g. _fire_master_prepare, _register_resources,
_mine_send) raises AttributeError.

Setting tok=None is safe because the channel layer's _package_load
regenerates the token via self.auth.gen_token(b"salt") on every send,
overwriting whatever value was in the load dict.

Fixes saltstack#70071
@waterWang
waterWang requested a review from a team as a code owner August 17, 2026 07:42

@twangboy twangboy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this against the 3008.x branch. Also, this needs a test and a changelog.

@twangboy twangboy added the test:full Run the full test suite label Aug 18, 2026
@twangboy twangboy added this to the Argon v3008.3 milestone Aug 18, 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.

# [BUG] deltaproxy: sub-proxies raise AttributeError 'tok' when dispatching events (3008 asyncio port)

2 participants