Skip to content

AsyncPubChannel.connect() uses wrong default for publish_port (4506 instead of 4505) #70724

Closed

Description

@dwoz

Description

salt/channel/client.py in AsyncPubChannel.connect() decides between the operator-provided minion-side publish_port and the master-reported value with:

if int(self.opts.get("publish_port", 4506)) != 4506:
    publish_port = self.opts.get("publish_port")
# else take the relayed publish_port master reports
else:
    publish_port = self.auth.creds["publish_port"]

The fallback default 4506 is the ret port. The publish port default is 4505. The intent (per the comment on the else branch) is: if the operator explicitly overrode publish_port, trust them; otherwise fall through to the master-reported value.

Impact

In the common case the minion config has publish_port: 4505 (either explicitly or by default). The condition int(4505) != 4506 evaluates True, so AsyncPubChannel.connect() takes the minion-side value and ignores the master-reported publish_port entirely. Master-topology / cluster setups where the publisher advertises a non-default port never see it applied on minions that stuck with the default.

Fix

Change the sentinel from 4506 to 4505 so the default-vs-override check uses the correct publish-port default.

Context

Discovered during investigation of #66846 (status.master() using the wrong port). The two bugs are in the same code chain but are isolated fixes.

Activity

  1. welcome commented on Nov 7, 2026

    @welcome

    Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey.
    Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

    There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
    If you have additional questions, email us at [email protected]. We're glad you've joined our community and look forward to doing awesome things with you!

  2. added this to the Argon v3008.7 milestone on Nov 7, 2026
  3. 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