NoSuchKey AWS Origin: Platform & cloud OSI layer 7 · Application Last updated 9 Oct 2026

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).

Exact message you may see The specified key does not existThe specified bucket does not exist
Seen on: AWS JavaScript

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

  1. List what exists: aws s3 ls s3://bucket/prefix/
  2. Strip leading slashes and decode keys from events (decodeURIComponent(key.replace(/\+/g, " ")))
  3. Verify bucket name and account

Detailed fix by platform

AWS

  1. 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

  1. Key — Exact key string (print it)
  2. Listing — What does aws s3 ls show under the prefix?
  3. 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:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

404 — HTTP 404 Not Found (HTTP)404AccessControlListNotSupported — AccessControlListNotSupported: The bucket does not allow ACLs (AWS)AccessControlListNotS…AccessDenied — AWS S3: AccessDenied (403) when calling GetObject / PutObject (AWS)AccessDeniedBucketAlreadyExists — BucketAlreadyExists: The requested bucket name is not available (AWS)BucketAlreadyExistsContainerNotFound — Azure Storage: ContainerNotFound / BlobNotFound — The specified container (or blob) does not exist (Azure)ContainerNotFoundEntityTooLarge — S3 EntityTooLarge: Your proposed upload exceeds the maximum allowed size (AWS)EntityTooLargePermanentRedirect — S3 PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint (AWS)PermanentRedirectResourceNotFoundException (DynamoDB) — DynamoDB ResourceNotFoundException: Requested resource not found (table) (AWS)ResourceNotFoundExcep…NoSuchKey

Explore the map of this error Full error map →

🧠 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.