{"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":"exception","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/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/show.go#L72-L108","documentation":"ShowCommand.loadPluginPath (c.loadPluginPath()) reads the CLI plugin path configuration; if it errors, the message is wrapped, diagnostics shown, and the command returns 1. The plugin path feature (-plugin-dir) points Terraform at a filesystem mirror of providers, bypassing the registry; misconfiguration here aborts show.","triggerScenarios":"terraform show is run with TF_CLI_CONFIG_FILE / ~/.terraformrc containing a plugin_path block that references a non-existent, unreadable, or malformed directory, or with -plugin-dir pointing somewhere invalid.","commonSituations":"plugin_path set to a vendored mirror that was moved/deleted; relative path resolved against the wrong cwd; permission denied on the mirror dir; air-gapped install pointing plugin_path at an empty or wrongly-laid-out directory.","solutions":["Inspect ~/.terraformrc / TF_CLI_CONFIG_FILE plugin_path entries and verify each directory exists and is readable.","Use absolute paths in plugin_path so resolution does not depend on cwd.","Remove plugin_path if you intend to use the normal registry-based provider resolution.","Ensure the mirror layout matches <hostname>/<namespace>/<name>/<version>/<platform>/."],"exampleFix":"// before (~/.terraformrc)\nplugin_path = [\"./vendored-providers\"]\n// after\nplugin_path = [\"/opt/terraform/providers\"]","handlingStrategy":"validation","validationCode":"// Verify each plugin_path entry exists and is readable before running show.\nfor _, dir := range config.PluginPaths {\n    if info, err := os.Stat(dir); err != nil || !info.IsDir() {\n        return fmt.Errorf(\"plugin_path %s missing/unreadable\", dir)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths in the plugin_path setting.","Remove plugin_path when not vendoring providers offline.","Keep the mirror layout matching the registry directory structure."],"tags":["terraform","plugin","config","show","cli-config"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}