vectordotdev/vector · error

`Configurable` does not support numbers larger than an…

Error message

`Configurable` does not support numbers larger than an `f64` representation

What it means

`get_enforced_min_bound` converts the numeric type's mechanical minimum value into an f64 to clamp it against the JSON-Schema-enforced lower bound, panicking with "`Configurable` does not support numbers larger than an `f64` representation" if the conversion fails. This fires when a numeric type's minimum cannot be represented as f64 (e.g. u128/i128-scale values). The design intentionally limits Configurable to numeric types whose bounds fit f64.

Solutions

  1. Use a standard-width integer (u8..u64, i8..i64, f32/f64) for the config field instead of 128-bit types
  2. If a wide value is required, wrap it in a String or a validated custom type with a manual Configurable impl
  3. Coerce the value to f64 at the config boundary and document the precision limitation

Example fix

// before
let count: i128 = config.count;
// after
let count: i64 = config.count; // fits f64 representation for schema generation
Defensive patterns

Strategy: validation

Validate before calling

// Check f64 representability before schema generation:
let min = <T as ConfigurableNum>::Numeric::min_value();
assert!(min.to_f64().is_some(), "type not f64-representable");

Type guard

fn fits_f64<N: ToPrimitive>(n: &N) -> bool { n.to_f64().is_some() }

Prevention

When it happens

Trigger: Deriving/generating a schema for a Configurable integer type whose `Numeric::min_value()` fails to_f64() — typically a 128-bit integer or any numeric wired in with a magnitude beyond f64's exact/representable range.

Common situations: Adding i128/u128 (or bigint-backed) config fields to a component and deriving Configurable; upgrading a field's type to a wider integer and regenerating schemas.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/5eccfd71354b63ca. Report an issue: GitHub.

Appendix: source

Thrown at lib/vector-config/src/num.rs:92

            .or(zero_num_floating)
            .expect("No usable integer type should be unrepresentable by both `u64` and `f64`.")
    }

    /// Gets the minimum bound for this numeric type, limited by the representable range in JSON Schema.
    fn get_enforced_min_bound() -> f64 {
        let mechanical_minimum = match (Self::is_nonzero(), Self::requires_nonzero_exclusion()) {
            // If the number is not a nonzero type, or it is a nonzero type, but needs an exclusion, we simply return
            // its true mechanical minimum bound. For nonzero types, this is because we can only enforce the nonzero
            // constraint through a negative schema bound, not through its normal minimum/maximum bounds validation.
            (false, _) | (true, true) => Self::Numeric::min_value(),
            // If the number is a nonzero type, but does not need an exclusion, its minimum bound is always 1.
            (true, false) => Self::Numeric::one(),
        };

        let enforced_minimum = NUMERIC_ENFORCED_LOWER_BOUND;
        let mechanical_minimum = mechanical_minimum
            .to_f64()
            .expect("`Configurable` does not support numbers larger than an `f64` representation");

        if mechanical_minimum < enforced_minimum {
            enforced_minimum
        } else {
            mechanical_minimum
        }
    }

    /// Gets the maximum bound for this numeric type, limited by the representable range in JSON Schema.
    fn get_enforced_max_bound() -> f64 {
        let enforced_maximum = NUMERIC_ENFORCED_UPPER_BOUND;
        let mechanical_maximum = Self::Numeric::max_value()
            .to_f64()
            .expect("`Configurable` does not support numbers larger than an `f64` representation");

        if mechanical_maximum > enforced_maximum {
            enforced_maximum
        } else {

View on GitHub (pinned to bdb87aeaa4)