rtk-ai/rtk · error · anyhow::Error

legacy dictionary format is unsupported

Error message

legacy dictionary format is unsupported

What it means

skip_string_dictionary, invoked from read_event_fields, refuses to decode the string dictionary when file_format_version < 10. Binlogs before format 10 used a different (legacy) string-record dictionary layout that this parser does not implement; the only supported path reads a 7-bit count for modern formats. Rather than silently skipping garbage, it reports the format limitation explicitly.

Solutions

  1. Regenerate the build log with a modern SDK (`dotnet build -bl`) so the binlog uses format >= 10 (in practice >= 18 for this parser).
  2. Inspect legacy logs with the matching-era MSBuild Structured Log Viewer instead of this parser.
  3. Convert or re-run the equivalent build on an upgraded build agent / container image with a current .NET SDK.
  4. If legacy support is required, implement the pre-10 string-record dictionary layout in skip_string_dictionary.

Example fix

// before
msbuild solution.sln /bl:legacy.binlog   # old full-framework MSBuild, format < 10
// after
dotnet build solution.sln -bl:modern.binlog   # modern SDK, format >= 18
Defensive patterns

Strategy: validation

Validate before calling

// refuse legacy binlogs up front (same header check as the parser)
let version = read_binlog_format_version(path)?; // gzip-decoded first i32
if version < 10 {
    bail!("binlog format {} is legacy; regenerate with a modern SDK", version);
}

Type guard

fn is_modern_binlog(version: i32) -> bool { version >= 10 }

Try / catch

match result {
    Err(e) if e.to_string().contains("legacy dictionary format") => {
        eprintln!("legacy MSBuild log detected; rebuild with modern SDK to analyze");
        Err(e)
    }
    other => other,
}

Prevention

When it happens

Trigger: read_event_fields encounters the string-dictionary record on a binlog whose header version is between 6 and 9 (MSBuild from roughly VS 2015 / early MSBuild 15 era), making skip_string_dictionary bail immediately.

Common situations: Analyzing archived build logs from legacy on-prem build agents; old .NET Framework full-MSBuild logs checked into a repo years ago; replaying old CI artifacts into a modern analysis tool.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of rtk-ai/rtk@0924356b4c (2026-09-19). Data as JSON: /api/errors/3913759cd370122b. Report an issue: GitHub.

Appendix: source

Thrown at src/cmds/dotnet/binlog.rs:512

    if (file_format_version < 13 && read_importance) || (flags & FLAG_IMPORTANCE != 0) {
        let _ = reader.read_7bit_i32()?;
    }

    Ok(result)
}

fn skip_build_event_context(reader: &mut BinReader<'_>, file_format_version: i32) -> Result<()> {
    let count = if file_format_version > 1 { 7 } else { 6 };
    for _ in 0..count {
        let _ = reader.read_7bit_i32()?;
    }
    Ok(())
}

fn skip_string_dictionary(reader: &mut BinReader<'_>, file_format_version: i32) -> Result<()> {
    if file_format_version < 10 {
        anyhow::bail!("legacy dictionary format is unsupported");
    }

    let _ = reader.read_7bit_i32()?;
    Ok(())
}

fn read_optional_string(
    reader: &mut BinReader<'_>,
    parsed: &ParsedBinlog,
) -> Result<Option<String>> {
    read_deduplicated_string(reader, parsed)
}

fn read_deduplicated_string(
    reader: &mut BinReader<'_>,
    parsed: &ParsedBinlog,
) -> Result<Option<String>> {
    let index = reader.read_7bit_i32()?;

View on GitHub (pinned to 0924356b4c)