SNS Error Solution: Fixing Common AWS SNS Failures
In this article
- How to Work Through an SNS Error from First Symptom to Fix
- Which SNS Error Are You Actually Seeing?
- Publish Errors: InvalidParameter, NotFound, Size and Throttling
- Delivery Failures: Why the Message Never Arrives
- Permission Errors and the Access Policy on the Topic
- Turning On Delivery Status Logging So the Error Tells You the Cause
- Quick Checks Before You Change Anything
- Keeping SNS Working After the Fix
- SNS Error Questions That Come Up Often
Most AWS SNS errors fall into three buckets: delivery failures (the message never reaches the endpoint), publish failures (SNS rejects the message), and permission errors (a policy blocks an action). The error message text tells you which bucket you are in, and each has its own fix.
Time 30 min · Steps 7 · Level Medium
How to Work Through an SNS Error from First Symptom to Fix
- Read the exact error code. Note the full message, including codes like InvalidParameter, NotFound, AuthorizationError, Throttling or a delivery status event, because each points to a different cause.
- Confirm the resource exists and is spelled right. Check the topic or subscription ARN character by character; a wrong region or account number in the ARN is the single most common cause of NotFound.
- Check the IAM policy. The user or role publishing must have sns:Publish on the topic ARN, and subscription actions need their own permissions.
- Validate the message. Confirm size, format and attributes: the message body has a limit of 256 KB, and message attributes must be valid, correctly typed and within their own size limit.
- Check the subscription status. A pending subscription never receives anything; email and HTTP endpoints must be confirmed before delivery starts.
- Look at delivery logs. Enable delivery status logging for the protocol in question and read the provider response, which usually names the real reason.
- Retry with backoff. Throttling and transient endpoint errors clear on retry; use exponential backoff so retries do not make throttling worse.
Which SNS Error Are You Actually Seeing?
The symptom that splits the causes is where the failure appears. If your publish call itself returns an error, the problem is between you and SNS: parameters, permissions, size or throttling. If the publish succeeds but the endpoint never gets the message, the problem is between SNS and the endpoint: subscription state, endpoint health or the endpoint's own filtering. Write down which side fails before changing anything, because the fixes are completely different and guessing wastes time.
Publish Errors: InvalidParameter, NotFound, Size and Throttling
InvalidParameter and InvalidParameterException
This means something in the request is malformed. Confirm it by checking which parameter the error names. Common triggers: a topic ARN with the wrong region, a phone number not in E.164 format for SMS, or a message attribute with a data type that does not match its value. The fix is to correct the named parameter and republish; no infrastructure change is needed.
NotFound (Topic or Subscription)
Confirm by listing your topics in the same region and account you are calling from. If the topic does not appear, the ARN's region or 12-digit account ID is wrong, or the topic was deleted. Fix the ARN, or recreate the topic and resubscribe the endpoints. Note that deleting a topic also deletes its subscriptions, so they must be set up again.
Message Size and Attribute Errors
The message body limit is 256 KB total for the publish call. Confirm size by measuring the payload before sending. If you are over, move large content to storage such as S3 and send a reference in the message, or split the payload. Message attributes count toward the overall 256 KB limit, so trim attributes as well as the body.
Throttling
Confirm by the error text mentioning throttling or request rate. The fix is client-side: retry with exponential backoff and reduce publish frequency. If your steady workload needs more, request a quota increase rather than retrying harder.
Delivery Failures: Why the Message Never Arrives
A successful publish with no delivery almost always means the subscription is pending, the endpoint is filtering, or the endpoint itself is rejecting the message.
Confirm the subscription state first. Email subscriptions require clicking the confirmation link, and HTTP or HTTPS endpoints must respond correctly to the subscription confirmation request. A subscription stuck in "PendingConfirmation" explains a total silence at one endpoint while others work. Fix it by requesting a new confirmation, or have the endpoint owner complete it.
Next, check filter policies. If the subscription has a filter policy, messages whose attributes do not match are simply skipped, with no error at publish time. Confirm by comparing the message attributes against the policy; fix by aligning the two or removing the policy.
For mobile push, check the platform endpoint. An endpoint marked as disabled after repeated failures will not receive anything until re-enabled, and the device token must still be current. Confirm in the endpoint details; fix by re-enabling it with the correct token.
For SMS, delivery depends on the destination carrier and the message type. Confirm what happened by enabling SMS delivery logs; the carrier response in the log tells you whether the number was invalid, the carrier rejected it, or the message was filtered.
Permission Errors and the Access Policy on the Topic
AuthorizationError or AccessDenied means a policy is blocking the call. Two policies can be involved: the IAM policy attached to the caller, and the topic's resource access policy. Confirm which by testing the same call with full administrator permissions; if it works, the cause is policy, and you can then narrow it down.
The fix for the caller side is an IAM policy granting sns:Publish on the specific topic ARN. The fix for the topic side is the topic's access policy; for example, allowing a specific S3 bucket or EventBridge rule to publish to it. Keep the topic policy scoped to the exact source ARNs rather than opening it to everyone, because an open topic policy lets anyone publish to it.
Turning On Delivery Status Logging So the Error Tells You the Cause
Delivery status logging is the one setting that turns silent failures into readable errors, and it is worth enabling before you need it. For each protocol, set the logging role and a destination for the logs; the exact menu path in the SNS console is under the topic's or the subscription's settings and the labels can differ slightly by version. Once enabled, each delivery attempt records the provider response, timestamp and status. Read the provider response field first: for push it comes from the push service, for SMS from the carrier, and for email from the mail system. That response, not the SNS status code, is usually where the actual reason is written.
Quick Checks Before You Change Anything
- Is the region in your ARN the same region you are calling?
- Is the subscription confirmed, not pending?
- Is the message under 256 KB including attributes?
- Does a filter policy on the subscription match your message attributes?
- Can you publish to a test topic in the same account? If yes, the topic policy is the suspect.
Keeping SNS Working After the Fix
Once the error is solved, three habits prevent it returning. Enable delivery status logging on every production topic so the next failure is diagnosable in minutes. Set a dead-letter queue on subscriptions so failed messages are kept instead of lost, letting you replay them. Monitor subscription status and endpoint health so you learn about a disabled endpoint before your users do. And keep message payloads small by design, storing large content elsewhere and sending a reference, so you never hit the size limit under load.
SNS Error Questions That Come Up Often
Why does publish succeed but SMS never arrives?
Check whether the number is valid and in a supported region, whether the subscription or spending settings for SMS are in place, and read the delivery log's carrier response. Carriers filter some sender names and message content, which shows up in the log.
What does a pending subscription look like?
The subscription shows a status of pending confirmation and receives nothing. The endpoint owner must confirm it, or you can resend the confirmation request from the console.
Why did my Lambda not trigger from the topic?
Check that the subscription's filter policy matches the message attributes, that the Lambda function's resource policy allows SNS to invoke it, and that the function's errors are visible in its own logs rather than SNS's.
Do deleted topics keep their subscriptions?
No. Deleting a topic deletes its subscriptions, so after recreating a topic you must subscribe every endpoint again and reconfirm each one.
Official source: Amazon Web Services