goharbor/harbor · error

invalid float64 string

Error message

invalid float64 string: %s

What it means

Parse failure in parseFloat64 helper: strconv.ParseFloat rejected the string, so the config value cannot be interpreted as a float64.

Solutions

  1. Provide a valid floating point literal such as '0.5' or '10'
  2. Check for stray characters, commas or units in the value
  3. Validate numeric input on the client before submitting configuration
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/config/metadata/type.go:287 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/2005a663bc2a0407. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/config/metadata/type.go:287

	if err == nil {
		return int(val), nil
	}

	fval, err := strconv.ParseFloat(str, 32)
	if err == nil && fval == math.Trunc(fval) {
		return int(fval), nil
	}

	return 0, fmt.Errorf("invalid int string: %s", str)
}

func parseFloat64(str string) (float64, error) {
	val, err := strconv.ParseFloat(str, 64)
	if err == nil {
		return val, nil
	}

	return 0, fmt.Errorf("invalid float64 string: %s", str)
}

View on GitHub (pinned to 7b2fd08cc5)