{"record":{"id":"94ccb8bcac1ecd2a","repo":"abiosoft/colima","slug":"error-retrieving-runtimes-w","errorCode":null,"errorMessage":"error retrieving runtimes: %w","messagePattern":"error retrieving runtimes: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app/app.go","lineNumber":190,"sourceCode":"\t\t}\n\t}\n\tif failed {\n\t\tlog.Warnln(fmt.Errorf(\"error running %s provision script(s)\", mode))\n\t}\n}\n\nfunc (c colimaApp) Stop(force bool) error {\n\tctx := context.Background()\n\tlog.Println(\"stopping\", config.CurrentProfile().DisplayName)\n\n\t// the order for stop is:\n\t//   container stop -> vm stop\n\n\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\")","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/app/app.go#L172-L208","documentation":"During Stop, colima asks currentContainerEnvironments which runtimes to shut down gracefully; if that lookup fails it only warns and proceeds to stop the VM anyway. The lookup reads the persisted runtime from the store and constructs the matching environment, so it fails on a corrupt/unknown runtime setting or an unreadable instance config.","triggerScenarios":"`colima stop` when the stored runtime key references a runtime colima no longer recognizes (config written by a much older/newer version) or the instance config under the colima/lima config dirs cannot be loaded.","commonSituations":"Downgrading colima after a newer version wrote the config; partially deleted profile; hand-edited config with a bad runtime name.","solutions":["Proceed with `colima stop`: the VM stops regardless, graceful runtime shutdown is simply skipped","Inspect and repair the instance config/runtime key (colima status, config files under the colima config dir)","Recreate the instance (`colima delete && colima start`) to rewrite a consistent config","Keep colima and lima at matching versions to avoid unreadable versioned configs"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// probe profile health before stop\nif err := exec.Command(\"colima\", \"status\").Run(); err != nil {\n    // expect a degraded stop; plan to use --force if it hangs\n}","typeGuard":null,"tryCatchPattern":"if err := a.Stop(false); err != nil {\n    if strings.Contains(err.Error(), \"error stopping vm\") {\n        // runtime lookup already degraded gracefully; only the VM stop failed here\n        return a.Stop(true) // force\n    }\n}","preventionTips":["Do not hand-edit instance configs","Keep colima's version consistent with the version that created the profile","Delete a profile with the same colima version that created it"],"tags":["stop","config","runtime","store"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}