# Reading errors

There are 117 kinds of diagnostic: 70 errors starting with `E_` and 47 lints (warnings and info) starting with `L_`. The meaning of every code is in [Diagnostic codes in the reference](/docs/reference/diagnostics/).

## The shape of an error

Every error has the same fields.

| Field | Content |
| --- | --- |
| `code` | A code for the kind (`E_PATH_VERSION_EXISTS` and so on) |
| `what` | What happened |
| `why` | Why it is an error |
| `fix` | How to fix it |
| Location | The file and line number when the cause is in the comp file, the node id when the cause is in a node |

`fix` is written in a form you can act on directly, so read `fix` first. The CLI returns the result as `{"ok": false, "error": {...}}`. When `check` or `lint` succeeds, its warnings are listed in `diagnostics` in the result.

## Code families

| Prefix | Meaning | Usual fix |
| --- | --- | --- |
| `E_SCRIPT_*` | Comp file syntax, runtime errors, imports, the default export, run time or memory limits | Look at the file and line and fix it. `Date.now()` and `Math.random()` are not available |
| `E_IR_*` | Parameter names, types, ranges, required parameters, the number of inputs and port types | Check that node's parameters with `lamino schema --node <type>` |
| `E_PATH_*` | Absolute paths, `..`, undeclared aliases, writes to read-only locations, no version folder, existing frames | Write paths as `$ALIAS/...`. For output, bump the version |
| `E_IMAGE_*`, `E_CODEC_UNAVAILABLE`, `E_FRAME_MISSING` | Unreadable formats, layers that do not exist, no decoder, missing frames | Check layer names and the frame range with `lamino inspect` |
| `E_COLOR_*` | Unknown colour spaces or display / view, transforms that cannot be evaluated | Check the names against the config. `lamino color verify` lists the pairs that cannot be evaluated |
| `E_COST_BUDGET`, `E_RESOURCE_LIMIT` | A node or frame went over its budget | Make it outside, or bake it with `bake()` |
| `E_LOCK` | With `render --job`, footage differs from the lock | Run `check`, commit the lock and make the job again |
| `E_OTIO_*` | Mismatched rate or resolution in the edit, not enough footage frames | Fix the `.otio` or the comp's `fps`, `res` or `frames` |
| `E_GPU`, `E_SHADER_*` | GPU initialisation or execution failures, shader compile or include failures | Change `--backend`. Look at the shader file and line |
| `E_CONFIG*` | `lamino.jsonc` not found, invalid, or with unknown keys | Check the key names against the scaffold from `lamino schema --config` |

## Common lints

| Code | Meaning | Fix |
| --- | --- | --- |
| `L_COLORSPACE_UNSPECIFIED` | The input colour space is not declared | Write `colorspace` in the `read` |
| `L_PIXEL_UNITS` | A parameter has a value that looks like a pixel count | Convert it to width units |
| `L_ESTIMATED` | Something was estimated (`t()` used without `frames`, for example) | State what was estimated explicitly |
| `L_AOV_UNDECLARED` | The conventions of a data layer are not declared | Write `kind`, `units` and so on in `aov(...)` |
| `L_ID_GENERATED` | Node ids collided and `_2` was added | Set it explicitly with `.id("name")` |
| `L_LOCK_PENDING` | Footage hashes are being computed | Carry on working |
| `L_LOCK_STALE`, `L_LOCK_MISSING` | Footage was replaced or has gone | If the replacement was intended, wait for the rehash and commit. Otherwise check the footage |
| `L_PROVENANCE_MISSING` | Generated or rendered footage has no provenance | `lamino prov add` |
| `L_COLOR_STATE_MISMATCH` | Two inputs with different colour states are being combined | Convert one of them so they match |
| `L_MERGE_ALPHA` | `add`, `subtract` or `difference` has no output alpha given | Write `alpha` |
| `L_SHADER_NO_MARGIN` | A shader node declares neither `padding` nor `hint pointwise` | Declare one of them |
| `L_COST_BUDGET`, `L_SLOW_NODE` | There is a slow node | Find it with `stats` and rethink the structure |
