{"record":{"id":"2d151a9934bbefa2","repo":"hashicorp/terraform","slug":"registry-response-includes-invalid-version-string","errorCode":null,"errorMessage":"registry response includes invalid version string %q: %s","messagePattern":"registry response includes invalid version string %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/getproviders/registry_client.go","lineNumber":246,"sourceCode":"\t\tSHA256SumsURL          string `json:\"shasums_url\"`\n\t\tSHA256SumsSignatureURL string `json:\"shasums_signature_url\"`\n\n\t\tSigningKeys SigningKeyList `json:\"signing_keys\"`\n\t}\n\tvar body ResponseBody\n\n\tdec := json.NewDecoder(resp.Body)\n\tif err := dec.Decode(&body); err != nil {\n\t\treturn PackageMeta{}, c.errQueryFailed(provider, err)\n\t}\n\n\tvar protoVersions VersionList\n\tfor _, versionStr := range body.Protocols {\n\t\tv, err := ParseVersion(versionStr)\n\t\tif err != nil {\n\t\t\treturn PackageMeta{}, c.errQueryFailed(\n\t\t\t\tprovider,\n\t\t\t\tfmt.Errorf(\"registry response includes invalid version string %q: %s\", versionStr, err),\n\t\t\t)\n\t\t}\n\t\tprotoVersions = append(protoVersions, v)\n\t}\n\tprotoVersions.Sort()\n\n\t// Verify that this version of terraform supports the providers' protocol\n\t// version(s)\n\tif len(protoVersions) > 0 {\n\t\tsupportedProtos := MeetingConstraints(SupportedPluginProtocols)\n\t\tprotoErr := ErrProtocolNotSupported{\n\t\t\tProvider: provider,\n\t\t\tVersion:  version,\n\t\t}\n\t\tmatch := false\n\t\tfor _, version := range protoVersions {\n\t\t\tif supportedProtos.Has(version) {\n\t\t\t\tmatch = true","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/getproviders/registry_client.go#L228-L264","documentation":"Thrown while parsing the 'protocols' array from the registry's package-version response. Each protocol string is parsed with ParseVersion; the first that fails aborts the request as a registry query failure.","triggerScenarios":"ParseVersion(versionStr) returned an error for an entry in body.Protocols (e.g. '5', 'v5.2.0', '5.x', empty string, non-semver token).","commonSituations":"Registry returns a protocol string without required minor/patch components or with a leading 'v'; custom/airgapped registry emitting a non-semver format; schema regression where protocols field contains a single combined string instead of an array.","solutions":["Report the malformed protocol string to the registry operator","If self-hosting the registry, emit protocol versions as full 'MAJOR.MINOR.PATCH' without a 'v' prefix","Confirm the registry endpoint implements the expected provider-protocol schema"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"meta, err := c.PackageMeta(ctx, provider, version, target)\nif err != nil && strings.Contains(err.Error(), \"invalid version string\") {\n    return fmt.Errorf(\"registry returned a malformed protocol version for %s: %w\", provider, err)\n}","preventionTips":["Self-hosted registries must emit protocol versions as full semver without a 'v' prefix","Monitor registry responses for schema regressions in the protocols field"],"tags":["registry","version","protocol","provider","validation"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}