effectmq
Reference

Error reference

Typed producer, worker, waiting, storage, and Redis failures.

EffectMQ exposes predictable failures in Effect error channels. Handler-domain failures are distinct from infrastructure and protocol failures.

Task definition and identity

TagFieldsMeaning
TaskIdentityGenerationErrortaskName, causeThe idempotency callback or Crypto UUID generation failed.

Invalid task retry, storage, retention, and scheduler backfill configuration is a programmer defect detected by the first consuming operation. Definition invariants do not appear in typed error unions.

Offering

TagFieldsMeaning
TaskOptionsErrorfield, constraint, actualAn offer delay, retry cap, or stalled-attempt cap is invalid.
IndeterminateWriteErrorqueue, taskId, causeRedis may have committed the offer before the connection failed.
RetentionContextRequiredqueue, taskIdCurrent-task result retention was requested outside a managed handler.

OfferError also includes storage, engine, and Schema errors.

Completion and leases

TagFieldsMeaning
LeaseLostprefix, taskId, causeThe attempt no longer owns the generation.
TaskEngineErrorreason, causeRedis transport, script, reply, relationship, commit, or lease boundary failure.
RetryPolicyErrorqueue, taskId, causeRetry-policy evaluation failed or retained failure history cannot replay it safely.

TaskEngineError.reason._tag is one of InvalidInput, TransportFailure, ScriptFailure, InvalidReply, RelationshipLimit, IndeterminateCommit, or LeaseLost.

Waiting

TagFieldsMeaning
TaskHandleMismatchexpectedQueue, actualQueue, expectedTaskName, actualTaskNameThe handle does not match the queue or task descriptor.
InvalidCursorcursorThe event cursor is not a valid Redis stream id.
TaskFailedhandle, failureThe exact generation settled with the typed handler or built-in failure.
TaskNotFoundhandleNo task record, result, or known generation exists.
ResultExpiredhandle, latestGenerationThe handle's retained result is unavailable.
CallerTimeouthandle, timeoutThe caller-local deadline elapsed; task execution continues.
CursorExpiredrequested, earliestEvent retention trimmed the requested position.

Built-in terminal task failures are tagged ~effectmq/Error/Stalled and ~effectmq/Error/Canceled.

Task progress and history

These errors are exported by TaskHistory (including the stable @effectmq/core/TaskHistory subpath):

TagFieldsMeaning
HistoryDisabledqueue, taskId, generationThe definition or stored generation has no enabled history.
HistoryUnavailablequeue, taskId, generationThis generation's task record is no longer available.
InvalidHistoryCursorreason, optional cursorThe cursor is malformed, belongs to another history, or the page size is invalid.
HistoryCursorExpiredrequested, earliestCursorEntries after the requested position were trimmed.
CorruptHistorycauseStored history has an invalid structure.
ProgressWriteErrorqueue, taskId, generation, reason, causeProgress encoding or persistence failed; reason is WriteFailed or IndeterminateWrite.

An uncaught ProgressWriteError leaves the attempt unsettled for lease recovery; it is not encoded as a handler-domain failure. An indeterminate append may already be stored and is not automatically replayed. History reads also expose handle, schema, storage, and engine failures. See reporting progress for gap recovery and retention behavior.

Application event queues

EventEngine.EventEngineError carries code, message, and optional cause, operation, and eventId. Its codes are InvalidInput, ConfigurationConflict, CapacityExceeded, SubscriptionMissing, LeaseLost, EventNotActive, CorruptStorage, IndeterminateWrite, and IdentityError.

For IndeterminateWrite, inspect the supplied event identity before deciding whether to emit again: emissions are not deduplicated. Stale delivery ownership uses the LeaseLost code. processOne also propagates typed handler failures after releasing the delivery for retry. See the EventQueue reference.

Storage protocol

TagMeaning
UnsupportedStorageValueThe value includes an unsupported type, unsafe number, class instance, or cycle.
StorageLimitExceededEncoded payload, success, failure, or progress exceeds maxValueBytes.
StorageCountLimitExceededA task-retention relationship collection reached its limit.
CorruptStorageValueStored data has an invalid envelope or semantic shape.
StorageEncodingErrorMessagePack or base64 encoding failed.
StorageDecodingErrorByte, base64, or MessagePack decoding failed.
UnsupportedProtocolVersionThe envelope version is not readable by this release.
SchemaIdentityMismatchThe stored value or handle belongs to another schema identity.

Live configuration

TagMeaning
WorkerConfigurationErrorInvalid worker concurrency, timing, or processing options; includes field, constraint, and actual.
ProcessingConfigurationErrorInvalid lease or heartbeat options passed directly to queue processing; includes field, constraint, and actual.
TaskEngineConfigurationErrormaintenanceBatchSize is outside 1–1,000.
InvalidRedisConfigurationStandalone pool bounds or timeouts are invalid.
UnsupportedRedisTopologyRedis Cluster was configured or detected.

Recovery matrix

FailureRecovery
TaskOptionsErrorCorrect the reported numeric option before retrying.
IndeterminateWriteErrorRetry the same queue and task identity with return-existing.
CallerTimeoutContinue waiting later with the same handle if the result retention window permits.
CursorExpiredReconcile durable state, then resume from an acceptable cursor.
HistoryCursorExpiredSurface the gap, then use earliestCursor if the reader accepts resuming at the oldest retained entry.
HistoryUnavailableStop polling this history; a separately retained result may still be available through wait.
ProgressWriteErrorInspect reason; an indeterminate append may already exist, so do not blindly replay it.
ResultExpiredRead the result from an application-owned durable store if longer retention is required.
LeaseLostStop treating the attempt as owner; do not acknowledge it again.
SchemaIdentityMismatchRestore the matching schema/version or migrate stored data explicitly.

On this page