Channels ERROR: Task was destroyed but it is pending!

158 views
Skip to first unread message

Anh Tran

unread,
Aug 19, 2018, 9:17:18 AM8/19/18
to Django users
I'm using Channels 2.1.3 with ASGI server is `uvicorn`.

ERROR: Task was destroyed but it is pending!
task
: <Task pending coro=<Queue.get() done, defined at /opt/python-3.6.6/lib/python3.6/asyncio/queues.py:155> wait_for=<Future cancelled>>
ERROR
: Exception in ASGI application
Traceback (most recent call last):
 
File "/home/admin/webapps/yy/venv3/lib/python3.6/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 140, in run_asgi
    result
= await asgi(self.asgi_receive, self.asgi_send)
 
File "/home/admin/webapps/yy/venv3/lib/python3.6/site-packages/channels/sessions.py", line 175, in __call__
   
return await self.inner(receive, self.send)
 
File "/home/admin/webapps/yy/venv3/lib/python3.6/site-packages/channels/middleware.py", line 41, in coroutine_call
    await inner_instance
(receive, send)
 
File "/home/admin/webapps/yy/venv3/lib/python3.6/site-packages/channels/consumer.py", line 54, in __call__
    await await_many_dispatch
([receive, self.channel_receive], self.dispatch)
 
File "/home/admin/webapps/yy/venv3/lib/python3.6/site-packages/channels/utils.py", line 57, in await_many_dispatch
    await task
 
File "/home/admin/webapps/yy/venv3/lib/python3.6/site-packages/channels/utils.py", line 49, in await_many_dispatch
    result
= task.result()
 
File "/home/admin/webapps/yy/venv3/lib/python3.6/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 223, in asgi_receive
    data
= await self.recv()
 
File "/home/admin/webapps/yy/venv3/lib/python3.6/site-packages/websockets/protocol.py", line 336, in recv
    loop
=self.loop, return_when=asyncio.FIRST_COMPLETED)
 
File "/opt/python-3.6.6/lib/python3.6/asyncio/tasks.py", line 311, in wait
    fs
= {ensure_future(f, loop=loop) for f in set(fs)}
 
File "/opt/python-3.6.6/lib/python3.6/asyncio/tasks.py", line 311, in <setcomp>
    fs
= {ensure_future(f, loop=loop) for f in set(fs)}
 
File "/opt/python-3.6.6/lib/python3.6/asyncio/tasks.py", line 526, in ensure_future
   
raise TypeError('An asyncio.Future, a coroutine or an awaitable is '
TypeError: An asyncio.Future, a coroutine or an awaitable is required

Reply all
Reply to author
Forward
0 new messages