{"record":{"id":"e97371b35e573f03","repo":"vercel/next.js","slug":"mixed-type-fixed-key-block-claims-a-value-footprint-byte","errorCode":null,"errorMessage":"mixed-type fixed key block claims a {value_footprint} byte value footprint, over the {MAX_INLINE_VALUE_SIZE} byte maximum","messagePattern":"mixed-type fixed key block claims a (.+?) byte value footprint, over the (.+?) byte maximum","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"turbopack/crates/turbo-persistence/src/static_sorted_file.rs","lineNumber":1708,"sourceCode":"/// How a fixed-size key block encodes its entry values, decoded from the block header.\nstruct FixedValueLayout {\n    /// The type shared by every entry, or `None` if each entry carries its own type byte.\n    value_type: Option<u8>,\n    /// Value bytes per entry, including any per-entry type byte.\n    val_size: usize,\n    /// Total header size, which the entry data follows.\n    header_size: usize,\n}\n\n/// Decodes the value layout from a fixed-size key block header.\nfn fixed_value_layout(block: &[u8], header_type: u8) -> Result<FixedValueLayout> {\n    if header_type == FIXED_KEY_BLOCK_MIXED_VALUE_TYPE {\n        // Mixed-type block: the value size follows the header's type byte, and each entry\n        // carries its own type.\n        ensure!(block.len() >= 7, \"mixed-type fixed key block too short\");\n        // Validate the value footprint byte\n        let value_footprint = be::read_u8(&block[6..]) as usize;\n        ensure!(\n            value_footprint <= MAX_INLINE_VALUE_SIZE,\n            \"mixed-type fixed key block claims a {value_footprint} byte value footprint, over the \\\n             {MAX_INLINE_VALUE_SIZE} byte maximum\"\n        );\n        Ok(FixedValueLayout {\n            value_type: None,\n            // +1 for the per-entry type byte, which is part of the stride.\n            val_size: value_footprint + 1,\n            header_size: 7,\n        })\n    } else {\n        Ok(FixedValueLayout {\n            value_type: Some(header_type),\n            val_size: entry_val_size(header_type)?,\n            header_size: 6,\n        })\n    }\n}","sourceCodeStart":1690,"sourceCodeEnd":1726,"githubUrl":"https://github.com/vercel/next.js/blob/34433fd12ee8074ea3f47af9f36255c7390d0301/turbopack/crates/turbo-persistence/src/static_sorted_file.rs#L1690-L1726","documentation":"In a mixed-type fixed key block, each entry carries its own type and the header carries a single value footprint byte; that footprint must not exceed MAX_INLINE_VALUE_SIZE. This error is thrown when the footprint byte read from block[6] is larger than the format's maximum, indicating corrupt or out-of-format data.","triggerScenarios":"Decoding a fixed key block with header_type == FIXED_KEY_BLOCK_MIXED_VALUE_TYPE where be::read_u8(&block[6..]) > MAX_INLINE_VALUE_SIZE during static sorted file reads.","commonSituations":"Bit-flipped or truncated cache bytes, cache written by a different format version, or manual edits to persisted cache files.","solutions":["Remove the corrupt cache directory and allow the cache to be regenerated.","Confirm no concurrent writers or external tools touched the cache files.","If it recurs on fresh caches, align versions (reader/writer format mismatch) and report an upstream bug."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check the footprint byte before decoding a mixed-type block\nfunction footprintValid(block: Buffer): boolean {\n  if (block.length < 7) return false\n  return block[6] <= MAX_INLINE_VALUE_SIZE\n}","typeGuard":null,"tryCatchPattern":"try {\n  decodeMixedFixedKeyBlock(block)\n} catch (e) {\n  if (String(e).includes('value footprint')) {\n    rmSync(storeDir, { recursive: true, force: true })\n    // regenerate store\n  } else throw e\n}","preventionTips":["Add checksums/CRC to persisted blocks to catch bit rot before decode.","Version the on-disk format and refuse to open newer formats rather than misreading bytes.","Prevent concurrent writers to the same store directory."],"tags":["data-corruption","cache","persistence","validation"],"backgroundTag":"value-out-of-range","analyzedSha":"34433fd12ee8074ea3f47af9f36255c7390d0301","analyzedAt":"2026-09-20T18:20:20.576Z","contentChangedAt":"2026-09-20T18:20:20.576Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}