{"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":"exception","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/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/meta_providers.go#L533-L569","documentation":"In unmanagedProviderFactory, when a ReattachConfig supplies a non-zero ProtocolVersion, Terraform looks it up in tfplugin.VersionedPlugins. If that protocol version is absent from the built-in plugin set, the factory returns this error. It also covers the zero case when tfplugin.VersionedPlugins[5] is itself missing. This path is only used for debugging via TF_REATTACH_PROVIDERS.","triggerScenarios":"TF_REATTACH_PROVIDERS is set to a JSON reattach config whose ProtocolVersion is a value not present in tfplugin.VersionedPlugins (currently only 5 and 6 are registered), or ProtocolVersion is 0 and the default proto-5 plugin table is unavailable in this build.","commonSituations":"Provider developer sets TF_REATTACH_PROVIDERS with a hand-written config naming protocol 4 or 7; sdk.v2 provider whose ReattachConfig omits the version but running a stripped build without the v5 plugin table; mismatch between the provider under development and the Terraform build's supported protocols.","solutions":["Set ProtocolVersion to 5 (terraform-plugin-sdk v2) or 6 (terraform-plugin-framework) in the reattach config.","Regenerate the reattach JSON by running the provider with the Terraform-provided harness rather than authoring it by hand.","Confirm the Terraform/OpenTofu build actually registers tfplugin.VersionedPlugins[5] and [6].","Stop using TF_REATTACH_PROVIDERS for production runs; it is a development-only escape hatch."],"exampleFix":"// before: { \"registry.terraform.io/hashicorp/example\": { \"ProtocolVersion\": 4, ... } }\n// after\n{ \"registry.terraform.io/hashicorp/example\": { \"ProtocolVersion\": 6, \"Pid\": 12345, \"Test\": true, \"Addr\": { \"Network\": \"unix\", \"String\": \"/tmp/plugin\" } } }","handlingStrategy":"validation","validationCode":"// Validate the reattach protocol before passing it to Terraform.\nfunc validReattachProto(v int) bool { return v == 0 || v == 5 || v == 6 }","typeGuard":"func isSupportedProtocol(v int) bool {\n    _, ok := tfplugin.VersionedPlugins[v]\n    return ok || v == 0\n}","tryCatchPattern":null,"preventionTips":["Generate TF_REATTACH_PROVIDERS JSON from the provider dev harness, not by hand.","Keep ProtocolVersion at 6 for terraform-plugin-framework providers.","Only use reattach during active provider development."],"tags":["terraform","provider","plugin","protocol","debugging","reattach"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}