{"record":{"id":"347ea02aa37fa81e","repo":"vercel/next.js","slug":"fixed-key-block-too-short","errorCode":null,"errorMessage":"fixed key block too short","messagePattern":"fixed key block too short","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"turbopack/crates/turbo-persistence/src/static_sorted_file.rs","lineNumber":640,"sourceCode":"\n        self.lookup_block_inner::<K, FIND_ALL>(entry_count, key_hash, key, layout, reader, |i| {\n            get_key_entry(offsets, entries, entry_count, i, hash_len)\n        })\n    }\n\n    /// Looks up a key in a fixed-size key block.\n    ///\n    /// Fixed-size key blocks store entries at predictable offsets (no offset table),\n    /// enabling direct indexing during binary search.\n    fn lookup_fixed_key_block<K: QueryKey, const FIND_ALL: bool>(\n        &self,\n        block: &[u8],\n        key_hash: u64,\n        key: &K,\n        layout: KeyBlockLayout,\n        reader: ArcBlockCacheReader<'_>,\n    ) -> Result<SstLookupResult> {\n        ensure!(block.len() >= 6, \"fixed key block too short\");\n        let entry_count = be::read_u24(&block[1..]) as usize;\n        let key_size = be::read_u8(&block[4..]) as usize;\n        let header_type = be::read_u8(&block[5..]);\n        let FixedValueLayout {\n            value_type,\n            val_size,\n            header_size,\n        } = fixed_value_layout(block, header_type)?;\n        let regions = FixedRegions::new(entry_count, layout, key_size, val_size);\n        let entries = &block[header_size..];\n        ensure!(\n            entries.len() == regions.total_len(entry_count),\n            \"fixed key block for {entry_count} entries is the wrong size\"\n        );\n\n        self.lookup_block_inner::<K, FIND_ALL>(entry_count, key_hash, key, layout, reader, |i| {\n            get_fixed_key_entry(entries, i, regions, value_type)\n        })","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/vercel/next.js/blob/34433fd12ee8074ea3f47af9f36255c7390d0301/turbopack/crates/turbo-persistence/src/static_sorted_file.rs#L622-L658","documentation":"lookup_fixed_key_block requires a fixed-layout key block to be at least 6 bytes so it can read the entry count, key size, and header-type bytes. A shorter block cannot be parsed at all, so the layer reports it as corrupt rather than returning a lookup miss.","triggerScenarios":"A fixed-key SST key block shorter than 6 bytes read during a point lookup — truncated or corrupt block delivered by the block cache.","commonSituations":"Torn or partial writes to the Turbopack persistent cache; disk corruption; a cache directory copied while a build was writing to it.","solutions":["Delete the persistent cache directory and rebuild the cache.","Avoid copying or snapshotting the cache directory while builds are running.","Check the storage volume for hardware/filesystem errors.","Report a reproducible case with the offending SST file to the Turbopack team."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  lookup(key);\n} catch (e) {\n  if (/fixed key block too short/.test(String(e))) {\n    resetCache();\n  } else throw e;\n}","preventionTips":["Do not snapshot or copy the cache directory while builds are running.","Monitor disk health on the cache volume.","Treat persistent-cache corruption errors as a signal to wipe the cache."],"tags":["storage","corruption","cache","rust"],"backgroundTag":"internal-invariant-violation","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"}