bcicen/ctop · error
cannot restart container: %v
Error message
cannot restart container: %v
What it means
Wraps the error from the Docker Remote API's RestartContainer call (3-second stop timeout) in Docker.Restart. It fires when the daemon cannot stop-then-start the container — the container does not exist, is stuck stopping, or fails to start again (port conflict, image issue).
Source
Thrown at connector/manager/docker.go:147
func (dc *Docker) Restart() error {
if err := dc.client.RestartContainer(dc.id, 3); err != nil {
return fmt.Errorf("cannot restart container: %v", err)
}
return nil
}View on GitHub (pinned to 59f00dd6aa)
Solutions
- Verify the container exists and is not wedged with docker inspect
- Increase the stop timeout if the container does not terminate within 3 seconds
- Retry the restart after transient daemon/connection errors
- Check daemon logs for the underlying start failure if the container fails to come back
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at connector/manager/docker.go:147 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/08a90894ae29a70c.
Report an issue: GitHub.