{"record":{"id":"fca0d28c3fa65385","repo":"hashicorp/terraform","slug":"error-loading-plugin-path-s","errorCode":null,"errorMessage":"error loading plugin path: %s","messagePattern":"error loading plugin path: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/show.go","lineNumber":90,"sourceCode":"\tif err != nil {\n\t\tdiags = diags.Append(err)\n\t\tview.Diagnostics(diags)\n\t\treturn 1\n\t}\n\n\tvar varDiags tfdiags.Diagnostics\n\tc.VariableValues, varDiags = args.Vars.CollectValues(func(filename string, src []byte) {\n\t\tloader.Parser().ForceFileSource(filename, src)\n\t})\n\tdiags = diags.Append(varDiags)\n\tif varDiags.HasErrors() {\n\t\tview.Diagnostics(diags)\n\t\treturn 1\n\t}\n\n\t// Check for user-supplied plugin path\n\tif c.pluginPath, err = c.loadPluginPath(); err != nil {\n\t\tdiags = diags.Append(fmt.Errorf(\"error loading plugin path: %s\", err))\n\t\tview.Diagnostics(diags)\n\t\treturn 1\n\t}\n\n\t// Get the data we need to display\n\tplan, jsonPlan, stateFile, config, schemas, showDiags := c.show(args.Path)\n\tdiags = diags.Append(showDiags)\n\tif showDiags.HasErrors() {\n\t\tview.Diagnostics(diags)\n\t\treturn 1\n\t}\n\n\t// Display the data\n\treturn view.Display(config, plan, jsonPlan, stateFile, schemas)\n}\n\nfunc (c *ShowCommand) Help() string {\n\thelpText := `","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/command/show.go#L72-L108","documentation":"Wrapped error from ShowCommand.Run when c.loadPluginPath() fails. loadPluginPath reads the plugin-path setting (from CLI config or .terraformrc) that augments where Terraform searches for provider plugins. If the file/setting cannot be parsed or the listed directories are invalid, 'terraform show' aborts before displaying state/plan. %s embeds the underlying error.","triggerScenarios":"Running 'terraform show' when the plugin_path entry in the CLI config references a non-existent/unreadable directory or the config itself is malformed; loadPluginPath returns an error reading or validating those paths.","commonSituations":"plugin_path in ~/.terraformrc points to a directory that was moved/deleted; the CLI config has a syntax error in the plugin_paths array; permissions deny traversal of a listed path; container has stale plugin path from a different host.","solutions":["Inspect the embedded error for which plugin path entry is invalid.","Correct or remove the plugin_path entry in ~/.terraformrc / TF_CLI_CONFIG_FILE.","Ensure all listed plugin directories exist and are readable.","Use 'terraform providers' / 'terraform init' with -plugin-dir instead of a global plugin_path."],"exampleFix":"// before (~/.terraformrc)\nplugin_cache_dir = \"/old/path/that/gone\"\n// after\nplugin_cache_dir = \"/home/me/.terraform.d/plugin-cache\"","handlingStrategy":"validation","validationCode":"// Validate plugin_path entries in the CLI config are real, readable directories before 'terraform show'\npackage main\n\nfunc preflightPluginPath(paths []string) error {\n\tfor _, p := range paths {\n\t\tinfo, err := os.Stat(p)\n\t\tif err != nil { return fmt.Errorf(\"plugin path %s: %w\", p, err) }\n\t\tif !info.IsDir() { return fmt.Errorf(\"plugin path %s is not a directory\", p) }\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep plugin_path entries in ~/.terraformrc pointing at existing, readable dirs.","Prefer 'terraform init -plugin-dir' over a global plugin_path to avoid drift.","Remove stale plugin_path entries when relocating the plugin cache."],"tags":["plugin-path","cli-config","show","initialization"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T20:17:04.800Z"}