I'm trying to run the First Steps example from the documentation and get the following error:
$ uvicorn main:app --host 0.0.0.0 --port 5000
INFO: Started server process [3712]
INFO: Uvicorn running on http://0.0.0.0:5000 (Press CTRL+C to quit)
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/uvicorn/protocols/http/httptools_impl.py", line 388, in > run_asgi
asgi = app(self.scope)
TypeError: __call__() missing 2 required positional arguments: 'receive' and 'send'
INFO: ('192.168.10.102', 1092) - "GET / HTTP/1.1" 500
fastapi 0.45.0
Any suggestions?
Hypercorn seems to run just fine, this is uvicorn related. Any info on this though?
It might be a uvicorn version issue -- could you let us know what versiosn of uvicorn you are using?
If it isn't a version issue, a minimal reproducible example would also make it a lot easier to verify/work on the problem.
Code:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
uvicorn version: 0.3.24-1 (buster stable).
upgrade uvicorn, latest is 0.11, this should solve your issue
generally speaking you'll get a lot of issues using distrib packages,
especially on stable, and more than that on fast-paced development
packages, prefer a virtual env.
On Mon, Jan 20, 2020 at 12:36 PM Tom Petri notifications@github.com wrote:
Code:
from fastapi import FastAPIapp = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}uvicorn version: 0.3.24-1 (which is on buster stable).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/tiangolo/fastapi/issues/809?email_source=notifications&email_token=AAINSPTSUQ72ALITGLPHL4DQ6WECBA5CNFSM4J54EJWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJMKROQ#issuecomment-576235706,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAINSPRQPT2FF6GIUN7SFXDQ6WECBANCNFSM4J54EJWA
.
--
benoit barthelet
http://pgp.mit.edu/pks/lookup?op=get&search=0xF150E01A72F6D2EE
I didn't even know that was available as a Debian package :joy: :man_shrugging:
Yeah, what they said. Install with pip. And create an environment first.
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.
File "/root/FastApiTest/lib/python3.6/site-packages/hypercorn/asgi/h11.py", line 107, in handle_asgi_app
asgi_instance = self.app(self.scope)
TypeError: __call__() missing 2 required positional arguments: 'receive' and 'send'
I am using hypercorn, I don`t know what to do, is this some sort of bug or what? the API calls returns empty page with 500 error
Most helpful comment
File "/root/FastApiTest/lib/python3.6/site-packages/hypercorn/asgi/h11.py", line 107, in handle_asgi_app
asgi_instance = self.app(self.scope)
TypeError: __call__() missing 2 required positional arguments: 'receive' and 'send'
I am using hypercorn, I don`t know what to do, is this some sort of bug or what? the API calls returns empty page with 500 error