"Failed to import google / appengine / ext / deferred / handler.py" in a flexible Google App Engine

I am using the flexible App Engine (formerly called managed virtual machines) and recently updated to the latest version of the gcloud SDK. It included some new bugs:

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.

I fixed these errors and was able to post them again, but began to see such errors:

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.
+4
source share
1 answer

After a little digging, I realized what was happening. Namely, the code that processes this:

builtins:
- remote_api: on
- appstats: on
- deferred: on

. . :

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

, , . google/appengine/ext/builtins/__init__.py#L92 include, runtime: app.yaml. , /include -python27.yaml, /include -custom.yaml(- ) . , /include.yaml, include . python27-custom-VM ( / )

+5

Source: https://habr.com/ru/post/1617810/


All Articles