{"record":{"id":"8d894977f63bb548","repo":"abiosoft/colima","slug":"error-stopping-s-w","errorCode":null,"errorMessage":"error stopping %s: %w","messagePattern":"error stopping (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app/app.go","lineNumber":204,"sourceCode":"\t// stop container runtimes only if the guest is responsive\n\tif c.guest.Running(ctx) && c.guestResponsive() {\n\t\tcontainers, err := c.currentContainerEnvironments(ctx)\n\t\tif err != nil {\n\t\t\tlog.Warnln(fmt.Errorf(\"error retrieving runtimes: %w\", err))\n\t\t}\n\n\t\t// stop happens in reverse of start\n\t\tfor i := len(containers) - 1; i >= 0; i-- {\n\t\t\tcont := containers[i]\n\n\t\t\tlog := log.WithField(\"context\", cont.Name())\n\t\t\tlog.Println(\"stopping ...\")\n\n\t\t\tif err := cont.Stop(ctx, force); err != nil {\n\t\t\t\t// failure to stop a container runtime is not fatal\n\t\t\t\t// it is only meant for graceful shutdown.\n\t\t\t\t// the VM will shut down anyways.\n\t\t\t\tlog.Warnln(fmt.Errorf(\"error stopping %s: %w\", cont.Name(), err))\n\t\t\t}\n\t\t}\n\t} else if c.guest.Running(ctx) {\n\t\tlog.Warnln(\"vm not responsive, skipping runtime shutdown\")\n\t}\n\n\t// stop vm\n\t// no need to check running status, it may be in a state that requires stopping.\n\tif err := c.guest.Stop(ctx, force); err != nil {\n\t\treturn fmt.Errorf(\"error stopping vm: %w\", err)\n\t}\n\n\tlog.Println(\"done\")\n\n\tif err := generateSSHConfig(false); err != nil {\n\t\tlog.Trace(\"error generating ssh_config: %w\", err)\n\t}\n\treturn nil","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/app/app.go#L186-L222","documentation":"While stopping, a container runtime's graceful Stop failed; the code comments state explicitly that this is not fatal because the VM shuts down anyway and takes the runtimes with it. The warning names the runtime whose graceful shutdown failed.","triggerScenarios":"`colima stop` where docker/containerd inside the guest ignores or errors on the shutdown request: daemon already dead, guest under memory pressure, runtime socket unresponsive.","commonSituations":"Stopping while a heavy image pull is in flight; guest starved of memory so the daemon cannot respond; daemon crashed earlier in the session.","solutions":["Treat as best-effort: the VM stop that follows still terminates everything","If stop hangs or the VM is unresponsive, use `colima stop --force`","Check runtime health after the next start (docker version against the colima context)","If failures recur, recreate the instance to reset guest state"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// warning-level: the VM stop still happens; only force-stop if the overall stop fails\nif err := a.Stop(false); err != nil {\n    return a.Stop(true) // force\n}","preventionTips":["Stop colima before host sleep/shutdown","Avoid stopping mid-pull of large images","Recurring graceful-stop failures usually mean guest memory pressure: raise --memory"],"tags":["stop","runtime","graceful-shutdown","vm"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}