docker/cli · error

node ID not found in /info

Error message

node ID not found in /info

What it means

Raised by node.Reference when the special node ref 'self' is resolved via the /info endpoint but Info.Swarm.NodeID is empty. Before erroring, the CLI calls NodeList to try to surface a more specific swarm error (e.g. 'not a swarm manager'); this message is the fallback when that call unexpectedly succeeds.

Source

Thrown at cli/command/node/cmd.go:62

// reference is mapped to the current node, hence the node ID is retrieved using
// the `/info` endpoint.
func Reference(ctx context.Context, apiClient client.APIClient, ref string) (string, error) {
	if ref == "self" {
		res, err := apiClient.Info(ctx, client.InfoOptions{})
		if err != nil {
			return "", err
		}
		if res.Info.Swarm.NodeID == "" {
			// If there's no node ID in /info, the node probably
			// isn't a manager. Call a swarm-specific endpoint to
			// get a more specific error message.
			//
			// FIXME(thaJeztah): this should not require calling a Swarm endpoint, and we could just suffice with info / ping (which has swarm status).
			_, err = apiClient.NodeList(ctx, client.NodeListOptions{})
			if err != nil {
				return "", err
			}
			return "", errors.New("node ID not found in /info")
		}
		return res.Info.Swarm.NodeID, nil
	}
	return ref, nil
}

View on GitHub (pinned to e9452d6e78)

Solutions

  1. Verify the daemon is a swarm manager: `docker info --format '{{.Swarm.LocalNodeState}} {{.Swarm.ControlAvailable}}'`
  2. Point DOCKER_HOST/`docker context use` at the intended manager node
  3. Initialize or join the swarm first (`docker swarm init` / `docker swarm join`) before using `docker node` commands
  4. Use an explicit node ID/hostname instead of 'self' if resolving from a different endpoint

When it happens

Trigger: `docker node inspect self`, `docker node update self`, etc., against a daemon whose /info reports no Swarm.NodeID — typically a node not in a swarm or in an inconsistent swarm state — while NodeList still returns without error.

Common situations: Running node commands on a non-swarm engine or a worker via a misdirected DOCKER_HOST/context; a node that just left the swarm; talking to a rootless/dev daemon that never joined a swarm.

Related errors


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/52f8f3684006cdbf.json. Report an issue: GitHub.