【问题标题】:Cloud Build fails to build App Engine Python 3.8 app (due to pip bug?)Cloud Build 无法构建 App Engine Python 3.8 应用(由于 pip 错误?)
【发布时间】:2020-12-11 16:52:15
【问题描述】:

我有许多符合 Google App Engine 标准的 Python 3.7 应用程序,都可以正常构建和部署。我正在尝试将其中一些升级到 new Python 3.8 runtime,但是当我尝试部署时,它们在 Cloud Build 中失败。

看起来他们正在攻击this open pip bug (more background)。奇怪的是,只有 Python 3.8 运行时会触发此错误,但 3.7 构建良好。

下面的完整日志。 (请注意,它发生在 Cloud Build 中,而不是我的本地计算机中,因此我无法升级 pip 或以其他方式更改任何命令或环境。)有人知道我可以如何修复或解决这个问题吗?

File upload done.
Updating service [default]...failed.
ERROR: (gcloud.beta.app.deploy) Error Response: [9] Cloud build 83e346a0-7e88-43dd-b89c-a4820526e4a1 status: FAILURE
Error ID: f8df99ad
Error type: INTERNAL
Error message: ... (setup.py): started
  Building wheel for webapp2 (setup.py): finished with status 'done'
  Created wheel for webapp2: filename=webapp2-3.0.0b1-py3-none-any.whl size=68362 sha256=9dd9f3ab6a55404492a88eb9a6bacb00faa37efafbc41f21a24d21cfba0eaea3
  Stored in directory: /layers/google.python.pip/pipcache/wheels/55/e9/4d/76b030f418cac0bef4a3dcc15ca95c9671f1e826731ce2bc0f
  Building wheel for tlslite-ng (setup.py): started
  Building wheel for tlslite-ng (setup.py): finished with status 'done'
  Created wheel for tlslite-ng: filename=tlslite_ng-0.7.5-py3-none-any.whl size=199869 sha256=b9ead00f0832041fba1e9d3883e57847995c2d6f83ecb7ea87d09cf82c730e8b
  Stored in directory: /layers/google.python.pip/pipcache/wheels/a6/e1/a6/09610854c3405202d0b71d8f869811781e40cd26ffb85eacf8
Successfully built gdata humanize mf2py mf2util python-tumblpy ujson webapp2 tlslite-ng
Installing collected packages: six, ecdsa, tlslite-ng, lxml, gdata, certifi, urllib3, chardet, idna, requests, setuptools, protobuf, googleapis-common-protos, pyasn1, pyasn1-modules, rsa, cachetools, google-auth, pytz, grpcio, google-api-core, google-cloud-core, google-cloud-logging, gunicorn, pbr, extras, linecache2, traceback2, python-mimeparse, argparse, unittest2, testtools, fixtures, mox3, soupsieve, beautifulsoup4, gdata-python3, redis, google-cloud-datastore, google-cloud-ndb, humanize, MarkupSafe, jinja2, webencodings, html5lib, mf2py, mf2util, oauthlib, prawcore, websocket-client, update-checker, praw, requests-oauthlib, python-tumblpy, tweepy, ujson, webob, webapp2, oauth-dropins
  Running setup.py develop for oauth-dropins
    ERROR: Command errored out with exit status 1:
     command: /opt/python3.8/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/workspace/setup.py'"'"'; __file__='"'"'/workspace/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --home /tmp/pip-target-zp53suvg
         cwd: /workspace/
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help
    
    error: option --home not recognized
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/python3.8/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/workspace/setup.py'"'"'; __file__='"'"'/workspace/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --home /tmp/pip-target-zp53suvg Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the '/opt/python3.8/bin/python3 -m pip install --upgrade pip' command.
Full build logs: https://console.cloud.google.com/cloud-build/builds/83e346a0-7e88-43dd-b89c-a4820526e4a1?project=216076569502

这是我的requirements.txt 文件。我怀疑-e . 可能是问题所在……但它适用于 Python 3.7,所以如果是这样,那就令人失望了。

git+https://github.com/dvska/gdata-python3.git#egg=gdata
google-cloud-logging~=1.14
gunicorn~=20.0
mox3~=0.28

# this includes everything in setup.py's install_requires.
# https://caremad.io/posts/2013/07/setup-vs-requirement/#developing-reusable-things-or-how-not-to-repeat-yourself
-e .

【问题讨论】:

  • 你的 requirements.txt 是什么样子的?
  • 好啊!我会把它添加到问题中。
  • 我检查了pypi page of oauth-dropins(它失败了),他们在那里提到这个问题正是由-e引起的
  • 正确。我仍然不明白为什么这个错误只在 Python 3.8 中出现,虽然它在 Python 3.7 中运行良好。无论如何,我会尝试将. 保留在requirements.txt 中,但现在删除-e
  • 哇,成功了! @yedpodtrzitko 谢谢!如果您愿意,请随时将其发布为答案,我会接受。

标签: google-app-engine python-3.8 google-cloud-build


【解决方案1】:

我检查了pypi page of oauth-dropins(它失败了)并且他们在那里提到这个问题正是由-e引起的

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-06
    • 1970-01-01
    • 2021-12-06
    • 2021-06-01
    • 2019-12-31
    • 1970-01-01
    • 2021-01-21
    • 1970-01-01
    相关资源
    最近更新 更多