SNS Error Troubleshooting: Fix Common Amazon SNS Failures
In this article
Most Amazon SNS errors come from four things: IAM permissions, an invalid or deleted endpoint ARN, unconfirmed subscriptions, or hitting service limits. Start with the error code in the response, match it below, and confirm the fix in CloudWatch metrics.
Time 30 min · Steps 7 · Level Medium
SNS Errors: Work Through Them in This Order
- Read the exact error code. SNS returns a code such as AccessDenied, InvalidParameter, NotFoundException, Throttling or AuthorizationError. The code, not the message text, tells you which fix applies, so capture the full response before changing anything.
- Check the IAM policy on the caller. The identity publishing the message needs sns:Publish on the topic ARN (or endpoint ARN for mobile push). Confirm with the IAM policy simulator or by publishing from the console with the same role.
- Verify the topic or endpoint ARN. Copy the ARN from the SNS console rather than typing it. A wrong region in the ARN is a frequent cause of NotFoundException, because topics exist only in the region where they were created.
- Confirm pending subscriptions. Email, HTTP and HTTPS subscriptions stay in "Pending confirmation" until the endpoint owner clicks the confirmation link. No message is delivered while pending, and the topic's Subscriptions list shows the status.
- Check message size and format. The publish payload limit is 256 KB for the message body. For mobile push, the platform-specific payload inside the MessageStructure JSON must be valid for APNs or FCM, or you get InvalidParameter.
- Look at CloudWatch delivery metrics. NumberOfNotificationsFailed, NumberOfNotificationsDelivered and the per-platform mobile push metrics show whether the failure is at publish time or at delivery time, which narrows the cause immediately.
- Check the topic's access policy. Even with correct IAM, a topic policy that does not allow your account or service (for example a Lambda or S3 event source) to sns:Publish will block the message with AuthorizationError.
Why SNS Publish Calls Fail Before Delivery
AccessDenied is the most common publish-time error, and it is almost always an IAM policy mismatch. The publisher needs sns:Publish on the exact topic ARN in the exact region. Confirm it by opening the IAM console, finding the role or user making the call, and checking that the policy's Resource line matches the topic ARN character for character. The fix is to add sns:Publish with the correct ARN as the resource, or to attach the AmazonSNSFullAccess policy temporarily to prove the cause, then narrow it back down.
InvalidParameter usually means a malformed ARN, a bad MessageStructure, or a payload the platform rejects. Confirm by publishing a minimal plain-text message to the same topic; if that succeeds, the problem is in your JSON payload, not the topic. For mobile push, validate the JSON against the platform's own schema, and remember the whole message, including the platform payload, must stay under 256 KB.
NotFoundException on mobile push means the endpoint was deleted or never existed. Platforms such as APNs and FCM stop recognising device tokens after an app reinstall or a token rotation, and SNS marks those endpoints as disabled or deletes them. Confirm in the SNS console under the platform application's endpoints, where the Enabled flag and the token are shown. The fix is to re-register the device token with CreatePlatformEndpoint, then publish to the new endpoint ARN.
Throttling means you are publishing faster than the limit for your account and region. Confirm by checking whether the errors come in bursts at high traffic times rather than on every call. The fix is client-side retry with exponential backoff and jitter, and if the sustained rate is genuinely higher than the limit, request a quota increase through AWS Support. The default publish quota varies by region, so read the current value in the Service Quotas console rather than assuming a number.
Why Messages Publish Fine but Never Arrive
An unconfirmed subscription is the most common silent failure. Email, HTTP and HTTPS subscribers receive one confirmation message and must act on it before any topic message is delivered. Confirm by opening the topic in the SNS console and checking the subscription status column; anything other than "Confirmed" will not receive messages. The fix is to resend the confirmation request and have the endpoint owner complete it, or switch to a protocol like AWS Lambda or an SQS queue that confirms automatically.
Delivery failures after a successful publish show up in CloudWatch, not in your publish response. For mobile push, enable the delivery status logging on the platform application, which writes success and failure records to CloudWatch Logs including the platform's own error reason. Expired tokens, uninstalled apps and payload rejections all appear there. For HTTP endpoints, check the subscriber's own logs: SNS retries failed deliveries several times over a short period before giving up, and a subscription can be moved to a state requiring reconfirmation after repeated failures.
A subscription filter policy can silently drop messages that look like they should arrive. If the subscription has a filter policy, a message whose message attributes do not match is simply not delivered, with no error anywhere. Confirm by checking the subscription's filter policy in the console and comparing it against the message attributes you publish. The fix is to correct the policy, or to add the matching attributes to the publish call.
Symptom, Likely Cause and Fix at a Glance
| Symptom | Likely cause | Fix |
|---|---|---|
| AccessDenied on publish | IAM policy missing sns:Publish on the topic ARN | Add sns:Publish with the exact topic ARN as resource |
| NotFoundException | Wrong region in the ARN, or deleted endpoint | Copy the ARN from the console; re-register the device token |
| InvalidParameter | Malformed JSON payload or message over 256 KB | Validate the payload; shrink or split the message |
| Throttling under load | Publish rate above the account/region quota | Retry with exponential backoff; request a quota increase |
| Publish succeeds, nothing arrives | Subscription pending confirmation or filtered out | Complete confirmation; check the subscription filter policy |
| Mobile push stops for one device | Expired or rotated device token | Create a new endpoint with the fresh token |
Quick Checks Before You Change Anything
- Match the error code from the response against the table above before editing policies.
- Compare the region in your ARN with the region shown in the console header.
- Check the subscription status on the topic's Subscriptions tab.
- Confirm the message body is under 256 KB, including any platform JSON payload.
- Look at NumberOfNotificationsFailed in CloudWatch for the topic over the last hour.
- Enable delivery status logging on mobile platform applications if it is off.
When Does SNS Retry, and When Should You?
SNS retries HTTP(S) deliveries on your behalf over a short retry window, and mobile push retries depend on the platform's behaviour, so a single failed delivery is often self-correcting. Your own code should retry only on Throttling and transient server errors, using exponential backoff with jitter so a fleet of workers does not retry in lockstep. Do not retry InvalidParameter or NotFoundException; those are permanent until you change the request itself. A dead-letter queue on the subscription catches messages that exhaust delivery retries, which turns silent failures into messages you can inspect, and it is the single most useful setting to add once the immediate error is fixed.
Official source: AWS Documentation