Skip to content

Errors and refusals

Sentinels

Sentinel Code Returned by When
sqs.ErrNoQueue messaging_sqs.no_queue Subscribe the queue a subscription consumes does not exist
sqs.ErrNoTopic messaging_sqs.no_topic Subscribe, Publish the topic in front of a subject does not exist
sqs.ErrClosed messaging_sqs.closed Publish the session has been closed

Match them with errors.Is. The adapter wraps each with the name it looked for, and a Topology you supply should do the same.

The adapter also wraps messaging.ErrNotSupported (pattern; at-most-once on Standard; any other mode) and messaging.ErrSettlementRefused (a settlement after retirement).

Refusals at Open

Cause Message starts
Settings.AWS is nil messaging-sqs: Settings.AWS is required
the source cannot resolve a config messaging-sqs: resolving the AWS configuration

Refusals at Subscribe

Cause Error
a pattern containing * or > wraps messaging.ErrNotSupported: pattern "…"; this backend declares no patterns
AtMostOnce on Standard wraps messaging.ErrNotSupported: at-most-once on a standard queue
a delivery mode neither backend knows wraps messaging.ErrNotSupported
MaxProcessingTime above twelve hours without MaxHeadroom MaxProcessingTime … is above SQS's absolute visibility cap of 12h0m0s
no topic sqs.ErrNoTopic
no queue sqs.ErrNoQueue
a queue name over 80 characters queue name "…" is longer than SQS's 80 characters
the queue's attributes cannot be read reading queue "…", wrapping the SDK's error
no redrive policy under AtLeastOnce queue "…" has no redrive policy; under at-least-once a message with no dead-letter destination is retried until it is fourteen days old
a redrive policy that is not JSON, or a maxReceiveCount that is not a number queue "…"'s redrive policy or queue "…"'s maxReceiveCount, wrapping the cause
MaxDeliver not equal to maxReceiveCount MaxDeliver 3 but queue "billing"'s maxReceiveCount is 5; the two must be equal, because the queue's redrive is where the budget is enforced
AckWait zero and the queue's VisibilityTimeout not positive the queue's VisibilityTimeout is "…"; AckWait was zero and there is nothing to derive a lease from
creating the ephemeral queue, reading its ARN, setting its policy or subscribing it failed a wrapped SDK error naming the step

All messages are prefixed messaging-sqs:. A subscription that fails here is reported by the core as a subscription that could not start.

Refusals at Publish

The encoding and size refusals are in Wire format and SNS limits. Beside them, sqs.ErrClosed, sqs.ErrNoTopic, and messaging-sqs: publishing to "…" wrapping an error from SNS.

Errors that end a source

A receive that fails with QueueDoesNotExist, InvalidAddress or AccessDenied cannot succeed on a retry. The adapter logs this queue will not answer again, records the cause (messaging-sqs: receiving from "…") and ends the source. Every other receive error, such as a throttle, a timeout or a server error, is logged and retried.

Errors that are not errors

A settlement that fails because the receipt handle is no longer current is not returned. It is logged at INFO and treated as the message having become somebody else's.