{"record":{"id":"ba5426f1e7bda0b1","repo":"GitoxideLabs/gitoxide","slug":"integer-out-of-range","errorCode":null,"errorMessage":"integer out of range","messagePattern":"integer out of range","errorType":"validation","errorClass":"gix_config::value::Error","httpStatus":null,"severity":"error","filePath":"gix/src/config/tree/sections/pack.rs","lineNumber":65,"sourceCode":"    }\n\n    fn keys(&self) -> &[&dyn Key] {\n        &[&Self::THREADS, &Self::INDEX_VERSION, &Self::COMPRESSION]\n    }\n}\n\nmod validate {\n    use crate::{bstr::BStr, config::tree::keys};\n\n    #[derive(Clone, Copy)]\n    pub struct IndexVersion;\n    impl keys::Validate for IndexVersion {\n        fn validate(&self, value: &BStr) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {\n            super::Pack::INDEX_VERSION.try_into_index_version(\n                gix_config::Integer::try_from(value)\n                    .and_then(|int| {\n                        int.to_decimal()\n                            .ok_or_else(|| gix_config::value::Error::new(\"integer out of range\", value))\n                    })\n                    .map(Some),\n            )?;\n            Ok(())\n        }\n    }\n}\n","sourceCodeStart":47,"sourceCodeEnd":73,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix/src/config/tree/sections/pack.rs#L47-L73","documentation":"When validating the `pack.indexVersion` config value, the integer parsed but `to_decimal()` failed (value out of representable range), producing a `gix_config::value::Error` with message 'integer out of range'.","triggerScenarios":"Setting `pack.indexVersion` to an integer whose magnitude exceeds the representable decimal range for the config integer type.","commonSituations":"Typos in huge numbers; misunderstanding that indexVersion only accepts 1 or 2 and writing a large number; copy-paste of sentinel values.","solutions":["Set `pack.indexVersion` to 1 or 2 (the only valid index formats)","Remove the invalid key to use the default version","Use `git config pack.indexVersion 2`"],"exampleFix":"// before (.git/config)\n[pack]\n\tindexVersion = 99999999999999999999\n// after\n[pack]\n\tindexVersion = 2","handlingStrategy":"validation","validationCode":"fn valid_index_version(s: &str) -> bool {\n    matches!(s, \"1\" | \"2\")\n}\n// check before writing pack.indexVersion to config","typeGuard":null,"tryCatchPattern":"match gix::open(path) {\n    Err(e) if e.to_string().contains(\"integer out of range\") => {\n        eprintln!(\"fix pack.indexVersion in config (must be 1 or 2): {e}\");\n    }\n    other => other?,\n}","preventionTips":["Remember pack.indexVersion only accepts 1 or 2","Write config values via validated APIs instead of manual edits","Validate all pack.* config after editing config files by hand"],"tags":["config","validation","integer-overflow","git","pack"],"backgroundTag":"value-out-of-range","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}