Sunday, August 19, 2018

Channels ERROR: Task was destroyed but it is pending!

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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/22dc6354-9b09-46ef-80ea-67847e56db76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment