{"record":{"id":"865ccecba39b6ace","repo":"abiosoft/colima","slug":"error-during-teardown-of-s-w","errorCode":null,"errorMessage":"error during teardown of %s: %w","messagePattern":"error during teardown of (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app/app.go","lineNumber":270,"sourceCode":"\t//   container teardown -> vm teardown\n\n\t// vm teardown would've sufficed but container provision\n\t// may have created configurations on the host.\n\t// it is thereby necessary to teardown containers as well.\n\n\t// teardown container runtimes\n\tif c.guest.Running(ctx) {\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\t\tfor _, cont := range containers {\n\t\t\tlog := log.WithField(\"context\", cont.Name())\n\t\t\tlog.Println(\"deleting ...\")\n\n\t\t\tif err := cont.Teardown(ctx); err != nil {\n\t\t\t\t// failure here is not fatal\n\t\t\t\tlog.Warnln(fmt.Errorf(\"error during teardown of %s: %w\", cont.Name(), err))\n\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 {","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/app/app.go#L252-L288","documentation":"One container runtime's Teardown (host-side cleanup of what provisioning created) failed during delete; deliberately non-fatal, only warned. The VM and config teardown continue, but the named runtime may leave configuration behind on the host.","triggerScenarios":"`colima delete` when removing a runtime's host artifacts fails: `docker context rm colima` errors because the docker CLI fails, files are locked by another process, or the runtime binaries were already removed manually.","commonSituations":"Docker CLI upgraded to a version whose context handling changed; user already deleted the context manually; editors/IDEs holding config files open.","solutions":["Complete the delete, then remove leftover artifacts by hand (docker context, kubeconfig entries)","Close applications holding colima config files and retry `colima delete --force`","Verify nothing remains: `docker context ls`, `kubectl config get-contexts`","Avoid pre-deleting contexts/configs manually before running colima delete"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// non-fatal by design; after delete, sweep the named runtime's leftovers:\n// docker context rm colima 2>/dev/null; kubectl config delete-context colima 2>/dev/null","preventionTips":["Do not pre-delete docker contexts manually before colima delete","Close tools that lock config files during delete","Check `docker context ls` after every delete"],"tags":["delete","teardown","cleanup","docker-context"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}