{"record":{"id":"03ade8258137f4f3","repo":"pulumi/pulumi","slug":"failed-to-delete-s-plugin-s-w","errorCode":null,"errorMessage":"failed to delete %s plugin %s: %w","messagePattern":"failed to delete (.+?) plugin (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/plugin/plugin_remove.go","lineNumber":131,"sourceCode":"\t\t\t\t\topts.Color.Colorize(\n\t\t\t\t\t\tfmt.Sprintf(\"%sThis will remove %d plugin%s from the cache:%s\\n\",\n\t\t\t\t\t\t\tcolors.SpecAttention, len(deletes), suffix, colors.Reset)))\n\t\t\t\tfor _, del := range deletes {\n\t\t\t\t\tfmt.Fprintf(out, \"    %s %s\\n\", del.Kind, del.String())\n\t\t\t\t}\n\t\t\t\tif !ui.ConfirmPrompt(\"\", \"yes\", opts) {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Run the actual delete operations.\n\t\t\tvar result error\n\t\t\tfor _, plugin := range deletes {\n\t\t\t\tif err := plugin.Delete(); err == nil {\n\t\t\t\t\tfmt.Fprintf(out, \"removed: %s %v\\n\", plugin.Kind, plugin)\n\t\t\t\t} else {\n\t\t\t\t\tresult = multierror.Append(\n\t\t\t\t\t\tresult, fmt.Errorf(\"failed to delete %s plugin %s: %w\", plugin.Kind, plugin, err))\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t},\n\t}\n\n\tconstrictor.AttachArguments(cmd, &constrictor.Arguments{\n\t\tArguments: []constrictor.Argument{\n\t\t\t{Name: \"kind\"},\n\t\t\t{Name: \"name\"},\n\t\t\t{Name: \"version\"},\n\t\t},\n\t\tRequired: 0,\n\t\tVariadic: false,\n\t})\n\n\tcmd.PersistentFlags().BoolVarP(\n\t\t&all, \"all\", \"a\", false,","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/plugin/plugin_remove.go#L113-L149","documentation":"When deleting matched plugins, each `plugin.Delete()` failure is collected into a multierror and reported as \"failed to delete <kind> plugin <name>: <cause>\". Other matching plugins are still attempted; accumulated errors are returned at the end.","triggerScenarios":"`pulumi plugin rm` matching plugins whose files cannot be removed: files in use on Windows, permission denied on plugin directories, or the directory vanishing mid-delete.","commonSituations":"A running engine or language host still holds the plugin binary open (Windows); plugin dir owned by root or another user; antivirus locking files.","solutions":["Stop any running pulumi processes that may hold the plugin open, then re-run removal","Fix or take ownership of the plugin directory under ~/.pulumi/plugins","Delete the plugin directory manually if Pulumi's deleter keeps failing"],"exampleFix":"// before (file in use)\npulumi plugin rm resource aws 5.0.0\n// after\ntaskkill /IM pulumi.exe /F & pulumi plugin rm resource aws 5.0.0","handlingStrategy":"retry","validationCode":"ensureNoRunningPulumiProcesses(); ensureWritable(pluginDir)","typeGuard":null,"tryCatchPattern":"if err := runCmd(\"pulumi\", \"plugin\", \"rm\", ...); err != nil && strings.Contains(err.Error(), \"failed to delete\") { time.Sleep(2*time.Second); retry() }","preventionTips":["Stop running pulumi engines/language hosts before removing plugins","On Windows, close processes holding plugin binaries open","Re-run removal after permission/ownership fixes"],"tags":["cli","plugin-management","filesystem"],"backgroundTag":"plugin-delete-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}