{
  "id": "aws/lambda-invoke-request-too-large",
  "signature": "ClientError: An error occurred (RequestEntityTooLargeException) when calling the Invoke operation: Request must be smaller than 6291456 bytes for the Invoke operation",
  "signature_zh": "ClientError：调用Invoke操作时发生错误（RequestEntityTooLargeException）：对于Invoke操作，请求必须小于6291456字节",
  "regex": "RequestEntityTooLargeException.*Request must be smaller than 6291456 bytes",
  "domain": "aws",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "Lambda synchronous invocation payload exceeds the 6 MB limit, including both request and response sizes.",
  "root_cause_type": "generic",
  "root_cause_zh": "Lambda同步调用的负载超过6 MB限制，包括请求和响应大小。",
  "versions": [
    {
      "version": "lambda-2024",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "aws-sdk-python-1.34.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "aws-cli-2.17.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Lambda服务在检查大小前不会解压，压缩后的数据仍会被视为原始大小。",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "分割负载会增加复杂性和延迟，且可能导致数据一致性问题。",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use asynchronous invocation (Event invoke) which has a 256 KB payload limit, but for larger payloads, upload data to S3 first and pass the S3 key to Lambda. Example: s3_client.upload_fileobj(data_stream, bucket, key); lambda_client.invoke(FunctionName='myFunc', Payload=json.dumps({'s3_key': key}))",
      "success_rate": 0.95,
      "how": "Use asynchronous invocation (Event invoke) which has a 256 KB payload limit, but for larger payloads, upload data to S3 first and pass the S3 key to Lambda. Example: s3_client.upload_fileobj(data_stream, bucket, key); lambda_client.invoke(FunctionName='myFunc', Payload=json.dumps({'s3_key': key}))",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce payload size by filtering unnecessary fields or using pagination. If using API Gateway, enable payload compression.",
      "success_rate": 0.8,
      "how": "Reduce payload size by filtering unnecessary fields or using pagination. If using API Gateway, enable payload compression.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use asynchronous invocation (Event invoke) which has a 256 KB payload limit, but for larger payloads, upload data to S3 first and pass the S3 key to Lambda. Example: s3_client.upload_fileobj(data_stream, bucket, key); lambda_client.invoke(FunctionName='myFunc', Payload=json.dumps({'s3_key': key}))",
    "Reduce payload size by filtering unnecessary fields or using pagination. If using API Gateway, enable payload compression."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html",
  "official_doc_section": null,
  "error_code": "RequestEntityTooLargeException",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-09-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}