Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error Codes Reference

AngaraBase uses an internal EngineErrorKind enum as the single source of truth for error codes. At the protocol boundary, engine errors are translated to PostgreSQL SQLSTATE codes via the ERROR_REGISTRY.

Error Categories

CategoryDescription
InvalidInputClient passed invalid parameters or malformed query
TransactionControlTransaction state errors (serialization failures, conflicts)
AccessControlInsufficient privileges
ResourceLimitResource exhaustion (memory, connections, locks)
InternalErrorInternal engine errors (bugs, invariant violations)
IoErrorDisk/network I/O errors

Error Code Registry

EngineErrorKindPG SQLSTATEPG Code NameCategoryDescription
InvalidParameter22023invalid_parameter_valueInvalidInputCaller passed an invalid parameter (validation failure inside the engine).
TransactionAborted40001serialization_failureTransactionControlTransaction aborted by the engine (serialization failure, conflict, …).
LockTimeout55P03lock_not_availableResourceLimitLock acquisition exceeded the configured timeout.
AccessDenied42501insufficient_privilegeAccessControlAuthorization / RBAC denial inside the engine.
InternalErrorXX000internal_errorInternalErrorCatch-all internal error (unexpected state, broken invariant).
DuplicateKey23505unique_violationInvalidInputUnique-key violation (catalogued for clean SQLSTATE mapping).
ConstraintViolation23000integrity_constraint_violationInvalidInputGeneric constraint violation (FK, CHECK, NOT NULL, …).
NotFound42704undefined_objectInvalidInputObject does not exist (table, schema, row, …).
IoError58030io_errorIoErrorI/O error from storage / WAL / recovery layer.
ResourceExhausted53000insufficient_resourcesResourceLimitResource exhaustion (memory limits, connection limits, …).
QosQueueFull53600qos_queue_fullResourceLimitQoS queue full — per-level cap on concurrent/queued requests exceeded.
FeatureNotSupported0A000feature_not_supportedInvalidInputRequested feature is not supported by this version of AngaraBase.
UndefinedFunction42883undefined_functionInvalidInputOperator or function not found for the given argument types.
InvalidColumnReference42P10invalid_column_referenceInvalidInputInvalid column reference (e.g., ORDER BY ordinal out of range).
SyntaxError42601syntax_errorInvalidInputSQL syntax error in the submitted query.
NoActiveSqlTransaction25P01no_active_sql_transactionTransactionControlCommand requires an active transaction but none is in progress.
ActiveSqlTransaction25001active_sql_transactionTransactionControlCommand cannot be executed within an active transaction block.
ReadOnlySqlTransaction25006read_only_sql_transactionTransactionControlWrite operation attempted in a read-only transaction.
IdleInTransactionTimeout57P01idle_in_transaction_session_timeoutResourceLimitSession exceeded idle_in_transaction_session_timeout.

Troubleshooting

Handling TransactionAborted (40001)

When AngaraBase returns SQLSTATE 40001 (serialization_failure), the client should retry the transaction. This is standard MVCC behaviour — a concurrent writer committed first.

-- Client retry pattern:
BEGIN;
-- ... operations ...
-- If you get 40001, retry from BEGIN
COMMIT;

Handling ResourceExhausted (53000)

Hard resource exhaustion (memory / connection limits). Check angarabase_server_connections_active; if near max_connections, either:

  • Increase max_connections (requires restart — it is an instance-scope setting)
  • Use connection pooling (PgBouncer)

Handling QosQueueFull (53600)

The per-ServiceLevel QoS admission cap was exceeded. Unlike 53000, this code is transient and safe to retry: back off with jitter and let lower-priority work drain. See the Resource Contracts reference for the full fail-closed boundary table.