{"record":{"id":"6dbde724ad5fb291","repo":"pulumi/pulumi","slug":"could-not-list-list-w","errorCode":null,"errorMessage":"could not list list: %w","messagePattern":"could not list list: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/go/auto/local_workspace.go","lineNumber":775,"sourceCode":"\t\treturn newAutoError(fmt.Errorf(\"failed to install plugin: %w\", err), stdout, stderr, errCode)\n\t}\n\treturn nil\n}\n\n// RemovePlugin deletes the plugin matching the specified name and verision.\nfunc (l *LocalWorkspace) RemovePlugin(ctx context.Context, name string, version string) error {\n\tstdout, stderr, errCode, err := l.runPulumiCmdSync(ctx, \"plugin\", \"rm\", \"resource\", name, version, \"--yes\")\n\tif err != nil {\n\t\treturn newAutoError(fmt.Errorf(\"failed to remove plugin: %w\", err), stdout, stderr, errCode)\n\t}\n\treturn nil\n}\n\n// ListPlugins lists all installed plugins.\nfunc (l *LocalWorkspace) ListPlugins(ctx context.Context) ([]workspace.PluginInfo, error) {\n\tstdout, stderr, errCode, err := l.runPulumiCmdSync(ctx, \"plugin\", \"ls\", \"--json\")\n\tif err != nil {\n\t\treturn nil, newAutoError(fmt.Errorf(\"could not list list: %w\", err), stdout, stderr, errCode)\n\t}\n\tvar plugins []workspace.PluginInfo\n\terr = json.Unmarshal([]byte(stdout), &plugins)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to unmarshal plugin response: %w\", err)\n\t}\n\treturn plugins, nil\n}\n\n// Program returns the program `pulumi.RunFunc` to be used for Preview/Update if any.\n// If none is specified, the stack will refer to ProjectSettings for this information.\nfunc (l *LocalWorkspace) Program() pulumi.RunFunc {\n\treturn l.program\n}\n\n// SetProgram sets the program associated with the Workspace to the specified `pulumi.RunFunc`.\nfunc (l *LocalWorkspace) SetProgram(fn pulumi.RunFunc) {\n\tl.program = fn","sourceCodeStart":757,"sourceCodeEnd":793,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/go/auto/local_workspace.go#L757-L793","documentation":"LocalWorkspace.ListPlugins runs `pulumi plugin ls --json`. If the CLI exits non-zero, the error is wrapped in an AutomationError carrying stdout, stderr and exit code. (The wording 'could not list list' is a typo for 'could not list plugins'.)","triggerScenarios":"Calling ListPlugins when the pulumi binary fails to run: corrupt CLI install, missing CLI on PATH, or plugin cache in a broken state causing the CLI itself to error.","commonSituations":"Pulumi CLI not installed or wrong PATH; corrupted ~/.pulumi/plugins directory; extremely old CLI without --json support failing on the flag.","solutions":["Read err.StandardError()/StandardOutput() from the AutomationError","Verify `pulumi plugin ls --json` works in a shell and reinstall the CLI if broken","Check PulumiWorkspace/EnvVars to confirm the right pulumi binary and environment are used","Delete or repair the plugin cache directory if it is corrupt"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if _, err := exec.LookPath(\"pulumi\"); err != nil { return fmt.Errorf(\"pulumi CLI not on PATH\") }","typeGuard":"func isAutomationError(err error) (*auto.AutomationError, bool) {\n  var ae *auto.AutomationError\n  return ae, errors.As(err, &ae)\n}","tryCatchPattern":"plugins, err := ws.ListPlugins(ctx)\nif err != nil {\n  if ae, ok := isAutomationError(err); ok { log.Printf(\"plugin ls failed: %s\", ae.Stderr()) }\n  return nil, err\n}","preventionTips":["Ensure the pulumi binary is installed and on PATH in the target environment","Repair/reinstall the CLI if the plugin cache is corrupt","Test `pulumi plugin ls --json` in a shell when provisioning new environments","Use PulumiWorkspace with explicit EnvVars/PulumiHome for isolation"],"tags":["go","automation-api","plugin","cli"],"backgroundTag":"cli-command-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}