Agent does not rejoin the Swarm agent cluster after overlay connectivity returns
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- docker, go, kubernetes
調査の方向性
Start with serf/cluster.go, especially the startup Join attempt cited in the issue, and check how the agent discovers peers after an initial failure. The issue points to Serf's reconnect behavior in v0.8.3 as relevant context. Reproduce the blocked-overlay startup, restore connectivity, and confirm the agent rejoins without a restart and the reported cluster membership and /info requests recover.
索引モデルが issue の本文から書いたものです。
説明
A Portainer Agent remains outside the agent cluster even though its container is running and /ping returns 204. Restarting only the affected agent restores membership and access through Portainer.
Reproduction and observations
-
Start with a working multi-node Swarm and Portainer agents.
-
On one test worker, temporarily block inbound and outbound VXLAN traffic.
iptables -I INPUT 1 -p udp --dport 4789 -j DROP iptables -I OUTPUT 1 -p udp --dport 4789 -j DROP -
Stop its agent container and let Swarm create a replacement.
-
Keep the network blocked until the new agent starts its API. In my test, DNS returned peer addresses and DROP counters increased, but the agent logged only its own join. About five minutes later, while still blocked, its API started. Identities below are placeholders:
[INFO] serf: EventMemberJoin: worker-a-111111111111 192.0.2.10 INF github.com/portainer/agent/http/server.go:96 > starting Agent API server | api_version=2.27.9 server_addr=0.0.0.0 server_port=9001 use_tls=true -
Remove the block:
iptables -D INPUT -p udp --dport 4789 -j DROP iptables -D OUTPUT -p udp --dport 4789 -j DROP -
Check recovery. After the block was removed, both rules were absent, the same process was running, and
/pingon 9001 returned 204 and TCP 7946 connected in both directions between the agent's network namespace and a manager. Yet no further joins appeared, and the agent logged:ERR github.com/portainer/agent/http/handler/docker/docker_operation.go:70 > unable to redirect request to a manager node: no manager node found | request=/infoThe cluster diagnostic reported only this agent as
notInCluster. The membership gap was visible from both sides:-
Other agents could not find the affected worker. Targeted Inspect (
nodeNameandX-PortainerAgent-Target) returned HTTP 500:{"message":"The agent was unable to contact any other agent","details":"Unable to find the targeted agent"} -
The affected worker could not find a manager to handle
/info. Opening the environment in the WebUI failed with Failed loading environment / Unable to connect to the Docker environment (this was the original symptom that prompted this issue):Of 32 requests to
/api/endpoints/7/docker/v1.41/info, 15 returned HTTP 500, while 17 succeeded:{"message":"The agent was unable to contact any other agent located on a manager node","details":"Unable to find an agent on any manager node"}
Port 9001 is published in ingress mode; an ingress connection to the affected worker was present during the failures.
-
-
Stop only the affected agent again. After Swarm replaced it, membership was restored and targeted Inspect of the replacement returned HTTP 200. All 32 of 32 subsequent
/inforequests returned HTTP 200. No Docker daemon or host restart was needed.
Expected: the agent rejoins after connectivity returns, without an operator restart.
Environment
- Portainer Agent 2.27.9, deployed as a global Swarm service; all other agents run the same version.
- Docker Engine 28.1.1, Linux.
- Portainer Server 2.28.1.
P.S. I know Portainer requires matching Agent and Server versions, but agents discover each other without involving the Server. I have also seen the same symptom on another cluster with matching versions, but that cluster isn't available for reproduction tests.
Cause analysis
In 2.27.9, startup attempts Join once and continues on failure. Serf reconnects only to previously known failed members, so an isolated startup appears to leave the agent without a recovery path.
- 主要言語
- Go
- スター
- 596
- フォーク
- 98
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
portainer/agent のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
-
[Feature Request] Allow Portainer Agent to Ignore Swarm Mode When Used Only for Overlay Networkingオープン
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
portainer/agent の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
slavakurilyak/awesome-ai-agents#1005 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
agent-research-finding chore
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jordansmall/spindrift#7370 ·
メンテナーはふだん 1 日以内に返信
-
☢️ Bug v3
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
The repo's gates check is clean and runs need no swaps対応中かも @turbot-agent-fleet が今日担当しました。 オープンagent:ready
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
turbot/tailpipe#677 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信