{"record":{"id":"44287b9fc66fec1a","repo":"abiosoft/colima","slug":"error-deleting-container-data-w","errorCode":null,"errorMessage":"error deleting container data: %w","messagePattern":"error deleting container data: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/app.go","lineNumber":289,"sourceCode":"\t\t\t}\n\t\t}\n\t}\n\n\t// teardown vm\n\tif err := c.guest.Teardown(ctx); err != nil {\n\t\treturn fmt.Errorf(\"error during teardown of vm: %w\", err)\n\t}\n\n\t// delete configs\n\tif err := configmanager.Teardown(); err != nil {\n\t\treturn fmt.Errorf(\"error deleting configs: %w\", err)\n\t}\n\n\t// delete runtime disk if disk in use and data deletion is requested\n\tif diskInUse && data {\n\t\tlog.Println(\"deleting container data\")\n\t\tif err := limautil.DeleteDisk(); err != nil {\n\t\t\treturn fmt.Errorf(\"error deleting container data: %w\", err)\n\t\t}\n\n\t\tif err := store.Reset(); err != nil {\n\t\t\tlog.Trace(\"error resetting store: %w\", err)\n\t\t}\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\n}\n\nfunc (c colimaApp) SSH(args ...string) error {\n\tctx := context.Background()\n\tif !c.guest.Running(ctx) {","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/app/app.go#L271-L307","documentation":"With `colima delete --data` (data=true) and the extra data disk in use, limautil.DeleteDisk must erase the Lima diff disk holding container data; failure is returned. Ordering matters: the VM and configs are already deleted at this point, so only the data disk remains.","triggerScenarios":"`colima delete --data` when the data disk cannot be removed: the disk reference in the lima instance is inconsistent, an earlier partial delete left the instance half-gone, or files under ~/.lima are locked or permission-denied.","commonSituations":"Running a --data delete right after a failed stop/delete; permissions under ~/.lima changed by sudo usage; version skew between colima and lima disk handling.","solutions":["Retry with `colima delete --data --force`","Remove the leftover diff-disk artifacts under ~/.lima/colima manually once no process uses them","Fix ownership: `sudo chown -R $(whoami) ~/.lima` and retry","Confirm nothing remains: `limactl list` should not show the profile"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := a.Delete(true, false); err != nil {\n    if strings.Contains(err.Error(), \"error deleting container data\") {\n        // VM and configs are already removed; retry with force, then clear ~/.lima/<profile> diff disks by hand\n        return a.Delete(true, true)\n    }\n}","preventionTips":["Use `colima delete --data --force` when reclaiming the data disk","Keep ~/.lima user-owned","Do not run --data delete while another delete is in progress"],"tags":["delete","disk","data","lima"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}