weaviate/weaviate · error
parse %s as float64: %w
Error message
parse %s as float64: %w
What it means
parseFloat64 parses the given env var with strconv.ParseFloat(v, 64); on failure it returns "parse <envName> as float64: %w". This helper underlies all float settings (including parsePercentage), so any non-numeric or malformed float string trips it.
Source
Thrown at usecases/config/environment.go:1809
}
func parsePercentage(envName string, cb func(val float64), defaultValue float64) error {
return parseFloat64(envName, defaultValue, func(val float64) error {
if val < 0 || val > 1 {
return fmt.Errorf("%s must be between 0 and 1", envName)
}
return nil
}, cb)
}
func parseFloat64(envName string, defaultValue float64, verify func(val float64) error, cb func(val float64)) error {
var err error
asFloat := defaultValue
if v := os.Getenv(envName); v != "" {
asFloat, err = strconv.ParseFloat(v, 64)
if err != nil {
return fmt.Errorf("parse %s as float64: %w", envName, err)
}
if err = verify(asFloat); err != nil {
return err
}
}
cb(asFloat)
return nil
}
func validatePositiveInt(val int, envName string) error {
if val <= 0 {
return fmt.Errorf("%s must be an integer greater than 0. Got: %v", envName, val)
}
return nil
}
func validateNonNegativeInt(val int, envName string) error {View on GitHub (pinned to 75aa4b6d11)
Solutions
- Use a dot as the decimal separator and no units: 0.5.
- Strip whitespace/quotes; note that quoted values in shell exports may keep literal quotes.
- Unset the variable to use the default.
Example fix
// before SOME_RATIO=0,5 // after SOME_RATIO=0.5
Defensive patterns
Strategy: validation
Validate before calling
if v := os.Getenv(envName); v != "" {
if _, err := strconv.ParseFloat(v, 64); err != nil {
return fmt.Errorf("%s must be a dot-separated float64, got %q", envName, v)
}
} Prevention
- Use '.' decimal separators; never locale commas.
- Strip units and percent signs from numeric env values.
- Render numbers with machine formatting (no thousands separators) in config generators.
When it happens
Trigger: Setting a float env var to a locale-formatted number ("0,5"), a value with a unit ("0.5%"), or plain text.
Common situations: Comma decimal separators from European locales, units appended to values, YAML-style booleans where numbers were expected.
Related errors
- parse QUERY_DEFAULTS_LIMIT_GRAPHQL as int: %w
- parse QUERY_MAXIMUM_RESULTS as int: %w
- parse QUERY_HYBRID_MAXIMUM_RESULTS as int: %w
- parse QUERY_BOOST_DEFAULT_DEPTH as int: %w
- parse QUERY_NESTED_CROSS_REFERENCE_LIMIT as int: %w
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/1bfa444ca0896155.
Report an issue: GitHub.