{"record":{"id":"e7bc8a009cba45ee","repo":"abiosoft/colima","slug":"error-during-lima-prune-w","errorCode":null,"errorMessage":"error during Lima prune: %w","messagePattern":"error during Lima prune: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/prune.go","lineNumber":48,"sourceCode":"\t\tlimaCacheDir := filepath.Join(filepath.Dir(colimaCacheDir), \"lima\")\n\t\tif !pruneCmdArgs.force {\n\t\t\tmsg := \"'\" + colimaCacheDir + \"' will be emptied, are you sure\"\n\t\t\tif pruneCmdArgs.all {\n\t\t\t\tmsg = \"'\" + colimaCacheDir + \"' and '\" + limaCacheDir + \"' will be emptied, are you sure\"\n\t\t\t}\n\t\t\tif y := cli.Prompt(msg); !y {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tlogrus.Info(\"Pruning \", strconv.Quote(config.CacheDir()))\n\t\tif err := os.RemoveAll(config.CacheDir()); err != nil {\n\t\t\treturn fmt.Errorf(\"error during prune: %w\", err)\n\t\t}\n\n\t\tif pruneCmdArgs.all {\n\t\t\tcmd := limautil.Limactl(\"prune\")\n\t\t\tif err := cmd.Run(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error during Lima prune: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t},\n}\n\nfunc init() {\n\troot.Cmd().AddCommand(pruneCmd)\n\n\tpruneCmd.Flags().BoolVarP(&pruneCmdArgs.force, \"force\", \"f\", false, \"do not prompt for yes/no\")\n\tpruneCmd.Flags().BoolVarP(&pruneCmdArgs.all, \"all\", \"a\", false, \"include Lima assets\")\n}\n","sourceCodeStart":30,"sourceCodeEnd":62,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/prune.go#L30-L62","documentation":"With `--all`, `colima prune` additionally runs `limactl prune` to clear Lima's own cache/assets after the colima cache was already emptied. This error wraps that subprocess failing — the colima cache is gone at this point, only the Lima cleanup failed. Typical causes: limactl version mismatch with colima, permission issues in Lima's cache (~/Library/Caches/lima or ~/.cache/lima), or corrupted Lima state.","triggerScenarios":"`colima prune --all` where the bundled limactl errors: an outdated colima/lima pairing after a partial upgrade; root-owned files in the Lima cache from sudo usage; limactl prune failing on a missing or corrupt lima home.","commonSituations":"Upgrading colima via brew but leaving stale lima assets on disk; mixing colima versions (brew + manual binary) sharing the same lima caches; pruning --all immediately after a failed VM creation.","solutions":["Update the pairing: `brew upgrade colima lima` (or reinstall the release), then retry `colima prune --all --force`","Clear Lima's cache manually: `sudo rm -rf ~/Library/Caches/lima` (macOS) or `~/.cache/lima` (Linux) — colima's own cache was already pruned successfully","If you only meant to clear colima's cache, drop --all; the Lima step is optional"],"exampleFix":"# before\n$ colima prune --all --force\nerror: error during Lima prune: exit status 1\n\n# after\n$ brew upgrade colima lima\n$ colima prune --all --force","handlingStrategy":"try-catch","validationCode":"// optional precondition: only the lima step can fail (--all); check pairing first\nif _, err := exec.LookPath(\"limactl\"); err != nil {\n    // colima bundles its own limactl; a missing/mismatched one signals version skew -> upgrade first\n}","typeGuard":null,"tryCatchPattern":"if err := pruneCmd.Execute(); err != nil {\n    if strings.Contains(err.Error(), \"error during Lima prune\") {\n        // colima cache already cleared; safe fallback: manually rm -rf the lima cache dir\n        // ~/Library/Caches/lima (darwin) or ~/.cache/lima (linux)\n    }\n}","preventionTips":["Upgrade colima and lima together — limactl prune failures usually stem from version mismatch","Run plain `colima prune` when you only need colima's cache cleared; --all is optional","Clear the lima cache manually when the subprocess keeps failing"],"tags":["colima","lima","cache","prune","subprocess"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}