{"record":{"id":"51e018bec79beeba","repo":"hashicorp/terraform","slug":"no-supported-plugins-for-protocol-0","errorCode":null,"errorMessage":"no supported plugins for protocol 0","messagePattern":"no supported plugins for protocol 0","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/meta_providers.go","lineNumber":548,"sourceCode":"\t\t\tHandshakeConfig:  tfplugin.Handshake,\n\t\t\tLogger:           logging.NewProviderLogger(\"unmanaged.\"),\n\t\t\tAllowedProtocols: []plugin.Protocol{plugin.ProtocolGRPC},\n\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","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/command/meta_providers.go#L530-L566","documentation":"Returned in providerFactories reattach handling (meta_providers.go:548). When Terraform reattaches to an externally-managed provider (TF_REATTACH_PROVIDERS) whose ReattachConfig reports protocol version 0 — common with sdk.v2 before go-plugin carried the version — Terraform assumes proto v5. If tfplugin.VersionedPlugins[5] is not registered, it returns \"no supported plugins for protocol 0\". This is a build/embedding problem, not an end-user config error.","triggerScenarios":"Embedding Terraform as a library and supplying a provider via TF_REATTACH_PROVIDERS / reattach config whose protocol version is 0, while the VersionedPlugins map lacks a v5 entry; or running a custom terraform binary that did not register the v5 plugin set.","commonSituations":"Developing/debugging a provider with `tfprotov5` against a terraform binary that was compiled without the v5 plugin map; using an old sdk.v2 provider reattach config with a newer terraform build.","solutions":["Ensure the terraform binary registers VersionedPlugins[5] (the standard distribution does); if using a custom build, include the v5 plugin set.","Upgrade the provider's go-plugin/sdk so ReattachConfig carries a non-zero ProtocolVersion (5 or 6), avoiding the version-0 fallback entirely.","Use the managed provider discovery path (terraform init) instead of TF_REATTACH_PROVIDERS unless you are actively developing the provider."],"exampleFix":"// before: reattach config reports protocol 0, no v5 map\n reattach := terraform.ReattachConfig{ /* ProtocolVersion unset */ }\n// after: set the negotiated protocol version explicitly\n reattach := terraform.ReattachConfig{ ProtocolVersion: 5 /* or 6 */ }","handlingStrategy":"validation","validationCode":"// When building a reattach provider config, set the protocol version.\n if cfg.ProtocolVersion == 0 {\n     if _, ok := tfplugin.VersionedPlugins[5]; !ok {\n         return errors.New(\"v5 plugin set not registered; set ProtocolVersion explicitly\")\n     }\n }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set ReattachConfig.ProtocolVersion explicitly (5 or 6) so the version-0 fallback is never hit.","Use managed provider discovery (terraform init) instead of TF_REATTACH_PROVIDERS outside active development."],"tags":["provider","plugin","reattach","protocol-version","embedding"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T20:17:04.800Z"}