RequestEntityTooLargeException AWS Origin: Platform & cloud Last updated 15 Oct 2026

Lambda: Request must be smaller than 6291456 bytes for the InvokeFunction operation (RequestEntityTooLargeException)

The event payload (or response) is over Lambda’s 6 MB synchronous limit (256 KB for async invocations).

Exact message you may see Request must be smaller than 6291456 bytesResponse payload size exceeded maximum allowed payload size413 Request Entity Too Large
Seen on: AWS

Meaning

Payload limits apply to the request and the response. API Gateway uploads of files, large JSON batches, or functions returning big responses hit it. Put large data in S3 and pass a reference instead.

Common causes

  • Uploading files through API Gateway → Lambda
  • Large batch payloads
  • Function response over 6 MB
  • Async invoke (event) over 256 KB

⚡ Quick fix

  1. Upload to S3 with a presigned URL and pass the key
  2. Paginate or compress responses
  3. Split batches

Detailed fix by platform

Node.js

  1. javascript
    const url = await getSignedUrl(s3, new PutObjectCommand({ Bucket, Key }), { expiresIn: 300 });
    // client uploads directly to S3, then calls the API with { key }

How to diagnose

  1. Size — Request/response bytes
  2. Invocation — Sync or async?

🔧 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):

1025 — Cloudflare Error 1025: Please check back later (Workers request limit) (Cloudflare)10251102 — Cloudflare Error 1102: Worker exceeded resource limits (CPU time / memory) (Cloudflare)1102413 — HTTP 413 Content Too Large (Request Entity Too Large) (HTTP)413413 (Cloudflare 100 MB) — Cloudflare 413 Request Entity Too Large (upload over the plan limit) (Cloudflare)413 (Cloudflare 100 M…context_length_exceeded — LLM API: This model's maximum context length is x tokens. However, your messages resulted in y tokens (context_length_exceeded / prompt is too long) (API)context_length_exceed…EMFILE — Too many open files (EMFILE) (Linux)EMFILEfork: retry: Resource temporarily unavailable — fork: retry: Resource temporarily unavailable (process/thread limit) (Linux)fork: retry: Resource…Malformed Lambda proxy response — API Gateway {"message": "Internal server error"} 502 — Malformed Lambda proxy response (AWS)Malformed Lambda prox…RequestEn…

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.