docs← Back to article

Markdown for LLMs

LDC-Q1005 — The snapshot bytes cannot be read as a document

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# LDC-Q1005 — The snapshot bytes cannot be read as a document

## What it means

A snapshot is a document: complete, well-formed bytes the engine can
parse before anything else happens. Truncated downloads, mixed
encodings, and hand edits that break the shape all stop the load at the
read itself, before any row is examined. The message names the file and
the reason the read failed.

Restore the file from its source so the bytes parse again, then run the
query again. The query text itself is not at fault.

## Example

```run
{"argv": ["query", "from r in rules select r", "--path", "$ROOT/world.json"], "expect": "LDC-Q1005", "files": {"world.json": "{invalid json"}}
```

## Fix

```run
{"argv": ["query", "from r in rules select r", "--path", "$ROOT/world.json"], "expect": "LDC-Q1005", "files": {"world.json": "{\"nodes\": [], \"package\": {\"name\": \"demo.diagnostics\", \"namespace\": \"urn:law:demo:diagnostics\"}}"}}
```

## Engine message

The engine reports this in its own wording:

```text
LDC-Q1005: failed to read CLIR $ROOT/world.json: key must be a string at line 1 column 2.
```

## Related

- [Questions to the engine](/constructs/queries/) — what a snapshot carries.
- [LDC-Q1002](/diagnostics/LDC-Q1002/) — when the document parses but names no package.