{"record":{"id":"10e55635d0479e39","repo":"quickwit-oss/quickwit","slug":"bundled-file-range-starts-after-it-ends","errorCode":null,"errorMessage":"bundled file range starts after it ends","messagePattern":"bundled file range starts after it ends","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-storage/src/bundle_storage.rs","lineNumber":130,"sourceCode":"        let (split_bytes, footer_range) = fetch_split_tail(\n            storage.as_ref(),\n            split_path,\n            split_len,\n            DEFAULT_SPLIT_TAIL_WINDOW_NUM_BYTES,\n        )\n        .await?;\n\n        // Parse the bundle file ranges from the split bytes.\n        let tail_start = split_len - split_bytes.len() as u64;\n        let (file_ranges, _hotcache) =\n            BundleFileRanges::open_from_split_bytes(split_bytes.clone())?;\n        let file_range = file_ranges.get(&bundle_filepath).ok_or_else(|| {\n            anyhow::anyhow!(\n                \"missing file `{}` in split bundle\",\n                bundle_filepath.display()\n            )\n        })?;\n        ensure!(\n            file_range.start <= file_range.end,\n            \"bundled file range starts after it ends\"\n        );\n        ensure!(\n            file_range.end <= footer_range.start,\n            \"bundled file range overlaps split footer\"\n        );\n\n        // If the initial tail also contains the file, reuse it and complete in one GET (at least).\n        // Otherwise, fetch the file with an additional GET.\n        let file_bytes = if file_range.start >= tail_start {\n            let relative_start = (file_range.start - tail_start) as usize;\n            let relative_end = (file_range.end - tail_start) as usize;\n            split_bytes.slice(relative_start..relative_end)\n        } else {\n            let relative_start = file_range.start as usize;\n            let relative_end = file_range.end as usize;\n            storage","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-storage/src/bundle_storage.rs#L112-L148","documentation":"While fetching a file stored inside a split bundle, the bundle storage looks up the file's byte range and checks it is well-formed (start <= end). A range with start > end is structurally impossible from correct writers, so this indicates a corrupted split bundle footer/metadata. The library refuses to issue a nonsensical GET.","triggerScenarios":"Calling `fetch_file_from_split` on a split whose bundle metadata maps the requested file to an inverted byte range (start > end), produced by corrupted bundle metadata or a writer bug.","commonSituations":"Split files corrupted in transit or in object storage; splits written by a buggy or mismatched Quickwit version; truncated then manually patched bundle metadata.","solutions":["Re-upload or re-index the affected split to regenerate correct bundle metadata.","Verify the split file's integrity (checksum) against its source; replace it if corrupted.","Check the Quickwit version that wrote the split; upgrade if a known writer bug produced bad ranges."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match bundle_storage.fetch_file_from_split(split, path).await {\n    Ok(bytes) => bytes,\n    Err(e) if e.to_string().contains(\"bundled file range\") => {\n        // mark split as corrupted, trigger re-index/re-upload\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Enable checksum verification of split files at upload/download boundaries.","Avoid any external process writing to split objects in storage.","Keep writer and reader Quickwit versions aligned in the cluster."],"tags":["storage","split-bundle","corruption"],"backgroundTag":"internal-invariant-violation","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}