Skip to main content

Troubleshooting

Start with the errcode in the response or log. It names the failing layer more precisely than the HTTP status.

Startup​

SymptomCauseFix
Exits with CFG-14x / CFG-15xA secure-defaults check failedFix the named setting. Use RIVERBASE_INSECURE_ALLOW only in throwaway environments.
Exits with CAS-012 / CAS-013Casbin policy and mounted commands disagreeAdd the missing rows, or remove stale ones
mount_auth_routes failsProvider is None without RIVERBASE_AUTH_DISABLED=1Configure a provider, or disable auth explicitly
Sort coverage error at spawnA sortable query field has no order entry on the entityAdd it to pg_domain_entity! order, or mark the field no_sort
policy: public requires a reason and sign-offA compile error from query_resource!Use policy: public("why", "TICKET")
Migration errorsWrong RIVERBASE_DB_URL, or a missing databaseCheck the DSN; create the database

Requests​

SymptomCauseFix
401 AUT-001No or invalid credentialsSend Authorization; check the token issuer and audience
400 AUT-172Bearer sent while MockAuth is activeUse a MockAuth- header locally
403 AUT-003Casbin denied the activityPolicy rows must use {cmdkey}.execute / {resource}.query
403 CAS-011A custom route has no activity mappingRegister it as enforced with policy, or as public with a reason
404 on a custom routeMounted with mount_coupled, or into_arc() skippedUse spawn(..).await?.into_arc() and mount_domain
404 DAT-001 on :execRow missing, or in another tenantCheck _tenant and the caller's profile
409 DAT-090Unique violationHandle it in the domain, or check for existence first
422 WEB-001Payload did not match the command's typeCompare with GET …/{cmdkey}.meta
500 DOM-016A state write outside #[domain_action]Move the write into an action method
An empty list where rows existThe tenant filter or scope_policy excluded themCheck the active profile (X-Profile) and the policy expression
WEB-103Body larger than request_body_max_bytesRaise the limit, or upload with multipart

Data and messaging​

SymptomCauseFix
relation "…" does not existDomain migrations not appliedRun --migrate-only; check with_migrate in the store spec
Command rows stuck in CreatedThe process died mid-commandNothing committed; safe to retry with the same idempotency key
Consumers see duplicatesAt-least-once outbox deliveryMake consumers idempotent by message id
Realtime clients miss updates across replicasNo shared StreamBusUse NATS, Redis, or Postgres for [riverbase.bus]
CMD-027The store claimed transactions but returned a non-transactional unitFix the custom DataStore, or set supports_command_transactions to false

Macros​

SymptomFix
Opaque type errors at a command_engine! callcargo expand -p <crate> command and read the generated code
unknown domain_traitUse generate or manual
#[domain_action] cannot find coreName the aggregate's field core