weaviate/weaviate · error

unexpected threshold version tag: %s

Error message

unexpected threshold version tag: %s

What it means

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.

Source

Thrown at modules/text2vec-contextionary/client/version_checks.go:34

	"regexp"
	"strconv"
)

const (
	inputVersionRegexString   = `^.*-v(?P<Major>[0-9]+)\.(?P<Minor>[0-9]+)\.(?P<Patch>[0-9]+)$`
	minimumVersionRegexString = `^(?P<Major>[0-9]+)\.(?P<Minor>[0-9])+\.(?P<Patch>[0-9]+)$`
)

func extractVersionAndCompare(input, requiredMin string) (bool, error) {
	inputRegexp := regexp.MustCompile(inputVersionRegexString)
	minimumRegexp := regexp.MustCompile(minimumVersionRegexString)

	if ok := inputRegexp.MatchString(input); !ok {
		return false, fmt.Errorf("unexpected input version tag: %s", input)
	}

	if ok := minimumRegexp.MatchString(requiredMin); !ok {
		return false, fmt.Errorf("unexpected threshold version tag: %s", requiredMin)
	}

	inputMatches := inputRegexp.FindAllStringSubmatch(input, 4)
	inputMajor, _ := strconv.Atoi(inputMatches[0][1])
	inputMinor, _ := strconv.Atoi(inputMatches[0][2])
	inputPatch, _ := strconv.Atoi(inputMatches[0][3])

	minimumMatches := minimumRegexp.FindAllStringSubmatch(requiredMin, 4)
	minimumMajor, _ := strconv.Atoi(minimumMatches[0][1])
	minimumMinor, _ := strconv.Atoi(minimumMatches[0][2])
	minimumPatch, _ := strconv.Atoi(minimumMatches[0][3])

	return compareSemver(inputMajor, inputMinor, inputPatch, minimumMajor, minimumMinor, minimumPatch), nil
}

func compareSemver(iMaj, iMin, iPat, rMaj, rMin, rPat int) bool {
	if iMaj > rMaj {
		return true

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Fix the requiredMin value to full semver 'major.minor.patch' in the format the regex expects (no leading 'v' unless allowed).
  2. Inspect version_checks.go for the exact minimumVersionRegexString and match your threshold to it.
  3. If triggered only in tests, correct the test fixture to a valid threshold string.

Example fix

// before
extractVersionAndCompare(input, "v1.0")
// after
extractVersionAndCompare(input, "1.0.0")
Defensive patterns

Strategy: validation

Validate before calling

var minVersionRe = regexp.MustCompile(`^[0-9]+\.[0-9]+\.[0-9]+$`)
if !minVersionRe.MatchString(requiredMin) {
    return fmt.Errorf("configured min version %q is not valid semver", requiredMin)
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/ab5ceb6c50fb0935. Report an issue: GitHub.