{"record":{"id":"ab5ceb6c50fb0935","repo":"weaviate/weaviate","slug":"unexpected-threshold-version-tag-s","errorCode":null,"errorMessage":"unexpected threshold version tag: %s","messagePattern":"unexpected threshold version tag: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/text2vec-contextionary/client/version_checks.go","lineNumber":34,"sourceCode":"\t\"regexp\"\n\t\"strconv\"\n)\n\nconst (\n\tinputVersionRegexString   = `^.*-v(?P<Major>[0-9]+)\\.(?P<Minor>[0-9]+)\\.(?P<Patch>[0-9]+)$`\n\tminimumVersionRegexString = `^(?P<Major>[0-9]+)\\.(?P<Minor>[0-9])+\\.(?P<Patch>[0-9]+)$`\n)\n\nfunc extractVersionAndCompare(input, requiredMin string) (bool, error) {\n\tinputRegexp := regexp.MustCompile(inputVersionRegexString)\n\tminimumRegexp := regexp.MustCompile(minimumVersionRegexString)\n\n\tif ok := inputRegexp.MatchString(input); !ok {\n\t\treturn false, fmt.Errorf(\"unexpected input version tag: %s\", input)\n\t}\n\n\tif ok := minimumRegexp.MatchString(requiredMin); !ok {\n\t\treturn false, fmt.Errorf(\"unexpected threshold version tag: %s\", requiredMin)\n\t}\n\n\tinputMatches := inputRegexp.FindAllStringSubmatch(input, 4)\n\tinputMajor, _ := strconv.Atoi(inputMatches[0][1])\n\tinputMinor, _ := strconv.Atoi(inputMatches[0][2])\n\tinputPatch, _ := strconv.Atoi(inputMatches[0][3])\n\n\tminimumMatches := minimumRegexp.FindAllStringSubmatch(requiredMin, 4)\n\tminimumMajor, _ := strconv.Atoi(minimumMatches[0][1])\n\tminimumMinor, _ := strconv.Atoi(minimumMatches[0][2])\n\tminimumPatch, _ := strconv.Atoi(minimumMatches[0][3])\n\n\treturn compareSemver(inputMajor, inputMinor, inputPatch, minimumMajor, minimumMinor, minimumPatch), nil\n}\n\nfunc compareSemver(iMaj, iMin, iPat, rMaj, rMin, rPat int) bool {\n\tif iMaj > rMaj {\n\t\treturn true","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/modules/text2vec-contextionary/client/version_checks.go#L16-L52","documentation":"extractVersionAndCompare also validates the required-minimum version constant with minimumVersionRegexString. If the threshold configured in code/config doesn't match the expected format, it returns 'unexpected threshold version tag'. This is effectively a programming/configuration error in the required-version string, not a remote service problem.","triggerScenarios":"WaitForStartupAndValidateVersion invoked with a requiredMin string that doesn't match the minimum-version regex (e.g. 'v1.0', '1.0', '1.0.0-beta' if the regex disallows suffixes, or an empty value).","commonSituations":"Someone editing the minimum required version constant with a non-semver value; overriding version checks via config with a malformed threshold; tests exercising bad thresholds deliberately.","solutions":["Fix the requiredMin value to full semver 'major.minor.patch' in the format the regex expects (no leading 'v' unless allowed).","Inspect version_checks.go for the exact minimumVersionRegexString and match your threshold to it.","If triggered only in tests, correct the test fixture to a valid threshold string."],"exampleFix":"// before\nextractVersionAndCompare(input, \"v1.0\")\n// after\nextractVersionAndCompare(input, \"1.0.0\")","handlingStrategy":"validation","validationCode":"var minVersionRe = regexp.MustCompile(`^[0-9]+\\.[0-9]+\\.[0-9]+$`)\nif !minVersionRe.MatchString(requiredMin) {\n    return fmt.Errorf(\"configured min version %q is not valid semver\", requiredMin)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep requiredMin constants in full major.minor.patch form without a leading 'v'.","Add a unit test asserting the minimum-version constant matches the regex.","Review version_checks.go regex before editing version constants."],"tags":["go","versioning","configuration"],"backgroundTag":"version-incompatible","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}