Agent does not rejoin the Swarm agent cluster after overlay connectivity returns
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- docker, go, kubernetes
- Ambito
- backend, distributed-systems
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 596
- Fork
- 98
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di portainer/agent
-
Diskusage not availableAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
-
[Feature Request] Allow Portainer Agent to Ignore Swarm Mode When Used Only for Overlay NetworkingAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
-
Demystifying swarm dnsAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di portainer/agent
Issue simili
-
☢️ Bug v3
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
area/import-export area/projects concern/ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
go-vikunja/vikunja#4455 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Dependabot PRs no longer merge automaticallyForse già presa @dwisiswant0 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
projectdiscovery/urlfinder#160 ·
I maintainer di solito rispondono entro 1 giorno
-
database
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
chnm/legal-modernism#450 ·
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno