{"record":{"id":"0f8a899f03bf9e3f","repo":"influxdata/influxdb","slug":"prune-percent-must-be-between-0-and-1","errorCode":null,"errorMessage":"prune percent must be between 0 and 1","messagePattern":"prune percent must be between 0 and 1","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"influxdb3/src/commands/serve.rs","lineNumber":890,"sourceCode":"\n#[derive(Debug, Clone, Copy)]\npub struct ParquetCachePrunePercent(f64);\n\nimpl From<ParquetCachePrunePercent> for f64 {\n    fn from(value: ParquetCachePrunePercent) -> Self {\n        value.0\n    }\n}\n\nimpl FromStr for ParquetCachePrunePercent {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> std::prelude::v1::Result<Self, Self::Err> {\n        let p = s\n            .parse::<f64>()\n            .context(\"failed to parse prune percent as f64\")?;\n        if p <= 0.0 || p >= 1.0 {\n            bail!(\"prune percent must be between 0 and 1\");\n        }\n        Ok(Self(p))\n    }\n}\n\n/// Apply values given through deprecated legacy aliases of renamed size\n/// options to their new counterparts, and warn about pre-3.11 value formats.\n///\n/// An explicitly set new name wins over its legacy alias, matching the\n/// precedence `env_compat` applied when the old env var name was an alias of\n/// the new one.\nfn resolve_legacy_size_options(config: &mut Config, user_params: &HashMap<String, String>) {\n    fn apply(\n        legacy: Option<LegacyMemorySizeMb>,\n        legacy_flag: &str,\n        new_flag: &str,\n        new_value: &mut MemorySizeMb,\n        user_params: &HashMap<String, String>,","sourceCodeStart":872,"sourceCodeEnd":908,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3/src/commands/serve.rs#L872-L908","documentation":"Raised in the FromStr implementation of the prune-percent config type. After parsing the value as f64, it is rejected unless strictly between 0.0 and 1.0, since the prune percent is an inclusive-exclusive fraction (e.g. 0.2 for 20%).","triggerScenarios":"Passing a value <= 0 or >= 1 for the prune percent option (e.g. `0`, `1`, `1.0`, `50` intending percent-as-integer).","commonSituations":"Users writing \"50\" meaning 50% instead of 0.5, or supplying 0/1 as boundary values that the type deliberately excludes.","solutions":["Provide the value as a fraction strictly between 0 and 1, e.g. 0.2 instead of 20 or 0.","Remove the prune-percent override to use the default if a custom value is not needed.","Check the surrounding \"failed to parse prune percent as f64\" context if the value is non-numeric."],"exampleFix":"# before\n--prune-percent 50\n# after\n--prune-percent 0.5","handlingStrategy":"validation","validationCode":"let p: f64 = value.parse()?;\nif !(p > 0.0 && p < 1.0) {\n    return Err(\"prune percent must be strictly between 0 and 1 (e.g. 0.5)\");\n}","typeGuard":"fn valid_prune_percent(p: f64) -> bool {\n    p > 0.0 && p < 1.0\n}","tryCatchPattern":null,"preventionTips":["Always express percentages as fractions (0.5, not 50).","Validate config values in scripts before passing them to the CLI.","Remember the bounds are exclusive: 0 and 1 are both rejected."],"tags":["configuration","cli","validation"],"backgroundTag":"value-out-of-range","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}