{
  "id": "aws/lambda-s3-zip-extract-failed",
  "signature": "An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: Unzipped size must be smaller than 262144000 bytes",
  "signature_zh": "调用 CreateFunction 操作时发生错误 (InvalidParameterValueException)：解压后的大小必须小于 262144000 字节",
  "regex": "Unzipped size must be smaller than 262144000 bytes",
  "domain": "aws",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The Lambda deployment package's unzipped size exceeds the 250 MB unzipped limit, including layers and code.",
  "root_cause_type": "generic",
  "root_cause_zh": "Lambda 部署包的解压后大小（包括层和代码）超过了 250 MB 的限制。",
  "versions": [
    {
      "version": "AWS Lambda API 2015-03-31",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS SDK for Python 1.27.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "SAM CLI 1.80.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Compressing the deployment package more aggressively (e.g., using maximum compression) doesn't reduce the unzipped size, which is what matters for the limit.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Deleting unnecessary files from the package but still including large libraries (e.g., full Python packages) often fails because the unzipped size remains above 250 MB.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Reduce deployment package size by removing unused dependencies. For Python, use a virtual environment and prune with 'pip install --no-deps' for only required packages. Then rebuild and redeploy.",
      "success_rate": 0.75,
      "how": "Reduce deployment package size by removing unused dependencies. For Python, use a virtual environment and prune with 'pip install --no-deps' for only required packages. Then rebuild and redeploy.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use AWS Lambda layers to offload large libraries (e.g., numpy, pandas) from the deployment package. Create a layer with the library, and reference it in the function configuration.",
      "success_rate": 0.85,
      "how": "Use AWS Lambda layers to offload large libraries (e.g., numpy, pandas) from the deployment package. Create a layer with the library, and reference it in the function configuration.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use container image support for Lambda: package your function as a Docker image (up to 10 GB) instead of a .zip file. Example: 'docker build -t myfunction . && aws ecr create-repository --repository-name myfunction && docker push ...'.",
      "success_rate": 0.9,
      "how": "Use container image support for Lambda: package your function as a Docker image (up to 10 GB) instead of a .zip file. Example: 'docker build -t myfunction . && aws ecr create-repository --repository-name myfunction && docker push ...'.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "通过删除未使用的依赖来减少部署包大小。对于 Python，使用虚拟环境，并仅用 'pip install --no-deps' 安装必要的包。然后重新构建并部署。",
    "使用 AWS Lambda 层将大型库（例如 numpy、pandas）从部署包中分离。创建一个包含该库的层，然后在函数配置中引用它。",
    "使用 Lambda 容器镜像支持：将函数打包为 Docker 镜像（最大 10 GB），而不是 .zip 文件。示例：'docker build -t myfunction . && aws ecr create-repository --repository-name myfunction && docker push ...'。"
  ],
  "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.88,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2023-08-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}