{
  "id": "aws/lambda-unzipped-size-exceeded-error",
  "signature": "An error occurred (InvalidParameterValueException) when calling the UpdateFunctionCode operation: Unzipped size must be smaller than 262144000 bytes",
  "signature_zh": "发生错误 (InvalidParameterValueException)：调用 UpdateFunctionCode 操作时：解压后的大小必须小于 262144000 字节",
  "regex": "InvalidParameterValueException.*Unzipped size must be smaller than 262144000 bytes",
  "domain": "aws",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The Lambda function deployment package exceeds the 250 MB unzipped size limit (262,144,000 bytes), often due to large dependencies or bundled layers.",
  "root_cause_type": "generic",
  "root_cause_zh": "Lambda 函数部署包超过 250 MB 的解压大小限制（262,144,000 字节），通常是由于大型依赖项或捆绑的层。",
  "versions": [
    {
      "version": "Lambda API 2015-03-31",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS CLI 2.15.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Compressing the deployment package with a higher compression ratio (e.g., zip -9) to reduce the zip file size.",
      "why_fails": "The limit is on unzipped size, not the zip file size; compression does not reduce unzipped content.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing unnecessary files from the deployment package but keeping large dependencies intact.",
      "why_fails": "The bulk of the unzipped size often comes from dependencies; cosmetic cleanup may not reduce size enough.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Move large dependencies to Lambda layers. Create a layer with the heavy libraries and attach it to the function. Example: `aws lambda publish-layer-version --layer-name my-layer --zip-file fileb://layer.zip` then `aws lambda update-function-configuration --function-name my-function --layers arn:aws:lambda:us-east-1:123456789012:layer:my-layer:1`",
      "success_rate": 0.9,
      "how": "Move large dependencies to Lambda layers. Create a layer with the heavy libraries and attach it to the function. Example: `aws lambda publish-layer-version --layer-name my-layer --zip-file fileb://layer.zip` then `aws lambda update-function-configuration --function-name my-function --layers arn:aws:lambda:us-east-1:123456789012:layer:my-layer:1`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use AWS Lambda with container images (up to 10 GB) instead of zip deployment. Build a Docker image with the function code and dependencies, push to ECR, and update the function to use the image.",
      "success_rate": 0.8,
      "how": "Use AWS Lambda with container images (up to 10 GB) instead of zip deployment. Build a Docker image with the function code and dependencies, push to ECR, and update the function to use the image.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Move large dependencies to Lambda layers. Create a layer with the heavy libraries and attach it to the function. Example: `aws lambda publish-layer-version --layer-name my-layer --zip-file fileb://layer.zip` then `aws lambda update-function-configuration --function-name my-function --layers arn:aws:lambda:us-east-1:123456789012:layer:my-layer:1`",
    "Use AWS Lambda with container images (up to 10 GB) instead of zip deployment. Build a Docker image with the function code and dependencies, push to ECR, and update the function to use the image."
  ],
  "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": "InvalidParameterValueException",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-03-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}