{"record":{"id":"c8c1c7669c520f72","repo":"vercel/next.js","slug":"inline-value-type-ty-claims-a-size-byte-value-over-the-max","errorCode":null,"errorMessage":"inline value type {ty} claims a {size} byte value, over the {MAX_INLINE_VALUE_SIZE} byte maximum","messagePattern":"inline value type (.+?) claims a (.+?) byte value, over the (.+?) byte maximum","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"turbopack/crates/turbo-persistence/src/static_sorted_file.rs","lineNumber":1628,"sourceCode":"fn entry_val_size(ty: u8) -> Result<usize> {\n    match ty {\n        KEY_BLOCK_ENTRY_TYPE_SMALL => Ok(SMALL_VALUE_REF_SIZE),\n        KEY_BLOCK_ENTRY_TYPE_MEDIUM => Ok(MEDIUM_VALUE_REF_SIZE),\n        KEY_BLOCK_ENTRY_TYPE_BLOB => Ok(BLOB_VALUE_REF_SIZE),\n        KEY_BLOCK_ENTRY_TYPE_KEY_DELETED => Ok(KEY_DELETED_REF_SIZE),\n        // Must precede the inline arm: both are open-ended and the tombstone range sits above it.\n        ty if ty >= KEY_BLOCK_ENTRY_TYPE_KEY_VALUE_DELETED_MIN => {\n            let size = (ty - KEY_BLOCK_ENTRY_TYPE_KEY_VALUE_DELETED_MIN) as usize;\n            ensure!(\n                size <= MAX_INLINE_VALUE_SIZE,\n                \"key-value tombstone type {ty} claims a {size} byte value, over the \\\n                 {MAX_INLINE_VALUE_SIZE} byte maximum\"\n            );\n            Ok(size)\n        }\n        ty if ty >= KEY_BLOCK_ENTRY_TYPE_INLINE_MIN => {\n            let size = (ty - KEY_BLOCK_ENTRY_TYPE_INLINE_MIN) as usize;\n            ensure!(\n                size <= MAX_INLINE_VALUE_SIZE,\n                \"inline value type {ty} claims a {size} byte value, over the \\\n                 {MAX_INLINE_VALUE_SIZE} byte maximum\"\n            );\n            Ok(size)\n        }\n        _ => bail!(\"Invalid key block entry type: {ty}\"),\n    }\n}\n\n/// Reads the type and start offset from an offset table entry.\n///\n/// The trailing 4 bytes of every entry pack 1 byte of type into the top of a 3-byte BE offset.\n/// `HashThenKey` entries carry the key's 8-byte hash ahead of that word — see\n/// [`KEY_BLOCK_TABLE_ENTRY_SIZE_WITH_HASH`].\n#[inline(always)]\nfn read_offset_entry(\n    offsets: &[u8],","sourceCodeStart":1610,"sourceCodeEnd":1646,"githubUrl":"https://github.com/vercel/next.js/blob/34433fd12ee8074ea3f47af9f36255c7390d0301/turbopack/crates/turbo-persistence/src/static_sorted_file.rs#L1610-L1646","documentation":"turbo-persistence validates inline value entries in a key block: the entry's type byte encodes the inline value's size, and that size must not exceed MAX_INLINE_VALUE_SIZE. This error is thrown when decoding a block whose type byte claims an inline value larger than the format allows. It almost always indicates a corrupt, truncated, or hand-edited static sorted file rather than a caller bug.","triggerScenarios":"Decoding a key block entry whose type byte is >= KEY_BLOCK_ENTRY_TYPE_INLINE_MIN and where (ty - KEY_BLOCK_ENTRY_TYPE_INLINE_MIN) exceeds MAX_INLINE_VALUE_SIZE; typically reached while opening/reading a persisted static sorted file with corrupted or out-of-format bytes.","commonSituations":"Corrupted on-disk cache (disk full, crash mid-write, bit rot), a stale cache directory written by an incompatible turbo-persistence version, or manual tampering with cache files.","solutions":["Delete the corrupt cache directory (e.g. .next/cache or the turbo-persistence store path) and let it rebuild from scratch.","Verify disk health / free space and check for processes that interrupted writes.","If it reproduces after rebuild, report it: it may be an internal-invariant violation in the writer or a format-version mismatch; align Next.js/Turbopack versions so reader and writer agree on the format."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before reading a persisted store, sanity-check the cache directory\nimport { statSync } from 'fs'\nfunction cacheLooksPlausible(dir: string): boolean {\n  try {\n    const s = statSync(dir)\n    return s.isDirectory() && s.size >= 0\n  } catch {\n    return false\n  }\n}\n// If false or decode fails, delete the dir and rebuild instead of retrying reads.","typeGuard":null,"tryCatchPattern":"try {\n  openStaticSortedFile(path)\n} catch (e) {\n  if (String(e).includes('inline value type')) {\n    rmSync(cacheDir, { recursive: true, force: true })\n    // rebuild cache\n  } else throw e\n}","preventionTips":["Avoid killing the process mid-write; allow cache flushes to complete.","Monitor disk health and free space for cache volumes.","Keep reader and writer (Next.js/Turbopack) versions in sync.","Treat cache directories as disposable: automate deletion-on-corruption."],"tags":["data-corruption","cache","persistence","rust"],"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"}