我使用(以前称为托管VM),最近升级到最新的gcloud SDK。其中包括一些新的错误:
ERROR: (gcloud.preview.app.deploy) Error Response: [400] Invalid
character
in filename: lib/setuptools/script (dev).tmpl
ERROR: The [application] field is specified in file [.../app.yaml]. This field is not used
by gcloud and must be removed. Project name should instead be
specified either by `gcloud config set project MY_PROJECT` or by
setting the `--project` flag on individual command executions.
ERROR: (gcloud.preview.app.deploy) There is a Dockerfile in the
current directory, and the runtime field in
.../app.yaml is currently set to
[runtime: python27]. To use your Dockerfile to build a custom runtime,
set the runtime field in .../app.yaml
to [runtime: custom]. To continue using the [python27] runtime, please
omit the Dockerfile from this directory.我修复了这些错误并能够再次发布,但是开始看到这样的错误:
Failed to import google/appengine/ext/deferred/handler.py
Traceback (most recent call last):
File "/home/vmagent/python_vm_runtime/google/appengine/ext/vmruntime/meta_app.py", line 549, in GetUserAppAndServe
app, mod_file = self.GetUserApp(script)
File "/home/vmagent/python_vm_runtime/google/appengine/ext/vmruntime/meta_app.py", line 410, in GetUserApp
app = _AppFrom27StyleScript(script)
File "/home/vmagent/python_vm_runtime/google/appengine/ext/vmruntime/meta_app.py", line 270, in _AppFrom27StyleScript
app, filename, err = wsgi.LoadObject(script)
File "/home/vmagent/python_vm_runtime/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
ImportError: Import by filename is not supported.发布于 2015-11-28 06:39:32
经过一番挖掘,我弄明白了到底是怎么回事。即,处理以下内容的代码:
builtins:
- remote_api: on
- appstats: on
- deferred: on被托管VM破坏。正确的解决办法是消除这些问题,并将内置的内容包括在内。您可以找到相关的包含在这些子目录中的
在我的例子中,它将这一点添加到我的handlers:指令中:
- url: /_ah/queue/deferred
script: google.appengine.ext.deferred.application
login: admin
- url: /_ah/stats.*
script: google.appengine.ext.appstats.ui.app
- url: /_ah/remote_api(/.*)?
script: google.appengine.ext.remote_api.handler.application至于为什么,你可以在这里了解更多。在.py#L92中,它试图通过在app.yaml中使用runtime:字段查找相关的包含文件。这意味着它以前在查找递延/包含-python27.yaml时,现在尝试查找递延/包含-custom.yaml(由于修复了上面的错误)并失败了。因此,它现在默认为递延/包含.name,它按路径名而不是模块名列出了包含凭证。这会破坏python27 27-自定义-VM设置(因为它期望/需要模块名称)。
https://stackoverflow.com/questions/33968512
复制相似问题