Skip to main content

Error codes

Every error the server returns carries a stable numeric code. Match on the code, not on the message text; messages are for humans and can change. Codes are grouped by category and sparse: unlisted values within a range are reserved.

Pre-release

Codes reflect the current pre-1.0 protocol and may change before 1.0.

Read (1xxx)

CodeNameMeaning
1000UnavailableBatchIndexThe requested batch index is below the start of the stream, usually because it was trimmed.
1001AggregateNotExistsNo such aggregate to read.
1002CacheLoadLockTimeoutThe aggregate's cache load contended with another loader and timed out. Retry.
1003CacheLoadFileScanA file-scan error during cache load; check disk and --data-root.
1004FetchDatablocksFailed to fetch data blocks from disk.
1005FetchMetablocksFailed to fetch metadata blocks from disk.

Write and request (2xxx)

CodeNameMeaning
2000EmptyEventsListA write carried no events.
2001ZeroEventTypeAn event's EventTypeMajor is zero, which is reserved.
2002ClientIdempotencyViolationThis client sequence already landed and is durable. Treat as success. See Idempotent retries.
2003OptimisticConcurrencyViolationThe aggregate moved past your expectedVersion. Re-read and retry. See Optimistic concurrency.
2004FailedToSerialiseDatablocksThe write's payload could not be serialised; usually a malformed event.
2005AggregateNotExistsWrite to a missing aggregate without allowCreate.
2006AggregateRecreateNotAllowedThe aggregate was deleted and was not marked recreatable.
2007WriteReplicationErrorReplication failed during the write (follower disconnect, batch corruption). The write was not acknowledged.
2008WriteFsyncErrorThe leader's fsync failed. Acknowledged data is unaffected; this write did not land.
2009WriteCacheAggregateClientErrorInternal cache error while resolving the aggregate.
2010WriteAggregateExistsCacheErrorInternal cache error checking aggregate existence.
2011NotLeaderThe write hit a follower. Official client pools redirect automatically; raw clients must handle it. See two-node cluster.
2012WriteReplicationBackpressureThe follower cannot keep up; the leader is shedding load. Back off and retry. See troubleshooting.
2013InflightDuplicateWriteA write with this client sequence is fsynced locally but not yet confirmed replicated. Hold the sequence, back off, and retry; do not treat as success, since a failover before confirmation can roll it back.

Schema (2020-2029)

CodeNameMeaning
2020RegisterSchemaAlreadyExistsA schema is already registered for this event type and version.
2021RegisterSchemaInvalidThe submitted schema is malformed.
2022WriteSchemaValidationFailedAn event failed validation against its registered schema.
2023WriteSchemaCompilationFailedThe cached compiled schema is corrupt; re-register the schema.
2024RegisterSchemaUnsupportedTypeThe schema uses a type the server cannot compile.
2025RegisterSchemaCacheLoadErrorInternal cache load failure for the schema registry.
2026RegisterSchemaFsyncErrorFsync failed while writing the registered schema to disk.
2027RegisterSchemaCannotAcceptWritesThis node is a follower; the registration must go to the leader.
2028RegisterSchemaReplicationErrorReplicating the schema registration to the follower failed.
2029RegisterSchemaCoordinationFailedCross-shard schema coordination failed; transient, retry.

Trim (3xxx)

CodeNameMeaning
3000TrimAggregateNotExistsNo such aggregate to trim.
3001TrimCacheErrorInternal cache error during trim.
3002TrimReplicationErrorReplication failed during the trim.
3003TrimFsyncErrorFsync failed during the trim.
3004TrimIndexOutOfRangeThe trim index is outside the stream's current range.
3005TrimNotLeaderThe trim hit a follower. Retry against the leader.

Delete (4xxx)

CodeNameMeaning
4000DeleteAggregateNotExistsNo such aggregate to delete.
4001DeleteEmptyDeleteListThe delete request had no aggregates.
4002DeleteOptimisticConcurrencyViolationThe aggregate moved past your expectedVersion. Re-read and retry.
4003DeleteCacheErrorInternal cache error during delete.
4004DeleteReplicationErrorReplication failed during the delete.
4005DeleteFsyncErrorFsync failed during the delete.
4006DeleteNotLeaderThe delete hit a follower. Retry against the leader.

Listing (5xxx)

CodeNameMeaning
5000ListOrgsDiskReadFailed to read the org list from disk.
5001ListAggregateTypesDiskReadFailed to read the aggregate-type list from disk.
5002ListAggregatesDiskReadFailed to read the aggregate list from disk.

Replication batch (6xxx)

These come back from the replication port (follower-facing), not the client port.

CodeNameMeaning
6000ReplicationBatchFsyncThe follower's fsync of a replication batch failed.
6001ReplicationBatchSerialiseDatablocksThe follower could not deserialise the leader's data blocks; version mismatch or corruption.
6002ReplicationBatchWalSeqGapThe follower received a non-contiguous WAL sequence; triggers S3 catch-up.

Exists / aggregate-details (7xxx)

CodeNameMeaning
7000ExistsCacheErrorInternal cache error during an existence check.
7001ExistsAggregateNotExistsThe aggregate does not exist.
7002ExistsMetablockReadErrorFailed to read metadata blocks for the existence check.

Watch (8xxx)

CodeNameMeaning
8000WatchRequestInvalidThe watch request is malformed (no filters, conflicting filters).
8001LatencyTooHighRequestedLatency exceeds --watch-max-requested-latency-ms.
8002WatchReadIoI/O error while reading events for a notification.
8003WatchReadSerializationSerialisation error while shipping notifications.
8004WatchReadOtherOther internal error in the watch session.

Shard routing (9xxx)

CodeNameMeaning
9000ShardRoutingNoKeyThe request carries no routing key; the server cannot pick a shard.
9001ShardRoutingMultipleShardsAggregates in this request hash to different shards. Re-allocate ids that share % num_shards, or change the cluster's routing rule. See Atomic multi-aggregate writes.
9002ShardRoutingIncompatibleFiltersA watch's filter set does not match the cluster's routing rule (e.g. routing by org_id but the watch has no Orgs filter).

Identity and authentication (10xxx)

These come from the client identity handshake and the API-key path.

CodeNameMeaning
10001IdentifyInvalidNonceThe nonce is expired or malformed. Check client clock against server.
10002IdentifyInvalidSignatureThe signature did not verify against the public key.
10003IdentifyMismatchThe clientId in a write does not match the identified client.
10004IdentifyRequiredThe server runs with --require-client-identity and the client sent none.
10005AuthRequiredThe server requires API-key auth and none was provided.
10006AuthInvalidKeyThe presented API key does not match a stored hash.
10007AuthInsufficientPermissionsThe API key is read-only; the request needs write permission.

Server health (11xxx)

CodeNameMeaning
11000ServerBusyA shard's inter-shard channel is full; the request was not routed. Back off and retry. Persistent values point to an overloaded shard.