{"record":{"id":"e5d5660886e3f9a9","repo":"abiosoft/colima","slug":"error-persisting-runtime-settings-w","errorCode":null,"errorMessage":"error persisting runtime settings: %w","messagePattern":"error persisting runtime settings: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app/app.go","lineNumber":148,"sourceCode":"\t// provision and start container runtimes\n\tfor _, cont := range containers {\n\t\tlog := log.WithField(\"context\", cont.Name())\n\t\tlog.Println(\"provisioning ...\")\n\t\tif err := cont.Provision(ctx); err != nil {\n\t\t\treturn fmt.Errorf(\"error provisioning %s: %w\", cont.Name(), err)\n\t\t}\n\t\tlog.Println(\"starting ...\")\n\t\tif err := cont.Start(ctx); err != nil {\n\t\t\treturn fmt.Errorf(\"error starting %s: %w\", cont.Name(), err)\n\t\t}\n\t}\n\n\t// run ready provision scripts\n\tc.runProvisionScripts(conf, config.ProvisionModeReady)\n\n\t// persist the current runtime\n\tif err := c.setRuntime(conf.Runtime); err != nil {\n\t\tlog.Error(fmt.Errorf(\"error persisting runtime settings: %w\", err))\n\t}\n\n\t// persist the kubernetes config\n\tif err := c.setKubernetes(conf.Kubernetes); err != nil {\n\t\tlog.Error(fmt.Errorf(\"error persisting kubernetes settings: %w\", err))\n\t}\n\n\tlog.Println(\"done\")\n\n\tif err := generateSSHConfig(conf.SSHConfig); err != nil {\n\t\tlog.Trace(\"error generating ssh_config: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (c colimaApp) runProvisionScripts(conf config.Config, mode string) {\n\tvar failed bool\n\tfor _, s := range conf.Provision {","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/app/app.go#L130-L166","documentation":"After a successful start, colima persists the chosen runtime into its config store via c.setRuntime; a failure is logged with log.Error but deliberately not returned, because start already succeeded. It means writing to colima's config store (~/.colima/<profile>) failed. Consequence: the next command may not see which runtime is active.","triggerScenarios":"HOME or ~/.colima is read-only or owned by another user; disk quota exhausted; the store file is corrupt or being mutated by a concurrent colima process.","commonSituations":"Running colima under sudo so ~/.colima entries end up root-owned; NFS or read-only home directories in corporate setups; two colima commands racing on the same profile.","solutions":["Fix ownership/permissions: `sudo chown -R $(whoami) ~/.colima` and ensure it is writable","Free disk or quota on the home volume","Re-run `colima start` when no other colima process holds the profile, then verify with `colima status` that the runtime persisted","If the store file is corrupt, delete the profile config and recreate the instance"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// ensure the config store is writable before start\nhome, _ := os.UserHomeDir()\nconfigDir := filepath.Join(home, \".colima\")\nif fi, err := os.Stat(configDir); err == nil && fi.Mode().Perm()&0200 == 0 {\n    // fix perms (chmod u+w / chown -R $(id -u)) before starting\n}","typeGuard":null,"tryCatchPattern":"// the library already logs-and-continues; the caller verifies afterwards\nif err := a.Start(ctx, conf); err == nil {\n    if r, rerr := a.Runtime(); rerr != nil || r != conf.Runtime {\n        // runtime was not persisted: repair store permissions and re-run start\n    }\n}","preventionTips":["Never run colima under sudo (ownership drift in ~/.colima)","Keep ~/.colima writable by your user","Run one colima command per profile at a time"],"tags":["config","filesystem","permissions","store"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}