{"record":{"id":"25126c20ba037384","repo":"rtk-ai/rtk","slug":"failed-to-parse-binlog-at-unsupported-binlog-f","errorCode":null,"errorMessage":"Failed to parse binlog at {}: unsupported binlog format {}","messagePattern":"Failed to parse binlog at (.+?): unsupported binlog format (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/cmds/dotnet/binlog.rs","lineNumber":324,"sourceCode":"    let mut decoder = GzDecoder::new(bytes.as_slice());\n    let mut payload = Vec::new();\n    decoder.read_to_end(&mut payload).with_context(|| {\n        format!(\n            \"Failed to parse binlog at {}: gzip decode failed\",\n            path.display()\n        )\n    })?;\n\n    let mut reader = BinReader::new(&payload);\n    let file_format_version = reader\n        .read_i32_le()\n        .context(\"binlog header missing file format version\")?;\n    let _minimum_reader_version = reader\n        .read_i32_le()\n        .context(\"binlog header missing minimum reader version\")?;\n\n    if file_format_version < 18 {\n        anyhow::bail!(\n            \"Failed to parse binlog at {}: unsupported binlog format {}\",\n            path.display(),\n            file_format_version\n        );\n    }\n\n    let mut parsed = ParsedBinlog::default();\n\n    while !reader.is_eof() {\n        let kind = reader\n            .read_7bit_i32()\n            .context(\"failed to read record kind\")?;\n        if kind == RECORD_END_OF_FILE {\n            break;\n        }\n\n        match kind {\n            RECORD_STRING => {","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/cmds/dotnet/binlog.rs#L306-L342","documentation":"parse_events_from_binlog reads the binlog header's file format version and rejects anything below 18 with this error. Binlog format 18 corresponds to a modern MSBuild (Visual Studio 2022 / .NET 6+ era); older formats use different record layouts that this parser does not implement. The message includes the offending version number so the user knows how old their toolchain output is.","triggerScenarios":"Parsing a .binlog whose first 8 bytes contain file_format_version < 18, e.g. logs produced by MSBuild 15/16 (VS 2017/2019, .NET Core 3.1 era) or by a corrupted file where the version field decodes as a small number.","commonSituations":"Analyzing binlogs generated on an older build agent or by a legacy .NET Framework MSBuild; sharing build logs from an older CI pipeline; a truncated/corrupt file whose gzip payload decodes with a bogus version header.","solutions":["Regenerate the binlog with a current SDK: install .NET 8/9 SDK (or VS 2022) and re-run `dotnet build -bl`.","If the old log must be inspected, open it in the MSBuild Structured Log Viewer version matching its producer instead of this parser.","Verify the binlog is not truncated/corrupt — re-download or rebuild if the header version looks implausibly low.","If support for older formats is genuinely needed, extend parse_events_from_binlog to handle file_format_version 6–17 dictionary/record layouts."],"exampleFix":"// before\ndotnet build -bl:old.binlog   # produced by .NET Core 3.1 SDK\n// after\nglobal.json: { \"sdk\": { \"version\": \"8.0.100\" } }\ndotnet build -bl:current.binlog","handlingStrategy":"validation","validationCode":"fn binlog_version_ok(path: &Path) -> anyhow::Result<bool> {\n    let bytes = std::fs::read(path)?;\n    let mut d = flate2::read::GzDecoder::new(bytes.as_slice());\n    let mut hdr = [0u8; 4];\n    d.read_exact(&mut hdr)?;\n    Ok(i32::from_le_bytes(hdr) >= 18)\n}","typeGuard":"fn supports_binlog(version: i32) -> bool { version >= 18 }","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"unsupported binlog format\") => {\n        eprintln!(\"regenerate this log with a modern .NET SDK\");\n    }\n    other => other?,\n}","preventionTips":["Pin the producing toolchain with global.json to a current SDK (>= .NET 6 / MSBuild 17 era)","Record the SDK version alongside CI binlog artifacts so old logs are identifiable","Check `dotnet --info` on build agents before archiving logs for later analysis","Treat binlogs older than format 18 as incompatible inputs and regenerate rather than parse"],"tags":["dotnet","binlog","version-compatibility","msbuild"],"backgroundTag":"unsupported-operation","analyzedSha":"0924356b4caba4989607227b7c8824d3d8098719","analyzedAt":"2026-09-19T19:25:29.612Z","contentChangedAt":"2026-09-19T19:25:29.612Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}