FastAPI incompatibility
See original GitHub issueContext
I get a 500 response code when I try to deploy a simple application.
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
Zappa tail says [1562665728357] __call__() missing 1 required positional argument: 'send'
.
When I go to the api gateway url, I see this message:
“{‘message’: ‘An uncaught exception happened while servicing this request. You can investigate this with the
zappa tail
command.’, ‘traceback’: [‘Traceback (most recent call last):\n’, ’ File "/var/task/handler.py", line 531, in handler\n with Response.from_app(self.wsgi_app, environ) as response:\n’, ’ File "/var/task/werkzeug/wrappers/base_response.py", line 287, in from_app\n return cls(*_run_wsgi_app(app, environ, buffered))\n’, ’ File "/var/task/werkzeug/test.py", line 1119, in run_wsgi_app\n app_rv = app(environ, start_response)\n’, ’ File "/var/task/zappa/middleware.py", line 70, in call\n response = self.application(environ, encode_response)\n’, "TypeError: call() missing 1 required positional argument: ‘send’\n"]}”
Steps to Reproduce
zappa init
zappa deploy dev
# Error: Warning! Status check on the deployed lambda failed. A GET request to '/' yielded a 500 response code.
Your Environment
- Zappa version used: 0.48.2
- Operating System and Python version: macOS Mojave | Python 3.6.5
- The output of
pip freeze
:
Package Version
------------------- ---------
aiofiles 0.4.0
aniso8601 6.0.0
argcomplete 1.9.3
boto3 1.9.184
botocore 1.12.184
certifi 2019.6.16
cfn-flip 1.2.1
chardet 3.0.4
Click 7.0
dataclasses 0.6
dnspython 1.16.0
docutils 0.14
durationpy 0.5
email-validator 1.0.4
fastapi 0.31.0
future 0.16.0
graphene 2.1.6
graphql-core 2.2
graphql-relay 0.4.5
h11 0.8.1
hjson 3.0.1
httptools 0.0.13
idna 2.8
itsdangerous 1.1.0
Jinja2 2.10.1
jmespath 0.9.3
kappa 0.6.0
lambda-packages 0.20.0
MarkupSafe 1.1.1
pip 19.1.1
placebo 0.9.0
promise 2.2.1
pydantic 0.29
python-dateutil 2.6.1
python-multipart 0.0.5
python-slugify 1.2.4
PyYAML 5.1.1
requests 2.22.0
Rx 1.6.1
s3transfer 0.2.1
setuptools 39.0.1
six 1.12.0
starlette 0.12.0
toml 0.10.0
tqdm 4.19.1
troposphere 2.4.9
ujson 1.35
Unidecode 1.1.1
urllib3 1.25.3
uvicorn 0.8.3
uvloop 0.12.2
websockets 7.0
Werkzeug 0.15.4
wheel 0.33.4
wsgi-request-logger 0.4.6
zappa 0.48.2
- Your
zappa_settings.py
:
{
"dev": {
"app_function": "app.main.app",
"aws_region": "ap-northeast-2",
"profile_name": "default",
"project_name": "myprojectname",
"runtime": "python3.6",
"s3_bucket": "mybucketname"
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:11
Has anyone got a zappa deployment working with with FastAPI yet?
I got ASGI running on lambda with magnum here is the code https://github.com/Miserlou/Zappa/issues/649#issuecomment-491625763