{"record":{"id":"17ab948da7f98104","repo":"hashicorp/terraform","slug":"unknown-address-type-q-for-q","errorCode":null,"errorMessage":"Unknown address type %q for %q","messagePattern":"Unknown address type %q for %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/getproviders/reattach/reattach.go","lineNumber":74,"sourceCode":"\t\tfor p, c := range m {\n\t\t\ta, diags := addrs.ParseProviderSourceString(p)\n\t\t\tif diags.HasErrors() {\n\t\t\t\treturn unmanagedProviders, fmt.Errorf(\"Error parsing %q as a provider address: %w\", a, diags.Err())\n\t\t\t}\n\t\t\tvar addr net.Addr\n\t\t\tswitch c.Addr.Network {\n\t\t\tcase \"unix\":\n\t\t\t\taddr, err = net.ResolveUnixAddr(\"unix\", c.Addr.String)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn unmanagedProviders, fmt.Errorf(\"Invalid unix socket path %q for %q: %w\", c.Addr.String, p, err)\n\t\t\t\t}\n\t\t\tcase \"tcp\":\n\t\t\t\taddr, err = net.ResolveTCPAddr(\"tcp\", c.Addr.String)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn unmanagedProviders, fmt.Errorf(\"Invalid TCP address %q for %q: %w\", c.Addr.String, p, err)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn unmanagedProviders, fmt.Errorf(\"Unknown address type %q for %q\", c.Addr.Network, p)\n\t\t\t}\n\t\t\tunmanagedProviders[a] = &plugin.ReattachConfig{\n\t\t\t\tProtocol:        plugin.Protocol(c.Protocol),\n\t\t\t\tProtocolVersion: c.ProtocolVersion,\n\t\t\t\tPid:             c.Pid,\n\t\t\t\tTest:            c.Test,\n\t\t\t\tAddr:            addr,\n\t\t\t}\n\t\t}\n\t}\n\treturn unmanagedProviders, nil\n}\n\n// IsProviderReattached determines if a given provider is being supplied to Terraform via the TF_REATTACH_PROVIDERS\n// environment variable.\n//\n// Calling code is expected to pass in a provider address and the value of os.Getenv(\"TF_REATTACH_PROVIDERS\")\nfunc IsProviderReattached(provider tfaddr.Provider, in string) (bool, error) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/getproviders/reattach/reattach.go#L56-L92","documentation":"ParseReattachProviders only understands Addr.Network values of \"unix\" and \"tcp\". Any other value falls through the switch default, so the address cannot be turned into a net.Addr and reattach setup fails.","triggerScenarios":"TF_REATTACH_PROVIDERS entry whose Addr.Network is neither \"unix\" nor \"tcp\" — e.g. \"grpc\", \"http\", \"unix-socket\", a typo like \"TCp\", or an empty string.","commonSituations":"Schema misunderstanding (user thinks Network should be the protocol); tooling that emits \"grpc\" because Protocol is grpc; case mismatch; missing Network field yielding empty string.","solutions":["Set Addr.Network to exactly \"unix\" or \"tcp\" (case-sensitive).","If using a unix socket use \"unix\" and put the path in Addr.String; if TCP use \"tcp\" and host:port in Addr.String.","Regenerate the JSON from the canonical provider launcher rather than hand-authoring."],"exampleFix":"// before\n\"Addr\": {\"Network\":\"grpc\",\"String\":\"127.0.0.1:12345\"}\n// after\n\"Addr\": {\"Network\":\"tcp\",\"String\":\"127.0.0.1:12345\"}","handlingStrategy":"validation","validationCode":"// Validate the reattach Addr.Network before serializing TF_REATTACH_PROVIDERS.\nfunc validateNetwork(network string) error {\n    switch network {\n    case \"unix\", \"tcp\":\n        return nil\n    default:\n        return fmt.Errorf(\"unsupported Addr.Network %q: must be unix or tcp\", network)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only ever set Addr.Network to \"unix\" or \"tcp\" (case-sensitive).","Do not confuse Addr.Network with the gRPC protocol field.","Generate the JSON from a struct literal so the field is type-checked at compile time."],"tags":["terraform","reattach","tf-reattach-providers","address-type"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}