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

CodeErrorDescription
E0112Missing kind on root recordRoot record { ... } has no kind "xxx" declaration as its first body item
E0113kind on non-root recordkind declaration used on a named or child (@parent(...)) record, where it is forbidden
E0114Invalid kind valuekind must be 2-5 lowercase ASCII letters, cannot start with mz, cannot be a reserved word
—Multiple record declarationsModule has more than one root record block
—Unknown type referenceA type name used in a field declaration is not defined
—Unknown validate referenceAn action references a validate that doesn't exist
—Unknown event referenceAn emit statement references an event that doesn't exist
—Duplicate declaration nameTwo declarations with the same name in the same module
—Reserved field nameField uses a reserved name: pk, id, version, created_at, updated_at, created_by, updated_by

Type Errors

ErrorDescription
Type mismatchExpression type doesn't match expected type
Value type in user fieldValue type used in record, event, or action field (only allowed at system boundaries)
Non-optional used as optionalAccessing .field on a non-optional value with ?.
Unknown field accessAccessing a field that doesn't exist on the type

Expression Errors

ErrorDescription
Emit outside action applyemit used outside of an action's apply block
Emit in lambdaemit used inside a lambda expression
For loop outside action applyfor loop used outside of action apply
For loop nesting exceededfor loops nested more than 3 levels deep
Let reassignmentAttempting to reassign an immutable let binding
Non-boolean validate bodyValidate block expression doesn't return boolean
Non-boolean invariant bodyInvariant expression doesn't return boolean

State Machine Errors

ErrorDescription
Invalid state transitionEvent would cause a state transition not declared in the state machine
Unknown event in transitionState machine references an event that doesn't exist
Duplicate transitionSame from-state and event combination declared twice

Versioning Errors

ErrorDescription
Upcast version orderingSource version is not lower than target version
Duplicate versionSame version tag on two declarations of the same name
Missing upcastVersion gap without an upcast to bridge it

Import Errors

ErrorDescription
Non-importable constructAttempting to use imported module for non-importable constructs (aggregates, workflows, triggers, etc.)
Ambiguous type referenceTwo imports define the same type name and it's used unqualified
Import not foundImport path doesn't resolve to a valid module

Runtime Errors

Runtime errors occur during action execution (grove-cli run or grove-server).

ErrorCodeDescription
Action not foundACTION_NOT_FOUNDRequest names an action that doesn't exist
Validation failedVALIDATION_FAILEDA validate block returned false
Invariant violatedINVARIANT_VIOLATEDRecord state after event application violates an invariant
State transition rejectedSTATE_TRANSITION_REJECTEDEvent would cause an invalid state transition
Record not foundRECORD_NOT_FOUNDNon-create action called for an entity that doesn't exist
Record already existsRECORD_EXISTS@create action called for an entity that already exists
Record deletedRECORD_DELETEDAction called on a soft-deleted record
Event too largeZ4004Event 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:

StatusWhen
200 OKAction executed successfully
400 Bad RequestValidation failed, missing required fields
404 Not FoundAction or record not found
409 ConflictState transition rejected, record already exists
413 Payload Too LargeEvent payload exceeds the 256 KiB cap (code Z4004)
422 Unprocessable EntityInvariant violated
500 Internal Server ErrorUnexpected runtime error

See Also