bcicen/ctop · error
cannot stop container: %v
Error message
cannot stop container: %v
What it means
Wraps the error from the Docker Remote API's StopContainer call (3-second grace period) in Docker.Stop. It fires when the daemon cannot stop the container — the container is already stopped or does not exist, or the daemon is unreachable.
Source
Thrown at connector/manager/docker.go:119
func (dc *Docker) Stop() error {
if err := dc.client.StopContainer(dc.id, 3); err != nil {
return fmt.Errorf("cannot stop container: %v", err)
}
return nil
}View on GitHub (pinned to 59f00dd6aa)
Solutions
- Ignore 'container already stopped' errors as idempotent success
- Confirm the container ID with docker inspect before stopping
- Retry once after a short delay to cover transient daemon/connection failures
- Check Docker daemon health and socket permissions if errors persist
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at connector/manager/docker.go:119 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/4a670367209501c7.
Report an issue: GitHub.