AWS S3: NoSuchKey / NoSuchBucket — The specified key/bucket does not exist
S3 found no object at that key (or no bucket with that name in the region/account you’re calling).
The specified key does not existThe specified bucket does not exist Meaning
Keys are exact strings — case, leading slashes and URL encoding all matter. Note: without s3:ListBucket permission, S3 returns AccessDenied (403) instead of NoSuchKey for missing objects.
Common causes
- Wrong key: leading
/, case, or missing folder prefix - URL-encoded characters (spaces →
+/%20) not decoded - Object not uploaded yet / deleted / lifecycle-expired
- Bucket name typo or wrong account/region
- Static website hosting without index document
⚡ Quick fix
- List what exists:
aws s3 ls s3://bucket/prefix/ - Strip leading slashes and decode keys from events (
decodeURIComponent(key.replace(/\+/g, " "))) - Verify bucket name and account
Detailed fix by platform
AWS
- S3 event keys are URL-encoded:javascript
export const handler = async (event) => { const raw = event.Records[0].s3.object.key; const key = decodeURIComponent(raw.replace(/\+/g, ' ')); // "my+file.pdf" → "my file.pdf" };
How to diagnose
- Key — Exact key string (print it)
- Listing — What does
aws s3 lsshow under the prefix? - Bucket — Right bucket/account/region?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in AWS
- Runtime.ImportModuleError Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'x'
- UnauthorizedOperation An error occurred (UnauthorizedOperation): You are not authorized to perform this operation. Encoded authorization failure message: ...
- UnrecognizedClientException UnrecognizedClientException: The security token included in the request is invalid
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 9 Oct 2026