Markdown for LLMs
LDC-Q3002 — A case file cannot be read for a package computation
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# LDC-Q3002 — A case file cannot be read for a package computation
## What it means
Running a package over a case file starts by reading that file: it
must exist beside the query and parse as a case document. A missing
file, an unreadable one, or bytes that do not parse stop the
computation before the package ever runs. The message names the file
and the reason the read failed.
Point the computation at the existing, readable case file and run the
query again. The package and the query text stay as written.
## Example
```run
{"argv": ["query", "$ROOT/q.lawq", "--path", "$ROOT/world.json", "--limit", "5"], "files": {"q.lawq": "let m = eval(\"demo.diagnostics\", \"missing.json\") from r in rules select r", "world.json": "{\"artifactHash\":\"sha256:6a9091bdeb56f398762394bb3ab882a8f44d541a1dd0dfd9ea65d4e9cac99d78\",\"features\":[\"core-executable\"],\"imports\":[],\"metadata\":{},\"nodes\":[{\"contentHash\":\"sha256:65449c25ae110f10c02d875734707f013f7fcae27b6c779700c6a2eb82fd00fc\",\"id\":\"urn:law:demo:diagnostics#Applicant\",\"kind\":\"type_decl\",\"name\":\"Applicant\",\"package\":\"urn:law:demo:diagnostics\",\"typeKind\":\"entity\"},{\"contentHash\":\"sha256:b62227d3c949b697a7bad486d2cd64dcd4ddaccef32710bd994226fd43e3033e\",\"id\":\"urn:law:demo:diagnostics#resident\",\"kind\":\"symbol_decl\",\"name\":\"resident\",\"package\":\"urn:law:demo:diagnostics\",\"parameters\":[{\"id\":\"urn:law:demo:diagnostics#resident/arg/a\",\"name\":\"a\",\"type\":{\"name\":\"urn:law:demo:diagnostics#Applicant\"}}],\"relationKind\":\"institutional\",\"symbolKind\":\"relation\"}],\"package\":{\"name\":\"demo.diagnostics\",\"namespace\":\"urn:law:demo:diagnostics\",\"semanticHash\":\"sha256:0000000000000000000000000000000000000000000000000000000000000000\",\"version\":\"0.1.0\"},\"schemaVersion\":\"law.core.ir/0.2\",\"semanticHash\":\"sha256:82a883cd86acd37faec9d0502a7498490966e772c41e0c750647a60f29c53010\",\"semanticVersion\":\"0.2.4\",\"strata\":[],\"theoryHash\":\"sha256:82a883cd86acd37faec9d0502a7498490966e772c41e0c750647a60f29c53010\"}"}, "expect": "LDC-Q3002"}
```
## Fix
```run
{"argv": ["query", "$ROOT/q.lawq", "--path", "$ROOT/world.json", "--limit", "5"], "files": {"q.lawq": "let m = eval(\"demo.diagnostics\", \"c.json\") from r in rules select r", "world.json": "{\"artifactHash\":\"sha256:6a9091bdeb56f398762394bb3ab882a8f44d541a1dd0dfd9ea65d4e9cac99d78\",\"features\":[\"core-executable\"],\"imports\":[],\"metadata\":{},\"nodes\":[{\"contentHash\":\"sha256:65449c25ae110f10c02d875734707f013f7fcae27b6c779700c6a2eb82fd00fc\",\"id\":\"urn:law:demo:diagnostics#Applicant\",\"kind\":\"type_decl\",\"name\":\"Applicant\",\"package\":\"urn:law:demo:diagnostics\",\"typeKind\":\"entity\"},{\"contentHash\":\"sha256:b62227d3c949b697a7bad486d2cd64dcd4ddaccef32710bd994226fd43e3033e\",\"id\":\"urn:law:demo:diagnostics#resident\",\"kind\":\"symbol_decl\",\"name\":\"resident\",\"package\":\"urn:law:demo:diagnostics\",\"parameters\":[{\"id\":\"urn:law:demo:diagnostics#resident/arg/a\",\"name\":\"a\",\"type\":{\"name\":\"urn:law:demo:diagnostics#Applicant\"}}],\"relationKind\":\"institutional\",\"symbolKind\":\"relation\"}],\"package\":{\"name\":\"demo.diagnostics\",\"namespace\":\"urn:law:demo:diagnostics\",\"semanticHash\":\"sha256:0000000000000000000000000000000000000000000000000000000000000000\",\"version\":\"0.1.0\"},\"schemaVersion\":\"law.core.ir/0.2\",\"semanticHash\":\"sha256:82a883cd86acd37faec9d0502a7498490966e772c41e0c750647a60f29c53010\",\"semanticVersion\":\"0.2.4\",\"strata\":[],\"theoryHash\":\"sha256:82a883cd86acd37faec9d0502a7498490966e772c41e0c750647a60f29c53010\"}", "c.json": "{}"}, "expect": "LDC-Q3002"}
```
## Engine message
The engine reports this in its own wording:
```text
LDC-Q3002: failed to read case
```
## Related
- [Questions to the engine](/constructs/queries/) — how a query runs a package over a case.
- [LDC-Q3001](/diagnostics/LDC-Q3001/) — when the computation states no row cap.