【问题标题】:Google App Engine Deploy Error[12] Cannot allocate memoryGoogle App Engine 部署错误 [12] 无法分配内存
【发布时间】:2020-07-07 00:46:53
【问题描述】:

我的应用程序正在运行 - Google App Engine 标准环境:Python 37

我使用 gcloud 按照以下命令部署我的应用程序

gcloud app deploy --project [project-name] --version uno

我的构建失败,如下错误

Step #1 - "builder": INFO     gzip_tar_runtime_package took 18 seconds
Step #1 - "builder": INFO     Finished gzipping tarfile.
Step #1 - "builder": INFO     Building app layer took 47 seconds
Step #1 - "builder": INFO     starting: Building app layer
Step #1 - "builder": INFO     starting: tar_runtime_package
Step #1 - "builder": INFO     tar_runtime_package tar -pcf /tmp/tmpyhSCMU.tar --hard-dereference --transform flags=r;s,^,/.googleconfig/, --exclude *.pyc .
Step #1 - "builder": INFO     tar_runtime_package took 0 seconds
Step #1 - "builder": INFO     Building app layer took 0 seconds
Step #1 - "builder": INFO     build process for FTL image took 50 seconds
Step #1 - "builder": INFO     full build took 50 seconds
Step #1 - "builder": ERROR    tar_runtime_package tar -pcf /tmp/tmpyhSCMU.tar --hard-dereference --transform flags=r;s,^,/.googleconfig/, --exclude *.pyc .
Step #1 - "builder": exited with error [Errno 12] Cannot allocate memory
Step #1 - "builder": tar_runtime_package is likely not on the path
Step #1 - "builder": Traceback (most recent call last):
Step #1 - "builder":   File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
Step #1 - "builder":     "__main__", fname, loader, pkg_name)
Step #1 - "builder":   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
Step #1 - "builder":     exec code in run_globals
Step #1 - "builder":   File "/usr/local/bin/ftl.par/__main__.py", line 65, in <module>
Step #1 - "builder":   File "/usr/local/bin/ftl.par/__main__.py", line 60, in main
Step #1 - "builder":   File "/usr/local/bin/ftl.par/__main__/ftl/common/ftl_error.py", line 77, in InternalErrorHandler
Step #1 - "builder": IOError: [Errno 2] No such file or directory: '""/output'

更多信息

  • 我的任务队列已经为空。
  • 我尝试将实例类的大小从 F1 扩大到 F2 和 F3,但仍然失败。

【问题讨论】:

  • 这可能与需求有关。可以加requirements.txt吗?
  • 这里的最后一行看起来很可疑,你是在某处指定""/output 吗?

标签: python-3.x google-app-engine google-cloud-build


【解决方案1】:

你可以尝试增加内存分配吗?

resources:
    disk_size_gb: 10

【讨论】:

  • 我检查了 app.yaml 配置文件,没有找到任何提到“资源”标签的地方。它在 app.yaml 中吗?或其他文件
  • 在 app.yaml 文件中
  • 您有任何与“资源”标签相关的文件吗?
【解决方案2】:

错误cannot allocate memory通常出现在文件数量或上传内容的大小太大并且用于部署代码的实例内存不足的情况下。

此错误的原因可能是您使用了过多的依赖项或静态文件。

您正在下载静态文件吗?我在错误之前看到了这个命令tar_runtime_package tar

我建议确保您只使用必要的依赖项或选择在 Google Cloud Run 上部署您的应用程序。

【讨论】:

  • 感谢您的建议我只是尝试剪切一些在部署代码期间打包的静态文件,我可以再次部署我的代码。谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-11
  • 1970-01-01
  • 2020-05-06
  • 1970-01-01
  • 2018-11-03
  • 2020-08-31
相关资源
最近更新 更多