TypeError: An asyncio.Future, a coroutine or an awaitable is required
See original GitHub issueHi
I was trying to run uvicorn + Django channels but i get this error:
2018-08-29 07:35:43 -0500] [9160] [ERROR] Exception in ASGI application
Aug 29 07:35:43 sofia gunicorn[9118]: Traceback (most recent call last):
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/local/lib/python3.6/dist-packages/uvicorn/protocols/websockets/websockets_impl.py", line 140, in run_asgi
Aug 29 07:35:43 sofia gunicorn[9118]: result = await asgi(self.asgi_receive, self.asgi_send)
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/local/lib/python3.6/dist-packages/channels/sessions.py", line 175, in __call__
Aug 29 07:35:43 sofia gunicorn[9118]: return await self.inner(receive, self.send)
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/local/lib/python3.6/dist-packages/channels/middleware.py", line 41, in coroutine_call
Aug 29 07:35:43 sofia gunicorn[9118]: await inner_instance(receive, send)
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/local/lib/python3.6/dist-packages/channels/consumer.py", line 54, in __call__
Aug 29 07:35:43 sofia gunicorn[9118]: await await_many_dispatch([receive, self.channel_receive], self.dispatch)
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/local/lib/python3.6/dist-packages/channels/utils.py", line 57, in await_many_dispatch
Aug 29 07:35:43 sofia gunicorn[9118]: await task
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/local/lib/python3.6/dist-packages/channels/utils.py", line 49, in await_many_dispatch
Aug 29 07:35:43 sofia gunicorn[9118]: result = task.result()
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/local/lib/python3.6/dist-packages/uvicorn/protocols/websockets/websockets_impl.py", line 223, in asgi_receive
Aug 29 07:35:43 sofia gunicorn[9118]: data = await self.recv()
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/local/lib/python3.6/dist-packages/websockets/protocol.py", line 336, in recv
Aug 29 07:35:43 sofia gunicorn[9118]: loop=self.loop, return_when=asyncio.FIRST_COMPLETED)
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/lib/python3.6/asyncio/tasks.py", line 311, in wait
Aug 29 07:35:43 sofia gunicorn[9118]: fs = {ensure_future(f, loop=loop) for f in set(fs)}
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/lib/python3.6/asyncio/tasks.py", line 311, in <setcomp>
Aug 29 07:35:43 sofia gunicorn[9118]: fs = {ensure_future(f, loop=loop) for f in set(fs)}
Aug 29 07:35:43 sofia gunicorn[9118]: File "/usr/lib/python3.6/asyncio/tasks.py", line 526, in ensure_future
Aug 29 07:35:43 sofia gunicorn[9118]: raise TypeError('An asyncio.Future, a coroutine or an awaitable is '
Aug 29 07:35:43 sofia gunicorn[9118]: TypeError: An asyncio.Future, a coroutine or an awaitable is required
django==2.0.7 channels==2.1.3 gunicorn==19.9.0 uvicorn==0.3.2
Any ideas?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
TypeError: An asyncio.Future, a coroutine or an awaitable is ...
I'm trying to make an asynchronous web scraper using beautifulsoup and aiohttp.This is my initial code to start things.I'm getting a [TypeError: ......
Read more >nest_asyncio error: TypeError: An asyncio.Future, a coroutine ...
I am getting the a persistent error when loading a class through spyder console. Loading the same class on my windows os does...
Read more >An asyncio.Future, a coroutine or an awaitable is required in ...
display(df). I get the following error: TypeError: An asyncio.Future, a coroutine or an awaitable is required. I launch the script in Spyder, Anaconda....
Read more >An asyncio.Future, a coroutine or an awaitable is required
I'm trying to make an asynchronous web scraper using beautifulsoup and aiohttp.This is my initial code to start things.I'm getting a [TypeError: An...
Read more >Common Mistakes Using Python3 asyncio
1. Introduction · 2. RuntimeWarning: coroutine foo was never awaited · 3. Task was destroyed but it is pending! · 4. Task/Future is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can pass uvicorn arg to gunicorn by making your own worker like this:
Then use this as your --worker-class
How did you set
--ws wsproto
for gunicorn?