3008.x: TCP transport auth broken — 'NoneType' object has no attribute 'check_autoreject'
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
salt/channel/server.py の channel の _auth パスから始め、続いてその AuthFuncs のセットアップを salt/master.py の AuthFuncs.init と比較します。transport: tcp で再現し、NoneType エラーなしで認証が完了することと、salt '*' test.ping が成功することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Description
On 3008.x with transport: tcp, minion auth fails with:
[ERROR] Task exception was never retrieved
future: <Task finished ... exception=AttributeError("'NoneType' object has no attribute 'check_autoreject'")>
Traceback ...
File ".../salt/channel/server.py", line 647, in _auth
return af._auth(load, sign_messages, version)
File ".../salt/master.py", line 3173, in _auth
ret = self._auth_impl(...)
File ".../salt/master.py", line 3279, in _auth_impl
auto_reject = self.auto_key.check_autoreject(load["id"])
AttributeError: 'NoneType' object has no attribute 'check_autoreject'
No minion can complete auth; every _auth request fails; salt '*' test.ping times out.
Root cause
salt/channel/server.py:638-645 constructs an AuthFuncs instance via __new__ (skipping __init__) and copies attributes from self:
af = salt.master.AuthFuncs.__new__(salt.master.AuthFuncs)
af.opts = self.opts
af.cache = self.cache
af.event = self.event
af.master_key = self.master_key
af.sessions = self.sessions
af.auto_key = getattr(self, "auto_key", None) # <-- defaults to None
af.cache_cli = getattr(self, "cache_cli", False)
af.ckminions = getattr(self, "ckminions", None)
return af._auth(load, sign_messages, version)
self here is the channel instance. It never assigns self.auto_key anywhere, so getattr(..., None) returns None. Then AuthFuncs._auth_impl calls self.auto_key.check_autoreject(...) and crashes.
AuthFuncs.__init__ (salt/master.py:3086) does self.auto_key = salt.daemons.masterapi.AutoKey(self.opts) — but that's the init path, which the channel bypasses by using __new__ + manual attribute copy.
Same problem for ckminions: the channel copies getattr(self, "ckminions", None), but AuthFuncs.__init__ conditionally sets it based on con_cache opt.
Reproduction
# /etc/salt/master
transport: tcp
auto_accept: True
open_mode: True
Start master + one minion (also on transport: tcp). Minion loops on:
salt.exceptions.SaltClientError: Unable to sign_in to master: Attempt to authenticate with the salt master failed with timeout error
Every auth attempt raises the AttributeError on the master side and is never returned to the client.
Suggested fix
In salt/channel/server.py, the channel needs to either:
- Construct
AuthFuncsproperly via__init__(letting it initializeauto_key,ckminions, etc. correctly), or - Initialize
self.auto_key = salt.daemons.masterapi.AutoKey(self.opts)and the ckminions branch in the channel's own__init__sogetattr(self, ...)finds them.
Only affects transport: tcp (and presumably transport: ws). ZMQ transport is unaffected because it goes through a different auth path.
Version: 3008.2+152.g4a10864f6a (CI RPM from PR #69908).
- 主要言語
- Python
- スター
- 15.8k
- フォーク
- 5.6k
- 平均マージ
- 5日 9時間
- マージ済み PR(30日)
- 99
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
saltstack/salt のほかの issue
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme load対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
saltstack/salt#70789 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
[Bug]: pip.installed with upgrade=True upgrades a package but returns an empty changes dictionary対応中かも @ITJamie が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
[Bug]: Minion with file_client: local crashes on connect: 'AsyncPillar' object has no attribute 'aclose'対応中かも @shawnrruss が 9 日前に担当しました。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
[Bug]: mine.update clear=True raises UnboundLocalError on the master and stores nothing対応中かも @cestercian が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
saltstack/salt#70622 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
似ている issue
-
AI bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AUTO-MAS-Project/AUTO-MAS#1960 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
btclib-org/btclib-wallet#872 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
btclib-org/btclib#3093 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
patrickballard/wheelgap#269 ·