moby / moby/swarmkit

Agent quit if promotion failed

Open
#1,191 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
3.7k
Forks
676
Avg merge
4d 9h
Merged PRs (30d)
6

Description

The agent should stay working as agent even if promotion failed.

The promotion could fail due to various reasons like binding to an address already in use as following log shows.
"FATA[0076] listen tcp 0.0.0.0:4242: bind: address already in use"

Steps to reproduce:

$ swarmd -d /tmp/node-1 --listen-control-api /tmp/manager1/swarm.sock --hostname node-1
$ swarmd -d /tmp/node-2 --hostname node-2 --join-addr 127.0.0.1:4242
$ swarmctl service create --name busybox-top --replicas 2 --image busybox:latest --command top #optional step
$ swarmctl node promote node-2

The agent node quit with following error logs:

INFO[0076] Renewing TLS Certificate.
Error: listen tcp 0.0.0.0:4242: bind: address already in use
ERRO[0076] container status unavailable error=An error occurred trying to connect: context canceled module=taskmanager task.id=7jk8aj8v4h7f5bz5jm867wb06
WARN[0076] error fetching signed node certificate: rpc error: code = 1 desc = context canceled

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the listed swarmd and swarmctl commands, especially the occupied 0.0.0.0:4242 listener. Trace the promotion path and the agent lifecycle around the reported certificate and context-canceled logs. Done means a failed promotion leaves node-2 running as an agent rather than quitting.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.