facebook/flow · error

failed to deserialize FileSig with errors

Error message

failed to deserialize FileSig with errors

What it means

Panics when bincode fails to decode the paired (FileSig, Vec<TolerableError<Loc>>) record from decompressed bytes. This variant stores a file signature together with tolerable errors so a recheck can proceed with warnings; it needs the file_key thread-local for Loc decoding. Corrupt bytes or schema drift between writer and reader cause the failure.

Source

Thrown at rust_port/crates/flow_heap_serialization/src/lib.rs:165

pub fn serialize_file_sig_with_errors(
    file_sig: &FileSig,
    errors: &[TolerableError<Loc>],
) -> Vec<u8> {
    let bytes = bincode::serde::encode_to_vec((file_sig, errors), bincode::config::legacy())
        .expect("failed to serialize FileSig with errors");
    compress(&bytes)
}

pub fn deserialize_file_sig_with_errors(
    file_key: &FileKey,
    bytes: &[u8],
) -> (Arc<FileSig>, Arc<[TolerableError<Loc>]>) {
    let decompressed = decompress(bytes);
    set_file_key(file_key);
    let ((file_sig, errors), _): ((FileSig, Vec<TolerableError<Loc>>), _) =
        bincode::serde::decode_from_slice(&decompressed, bincode::config::legacy())
            .expect("failed to deserialize FileSig with errors");
    clear_file_key();
    (Arc::new(file_sig), Arc::from(errors))
}

View on GitHub (pinned to f88ac94bcf)

Solutions

  1. Invalidate the saved state containing these records so files are re-signed
  2. Version-stamp caches by binary/serialized-schema version
  3. Regenerate serialized fixtures after touching FileSig or TolerableError
Defensive patterns

Strategy: fallback

Try / catch

match std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
    flow_heap_serialization::deserialize_file_sig_with_errors(&file_key, &bytes)
})) {
    Ok(pair) => pair,
    Err(_) => { invalidate_saved_state(); recompute_file_sig_with_errors(&file_key)? }
}

Prevention

When it happens

Trigger: deserialize_file_sig_with_errors on a truncated or version-mismatched cache file; a change to TolerableError or FileSig serialization without invalidating saved states; decoding under a file_key that doesn't match the stored Locs.

Common situations: Reusing saved state across flow upgrades; killed writers leaving partial records; fixtures regenerated by an older binary.

Related errors


AI-assisted analysis of facebook/flow@f88ac94bcf (2026-08-20). Data as JSON: /api/errors/3386e96cdd6c437d. Report an issue: GitHub.