{"record":{"id":"5eccfd71354b63ca","repo":"vectordotdev/vector","slug":"configurable-does-not-support-numbers-larger-than-an-f64","errorCode":null,"errorMessage":"`Configurable` does not support numbers larger than an `f64` representation","messagePattern":"`Configurable` does not support numbers larger than an `f64` representation","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/vector-config/src/num.rs","lineNumber":92,"sourceCode":"            .or(zero_num_floating)\n            .expect(\"No usable integer type should be unrepresentable by both `u64` and `f64`.\")\n    }\n\n    /// Gets the minimum bound for this numeric type, limited by the representable range in JSON Schema.\n    fn get_enforced_min_bound() -> f64 {\n        let mechanical_minimum = match (Self::is_nonzero(), Self::requires_nonzero_exclusion()) {\n            // If the number is not a nonzero type, or it is a nonzero type, but needs an exclusion, we simply return\n            // its true mechanical minimum bound. For nonzero types, this is because we can only enforce the nonzero\n            // constraint through a negative schema bound, not through its normal minimum/maximum bounds validation.\n            (false, _) | (true, true) => Self::Numeric::min_value(),\n            // If the number is a nonzero type, but does not need an exclusion, its minimum bound is always 1.\n            (true, false) => Self::Numeric::one(),\n        };\n\n        let enforced_minimum = NUMERIC_ENFORCED_LOWER_BOUND;\n        let mechanical_minimum = mechanical_minimum\n            .to_f64()\n            .expect(\"`Configurable` does not support numbers larger than an `f64` representation\");\n\n        if mechanical_minimum < enforced_minimum {\n            enforced_minimum\n        } else {\n            mechanical_minimum\n        }\n    }\n\n    /// Gets the maximum bound for this numeric type, limited by the representable range in JSON Schema.\n    fn get_enforced_max_bound() -> f64 {\n        let enforced_maximum = NUMERIC_ENFORCED_UPPER_BOUND;\n        let mechanical_maximum = Self::Numeric::max_value()\n            .to_f64()\n            .expect(\"`Configurable` does not support numbers larger than an `f64` representation\");\n\n        if mechanical_maximum > enforced_maximum {\n            enforced_maximum\n        } else {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/lib/vector-config/src/num.rs#L74-L110","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use a standard-width integer (u8..u64, i8..i64, f32/f64) for the config field instead of 128-bit types","If a wide value is required, wrap it in a String or a validated custom type with a manual Configurable impl","Coerce the value to f64 at the config boundary and document the precision limitation"],"exampleFix":"// before\nlet count: i128 = config.count;\n// after\nlet count: i64 = config.count; // fits f64 representation for schema generation","handlingStrategy":"validation","validationCode":"// Check f64 representability before schema generation:\nlet min = <T as ConfigurableNum>::Numeric::min_value();\nassert!(min.to_f64().is_some(), \"type not f64-representable\");","typeGuard":"fn fits_f64<N: ToPrimitive>(n: &N) -> bool { n.to_f64().is_some() }","tryCatchPattern":null,"preventionTips":["Keep config integer fields at 64-bit width or smaller","Never derive Configurable on 128-bit or bigint-backed fields","Document precision limits when widening config field types"],"tags":["rust","numeric","schema","range"],"backgroundTag":"value-out-of-range","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}