【问题标题】:Gcloud update broke my app -- GCP Python 2.7Gcloud 更新破坏了我的应用程序——GCP Python 2.7
【发布时间】:2019-08-04 16:07:04
【问题描述】:

我刚刚升级了 GCloud,现在我无法启动我的 dev-env。

gcloud --version

  • 谷歌云 SDK 238.0.0
  • app-engine-go
  • app-engine-python 1.9.84
  • app-engine-python-extras 1.9.74 beta 2019.02.22
  • bq 2.0.42
  • 云数据存储模拟器 2.1.0
  • 核心2019.03.08
  • gsutil 4.37

我不明白这些错误...感谢所有反馈!

WARNING  2019-03-13 20:38:17,348 multistore_file.py:62] The oauth2client.contrib.multistore_file module has been deprecated and will be removed in the next release of oauth2client. Please migrate to multiprocess_file_storage.
ERROR    2019-03-13 20:38:17,586 wsgi.py:263] 
Traceback (most recent call last):
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 96, in LoadObject
    __import__(cumulative_path)
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/svcAdminApi/main.py", line 8, in <module>
    import endpoints as google_cloud_endpoints
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/endpoints/__init__.py", line 33, in <module>
    from .apiserving import *
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/endpoints/apiserving.py", line 77, in <module>
    from . import endpoints_dispatcher
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/endpoints/endpoints_dispatcher.py", line 36, in <module>
    import pkg_resources
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/pkg_resources/__init__.py", line 959, in <module>
    class Environment:
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/pkg_resources/__init__.py", line 963, in Environment
    self, search_path=None, platform=get_supported_platform(),
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/pkg_resources/__init__.py", line 190, in get_supported_platform
    plat = get_build_platform()
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/pkg_resources/__init__.py", line 398, in get_build_platform
    version = _macosx_vers()
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/pkg_resources/__init__.py", line 369, in _macosx_vers
    version = platform.mac_ver()[0]
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 764, in mac_ver
    info = _mac_ver_xml()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 741, in _mac_ver_xml
    pl = plistlib.readPlist(fn)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 75, in readPlist
    pathOrFile = open(pathOrFile)
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime/stubs.py", line 283, in __init__
    raise IOError(errno.EACCES, 'file not accessible', filename)
IOError: [Errno 13] file not accessible: '/System/Library/CoreServices/SystemVersion.plist'
INFO     2019-03-13 20:38:17,610 module.py:861] adminapi: "GET /index HTTP/1.1" 500 -

【问题讨论】:

  • “gcloud components restore”让我再次运行,但我敢肯定我活不了多久,所以请告诉我要改变什么
  • 当我在做的时候,我应该提醒你注意文档的不一致......关于 GCP 组和其他文档的最新反馈说要使用 virtualenv,但 cloudendpoints/endpoints-python/ 库特别说你必须使用 /lib vendoring
  • virtualenv 用于在您的开发机器上运行。
  • 感谢您的回复。是的,我知道 venv 是供本地/开发人员使用的。这个问题发生在我的本地/开发环境中。所以我显然没有遵循你的观点?请澄清。
  • 您在评论中提到了 virtualenv 和 /lib。我联合指出 virtualenv 适用于您的开发环境。 /lib 在您的部署配置文件中。

标签: python google-app-engine google-cloud-platform gcloud


【解决方案1】:

Google 收到了有关此案的通知:https://issuetracker.google.com/issues/132240370

如果您也有此问题,请在此问题上加注星标。

【讨论】:

    【解决方案2】:

    阅读您的原始问题,第一个错误表明 oauth2client.contrib.multistore_file 模块已被弃用并且不再受支持,因此您必须替换它,在链接[1]中您可以找到它的原因被弃用了,什么是替代品。

    [1]https://google-auth.readthedocs.io/en/latest/oauth2client-deprecation.html

    【讨论】:

      【解决方案3】:

      现在似乎已从 Google Cloud SDK 253.0.0 修复。

      运行gcloud components update,你应该很高兴!

      【讨论】:

        猜你喜欢
        • 2018-03-31
        • 2021-01-22
        • 1970-01-01
        • 2014-12-13
        • 2016-05-16
        • 2013-10-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多