RuntimeError in uvicorn for some requests
See original GitHub issueuvicorn==0.2.5
is throwing errors for some requests.
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/uvicorn/protocols/http/httptools.py", line 196, in run_asgi
result = await asgi(self.receive, self.send)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/channels/http.py", line 190, in __call__
await self.handle(body)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/asgiref/sync.py", line 110, in __call__
return await asyncio.wait_for(future, timeout=None)
File "/usr/lib/python3.6/asyncio/tasks.py", line 339, in wait_for
return (yield from fut)
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/asgiref/sync.py", line 125, in thread_handler
return self.func(*args, **kwargs)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/channels/http.py", line 229, in handle
self.send(response_message)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/asgiref/sync.py", line 64, in __call__
return call_result.result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/asgiref/sync.py", line 78, in main_wrap
result = await self.awaitable(*args, **kwargs)
File "/home/chillar/.virtualenvs/library/lib/python3.6/site-packages/uvicorn/protocols/http/httptools.py", line 308, in send
protocol.transport.write(body)
File "uvloop/handles/stream.pyx", line 636, in uvloop.loop.UVStream.write
File "uvloop/handles/handle.pyx", line 165, in uvloop.loop.UVHandle._ensure_alive
RuntimeError: unable to perform operation on <TCPTransport closed=True reading=False 0x1a48ad8>; the handler is closed
Issue Analytics
- State:
- Created 5 years ago
- Comments:24 (12 by maintainers)
Top Results From Across the Web
Cannot enter into task while another task is being executed ...
I am using the command uvicorn main:app to run the API on localhost. Strangely, despite getting this error, the code always seems to...
Read more >Handling Errors - FastAPI
In this example, when the client requests an item by an ID that doesn't exist, ... There are some situations in where it's...
Read more >Server Behavior - Uvicorn
The Server and Date headers are added to all outgoing requests. If a Connection: Close header is included then Uvicorn will close the...
Read more >tiangolo/fastapi - Gitter
The server logs tells me that Workers are getting timed out and it spawns a new worker process. I'm using https://github.com/tiangolo/uvicorn-gunicorn-docker as ...
Read more >Advanced Usage - HTTPX
On the other hand, a Client instance uses HTTP connection pooling. This means that when you make several requests to the same host,...
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 FreeTop 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
Top GitHub Comments
FYI I am getting this error with uvicorn 0.11.5 and h11 0.9.0, on a Django channels project. I’m running uvicorn with just the basic host/port options. The error happens only sometimes and has not had any impact on my app’s functionality.
Happy to provide extra info.
@euri10 the error is gone in the latest master, thank you! 👍
(I am still getting this issue: https://github.com/encode/uvicorn/issues/757 but will continue the discussion over there.)