{"record":{"id":"8c357de7fe0eb786","repo":"abiosoft/colima","slug":"error-saving-provisioning-state-w","errorCode":null,"errorMessage":"error saving provisioning state: %w","messagePattern":"error saving provisioning state: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"model/ramalama.go","lineNumber":186,"sourceCode":"# fix ownership of persistent data dir and symlink to expected location\nsudo chown -R $(id -u):$(id -g) /var/lib/ramalama\nmkdir -p \"$HOME/.local/share\"\nln -sfn /var/lib/ramalama \"$HOME/.local/share/ramalama\"\n`\n\n\tlog.Println(\"installing AI model runner...\")\n\n\tif err := guest.RunInteractive(\"sh\", \"-c\", script); err != nil {\n\t\treturn fmt.Errorf(\"error setting up AI model runner: %w\", err)\n\t}\n\n\tlog.Println(\"AI model runner installed\")\n\n\t// mark as provisioned\n\tif err := store.Set(func(s *store.Store) {\n\t\ts.RamalamaProvisioned = true\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"error saving provisioning state: %w\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":168,"sourceCodeEnd":191,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/model/ramalama.go#L168-L191","documentation":"After the ramalama install script has already succeeded, ProvisionRamalama persists RamalamaProvisioned=true via store.Set; this error means only that state write failed. The root cause is a store save failure (marshal/write of the store file in store/store.go), typically permissions or disk — the misleading part is that the runner is actually installed.","triggerScenarios":"Store file or its directory not writable (ownership changed by an earlier sudo run); home partition full; store directory deleted mid-run.","commonSituations":"One sudo colima invocation leaves root-owned files under the colima config dir; later normal runs then fail every persist.","solutions":["Fix ownership of the colima store/config directory back to your user (chown -R $(id -u):$(id -g) <colima config dir>)","Free space on the home volume if it is full","Re-run the command that triggered provisioning — installation already succeeded, only the flag write failed; if the store file is corrupt, delete it and re-provision"],"exampleFix":"// before\nif err := store.Set(func(s *store.Store) {\n\ts.RamalamaProvisioned = true\n}); err != nil {\n\treturn fmt.Errorf(\"error saving provisioning state: %w\", err)\n}\nreturn nil\n\n// after: installation already succeeded; treat flag persistence as non-fatal\nif err := store.Set(func(s *store.Store) {\n\ts.RamalamaProvisioned = true\n}); err != nil {\n\tlog.Warnf(\"AI model runner installed but provisioning state not saved: %v\", err)\n}\nreturn nil","handlingStrategy":"try-catch","validationCode":"// ensure the store file is writable before starting a long provisioning run\nfunc storeWritable(p string) bool {\n\tf, err := os.OpenFile(p, os.O_RDWR|os.O_CREATE, 0o644)\n\tif err != nil {\n\t\treturn false\n\t}\n\t_ = f.Close()\n\treturn true\n}","typeGuard":null,"tryCatchPattern":"if err := runner.EnsureProvisioned(); err != nil {\n\tif strings.Contains(err.Error(), \"error saving provisioning state\") {\n\t\t// install actually succeeded: retry the command; only the flag write is repeated\n\t}\n}","preventionTips":["Never alternate sudo and non-sudo colima runs","Keep the colima config directory owned by the invoking user","Monitor home-volume disk usage when working with AI models"],"tags":["persistence","filesystem","permissions","go"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}