{"record":{"id":"9d214d2616372d04","repo":"hashicorp/terraform","slug":"no-supported-plugins-for-protocol-d","errorCode":null,"errorMessage":"no supported plugins for protocol %d","messagePattern":"no supported plugins for protocol (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/meta_providers.go","lineNumber":551,"sourceCode":"\t\t\tManaged:          false,\n\t\t\tReattach:         reattach,\n\t\t\tSyncStdout:       logging.PluginOutputMonitor(fmt.Sprintf(\"%s:stdout\", provider)),\n\t\t\tSyncStderr:       logging.PluginOutputMonitor(fmt.Sprintf(\"%s:stderr\", provider)),\n\t\t}\n\n\t\tif reattach.ProtocolVersion == 0 {\n\t\t\t// As of the 0.15 release, sdk.v2 doesn't include the protocol\n\t\t\t// version in the ReattachConfig (only recently added to\n\t\t\t// go-plugin), so client.NegotiatedVersion() always returns 0. We\n\t\t\t// assume that an unmanaged provider reporting protocol version 0 is\n\t\t\t// actually using proto v5 for backwards compatibility.\n\t\t\tif defaultPlugins, ok := tfplugin.VersionedPlugins[5]; ok {\n\t\t\t\tconfig.Plugins = defaultPlugins\n\t\t\t} else {\n\t\t\t\treturn nil, errors.New(\"no supported plugins for protocol 0\")\n\t\t\t}\n\t\t} else if plugins, ok := tfplugin.VersionedPlugins[reattach.ProtocolVersion]; !ok {\n\t\t\treturn nil, fmt.Errorf(\"no supported plugins for protocol %d\", reattach.ProtocolVersion)\n\t\t} else {\n\t\t\tconfig.Plugins = plugins\n\t\t}\n\n\t\tclient := plugin.NewClient(config)\n\t\trpcClient, err := client.Client()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\traw, err := rpcClient.Dispense(tfplugin.ProviderPluginName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// store the client so that the plugin can kill the child process\n\t\tprotoVer := client.NegotiatedVersion()\n\t\tswitch protoVer {","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/command/meta_providers.go#L533-L569","documentation":"Raised inside unmanagedProviderFactory when reattach.ProtocolVersion (from TF_REATTACH_PROVIDERS) does not correspond to any key in tfplugin.VersionedPlugins, which only registers protocol versions 5 and 6. Unmanaged providers are externally-started provider servers used during SDK/provider development testing; Terraform connects to them instead of launching its own plugin process. An unknown protocol number means the provider under test speaks a version Terraform does not support.","triggerScenarios":"Set TF_REATTACH_PROVIDERS with a ProtocolVersion other than 5 or 6 (e.g. a future v7 or a malformed config), then run any Terraform command that loads providers. Also reachable when the reattach JSON omits/hand-types the protocol_version field to an unexpected integer.","commonSituations":"Provider developer is testing against a bleeding-edge SDK that bumped the protocol; the reattach config JSON was copy-pasted with a stale/wrong protocol_version; mismatch between the Terraform CLI version and the SDK protocol version the provider was compiled with.","solutions":["Confirm the provider under test is built with SDK that speaks protocol 5 or 6 and set protocol_version accordingly in TF_REATTACH_PROVIDERS.","Upgrade or downgrade Terraform CLI to match the protocol version the provider SDK targets.","Remove TF_REATTACH_PROVIDERS from the environment if you are not actively developing a provider."],"exampleFix":"// before\n$ export TF_REATTACH_PROVIDERS='{\"registry.terraform.io/hashicorp/example\":{\"protocol\":\"grpc\",\"protocol_version\":7,\"pid\":12345}}'\n// after (use a supported protocol version)\n$ export TF_REATTACH_PROVIDERS='{\"registry.terraform.io/hashicorp/example\":{\"protocol\":\"grpc\",\"protocol_version\":6,\"pid\":12345}}'","handlingStrategy":"validation","validationCode":"// Validate TF_REATTACH_PROVIDERS only references supported protocol versions before invoking Terraform\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n)\n\nfunc validateReattachProtocols(raw string) error {\n\tif raw == \"\" { return nil }\n\tvar cfg map[string]struct{ ProtocolVersion int `json:\"protocol_version\"` }\n\tif err := json.Unmarshal([]byte(raw), &cfg); err != nil { return err }\n\tfor name, p := range cfg {\n\t\tif p.ProtocolVersion != 5 && p.ProtocolVersion != 6 {\n\t\t\treturn fmt.Errorf(\"provider %s: protocol_version must be 5 or 6, got %d\", name, p.ProtocolVersion)\n\t\t}\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set TF_REATTACH_PROVIDERS during active provider development; unset it for normal runs.","Keep the Terraform CLI version and the SDK/terraform-plugin-go version of your provider in lockstep.","Document the supported protocol versions (5, 6) for contributors reattaching providers."],"tags":["provider-plugin","reattach","protocol","development"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}