OSError: [Errno 28] No space left on device - AWS Lambda + Zappa

OSError: [Errno 28] No space left on device - AWS Lambda + Zappa

我已经使用 Zappa 在 AWS lambda 上部署了一个应用程序。我在 zappa tail 中收到错误 - OSError: No space left on device。 文件很大,所以我也在使用 S3。下面是我的 zappa 设置。

{"dev": {
"app_function": "app.app",
"profile_name": "default",
"aws_region": "------",
"project_name": "----",
"runtime": "python3.6",
"s3_bucket": "------",
"timeout_seconds": 300,
"slim_handler": true
}
}

下面是堆栈跟踪:

[Errno 28] No space left on device: OSError
Traceback (most recent call last):
  File "/var/task/handler.py", line 609, in lambda_handler
  return LambdaHandler.lambda_handler(event, context)
  File "/var/task/handler.py", line 240, in lambda_handler
  handler = cls()
  File "/var/task/handler.py", line 97, in __init__
  self.load_remote_project_archive(project_archive_path)
  File "/var/task/handler.py", line 169, in load_remote_project_archive
  t.extractall(project_folder)
  File "/var/lang/lib/python3.6/tarfile.py", line 2012, in extractall
  numeric_owner=numeric_owner)
  File "/var/lang/lib/python3.6/tarfile.py", line 2054, in extract
  numeric_owner=numeric_owner)
  File "/var/lang/lib/python3.6/tarfile.py", line 2124, in _extract_member
  self.makefile(tarinfo, targetpath)
  File "/var/lang/lib/python3.6/tarfile.py", line 2173, in makefile
  copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
  File "/var/lang/lib/python3.6/tarfile.py", line 252, in copyfileobj
  dst.write(buf)
OSError: [Errno 28] No space left on device

有什么建议吗?

这是内存问题。 清理代码和 virtualenv 解决了这个问题。 删除不需要减少 space.

的额外库