openclaw/openclaw · warning · Error
invalid Snappy literal
Error message
invalid Snappy literal
What it means
After resolving a literal length, decodeSnappy copies that many bytes; this fires when the literal bytes run past the compressed buffer (source underrun) or the copy would overflow the declared output buffer (destination overrun). Both bounds are checked.
Source
Thrown at extensions/anthropic/claude-desktop-groups.ts:92
offset += 1;
const kind = tag & 0x03;
if (kind === 0) {
let length = tag >>> 2;
if (length < 60) {
length += 1;
} else {
const count = length - 59;
if (offset + count > compressed.length) {
throw new Error("invalid Snappy literal length");
}
length = 1;
for (let index = 0; index < count; index += 1) {
length += (compressed[offset + index] ?? 0) * 2 ** (8 * index);
}
offset += count;
}
if (offset + length > compressed.length || written + length > output.length) {
throw new Error("invalid Snappy literal");
}
output.set(compressed.subarray(offset, offset + length), written);
offset += length;
written += length;
continue;
}
let length: number;
let copyOffset: number;
if (kind === 1) {
length = ((tag >>> 2) & 0x07) + 4;
copyOffset = ((tag >>> 5) << 8) | (compressed[offset] ?? 0);
offset += 1;
} else if (kind === 2) {
length = (tag >>> 2) + 1;
copyOffset = (compressed[offset] ?? 0) | ((compressed[offset + 1] ?? 0) << 8);
offset += 2;
} else {
length = (tag >>> 2) + 1;View on GitHub (pinned to 01804a7531)
Solutions
- Non-fatal; the .ldb file is skipped.
- Re-run with Claude Desktop closed.
- If the entire store is unreadable, the leveldb is corrupt; let Desktop rebuild it.
Defensive patterns
Strategy: fallback
Validate before calling
const groups = await readClaudeDesktopCustomGroups(homeDir); // literal-underrun errors are swallowed per file
Try / catch
try { decodeSnappy(block); } catch { /* skip block whose literal stream mismatches declared length */ } Prevention
- Treat a literal-overflow as corruption, not a signal to grow the output buffer.
- Re-run discovery after closing Desktop.
- Prefer the public API over direct snappy parsing of Desktop files.
When it happens
Trigger: kind===0 literal where offset+length > compressed.length or written+length > output.length — a mismatch between the declared uncompressed size and the actual literal stream.
Common situations: A corrupt declared length varint at the snappy frame head; a truncated literal payload; a compaction race.
Related errors
- unexpected end of Snappy block
- invalid Snappy literal length
- invalid Snappy copy offset
- incomplete Snappy block
- invalid LevelDB varint
AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12).
Data as JSON: /api/errors/e049e1b7168d4b02.
Report an issue: GitHub.