Error Reference
Complete reference of all checker errors, runtime errors, and HTTP status codes returned by Grove.
What you'll learn: Every error Grove can produce, organized by category.
Checker Errors
Checker errors are caught at compile time by grove-cli check.
Declaration Errors
| Code | Error | Description |
E0112 | Missing kind on root record | Root record { ... } has no kind "xxx" declaration as its first body item |
E0113 | kind on non-root record | kind declaration used on a named or child (@parent(...)) record, where it is forbidden |
E0114 | Invalid kind value | kind must be 2-5 lowercase ASCII letters, cannot start with mz, cannot be a reserved word |
| — | Multiple record declarations | Module has more than one root record block |
| — | Unknown type reference | A type name used in a field declaration is not defined |
| — | Unknown validate reference | An action references a validate that doesn't exist |
| — | Unknown event reference | An emit statement references an event that doesn't exist |
| — | Duplicate declaration name | Two declarations with the same name in the same module |
| — | Reserved field name | Field uses a reserved name: pk, id, version, created_at, updated_at, created_by, updated_by |
Type Errors
| Error | Description |
| Type mismatch | Expression type doesn't match expected type |
| Value type in user field | Value type used in record, event, or action field (only allowed at system boundaries) |
| Non-optional used as optional | Accessing .field on a non-optional value with ?. |
| Unknown field access | Accessing a field that doesn't exist on the type |
Expression Errors
| Error | Description |
| Emit outside action apply | emit used outside of an action's apply block |
| Emit in lambda | emit used inside a lambda expression |
| For loop outside action apply | for loop used outside of action apply |
| For loop nesting exceeded | for loops nested more than 3 levels deep |
| Let reassignment | Attempting to reassign an immutable let binding |
| Non-boolean validate body | Validate block expression doesn't return boolean |
| Non-boolean invariant body | Invariant expression doesn't return boolean |
State Machine Errors
| Error | Description |
| Invalid state transition | Event would cause a state transition not declared in the state machine |
| Unknown event in transition | State machine references an event that doesn't exist |
| Duplicate transition | Same from-state and event combination declared twice |
Versioning Errors
| Error | Description |
| Upcast version ordering | Source version is not lower than target version |
| Duplicate version | Same version tag on two declarations of the same name |
| Missing upcast | Version gap without an upcast to bridge it |
Import Errors
| Error | Description |
| Non-importable construct | Attempting to use imported module for non-importable constructs (aggregates, workflows, triggers, etc.) |
| Ambiguous type reference | Two imports define the same type name and it's used unqualified |
| Import not found | Import path doesn't resolve to a valid module |
Runtime Errors
Runtime errors occur during action execution (grove-cli run or grove-server).
| Error | Code | Description |
| Action not found | ACTION_NOT_FOUND | Request names an action that doesn't exist |
| Validation failed | VALIDATION_FAILED | A validate block returned false |
| Invariant violated | INVARIANT_VIOLATED | Record state after event application violates an invariant |
| State transition rejected | STATE_TRANSITION_REJECTED | Event would cause an invalid state transition |
| Record not found | RECORD_NOT_FOUND | Non-create action called for an entity that doesn't exist |
| Record already exists | RECORD_EXISTS | @create action called for an entity that already exists |
| Record deleted | RECORD_DELETED | Action called on a soft-deleted record |
| Event too large | Z4004 | Event payload exceeds the 256 KiB per-event limit. See Limitations — Event payload size. |
HTTP Status Codes
When using grove-server, errors map to HTTP status codes:
| Status | When |
200 OK | Action executed successfully |
400 Bad Request | Validation failed, missing required fields |
404 Not Found | Action or record not found |
409 Conflict | State transition rejected, record already exists |
413 Payload Too Large | Event payload exceeds the 256 KiB cap (code Z4004) |
422 Unprocessable Entity | Invariant violated |
500 Internal Server Error | Unexpected runtime error |
See Also