4

I'm trying to deploy a Quart based python app via Google Cloud's App Engine Standard. However, I keep getting the following error:

Traceback (most recent call last):
  File "/env/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line 284, in handle
    keepalive = self.handle_request(req, conn)
  File "/env/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line 333, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
TypeError: __call__() missing 1 required positional argument: 'send'

I know that Quart is an ASGI solution and Google App Engine is a Serverless setting. One of the recommendations for deploying quart into AWS Lambda was to use Magnum. Does that work for Google Cloud App Engine as well?

Any help would be appreciated.

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
Harold
  • 43
  • 4
  • Hi there, welcome to stackoverflow. Can you provide a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) for that problem, or better explain what you tried so far? – sammy Dec 10 '19 at 23:23

2 Answers2

1

From https://github.com/pgjones/quart/issues/68:

Quart is an ASGI framework, rather than a WSGI framework, which means that it cannot work with serverless. It can work with Mangum, which is an ASGI alternative to serverless.

This also means that Quart will not be compatible with App Engine, Cloud Functions, etc.

However, it would work well with Cloud Run via a HTTP server that supports ASGI such as Uvicorn.

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
1

Magnum is an adapter for using ASGI applications with AWS Lambda & API Gateway and is not tested for Google GCP.

I recommend following the suggestion of @di and use Uvicorn with Cloud Run.

Juancki
  • 1,793
  • 1
  • 14
  • 21