bcicen/ctop · error

cannot start container: %v

Error message

cannot start container: %v

What it means

Wraps the error returned by the Docker Remote API client's StartContainer call in Docker.Start. It fires when the container could not be transitioned to running — typically because the container is already running, was removed, or the host config is rejected by the daemon (port conflicts, missing image).

Source

Thrown at connector/manager/docker.go:112

func (dc *Docker) Start() error {
	c, err := dc.client.InspectContainer(dc.id)
	if err != nil {
		return fmt.Errorf("cannot inspect container: %v", err)
	}

	if err := dc.client.StartContainer(c.ID, c.HostConfig); err != nil {
		return fmt.Errorf("cannot start container: %v", err)
	}
	return nil
}

View on GitHub (pinned to 59f00dd6aa)

Solutions

  1. Verify the Docker daemon is reachable and the container ID exists via docker inspect
  2. Check whether the container is already running before calling StartContainer
  3. Inspect daemon logs for port-binding or image errors surfaced in the wrapped error
  4. Recreate the container if its definition is stale or removed
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at connector/manager/docker.go:112 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bcicen/ctop@59f00dd6aa (2026-09-02). Data as JSON: /api/errors/1d7cc6e84f0ebfd8. Report an issue: GitHub.