hypercorn icon indicating copy to clipboard operation
hypercorn copied to clipboard

`ERROR Error in ASGI Framework` `AssertionError: cannot call write() after reset() `

Open khteh opened this issue 9 months ago • 0 comments

Another random crashes: curl --http3 --insecure -vv https://IP hits this exception:

[pythonrestapi-1 pythonrestapi] 2025-03-28 09:29:55 ERROR    Error in ASGI Framework 
[pythonrestapi-1 pythonrestapi] Traceback (most recent call last): 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/hypercorn/asyncio/task_group.py", line 27, in _handle 
[pythonrestapi-1 pythonrestapi]     await app(scope, receive, send, sync_spawn, call_soon) 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/hypercorn/app_wrappers.py", line 34, in __call__ 
[pythonrestapi-1 pythonrestapi]     await self.app(scope, receive, send) 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/quart/app.py", line 1668, in __call__ 
[pythonrestapi-1 pythonrestapi]     await self.asgi_app(scope, receive, send) 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/quart/app.py", line 1694, in asgi_app 
[pythonrestapi-1 pythonrestapi]     await asgi_handler(receive, send) 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/quart/asgi.py", line 52, in __call__ 
[pythonrestapi-1 pythonrestapi]     raise_task_exceptions(done) 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/quart/utils.py", line 180, in raise_task_exceptions 
[pythonrestapi-1 pythonrestapi]     raise task.exception() 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/quart/asgi.py", line 107, in handle_request 
[pythonrestapi-1 pythonrestapi]     await asyncio.wait_for(self._send_response(send, response), timeout=timeout) 
[pythonrestapi-1 pythonrestapi]   File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for 
[pythonrestapi-1 pythonrestapi]     return await fut 
[pythonrestapi-1 pythonrestapi]            ^^^^^^^^^ 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/quart/asgi.py", line 112, in _send_response 
[pythonrestapi-1 pythonrestapi]     await send( 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/hypercorn/protocol/http_stream.py", line 145, in app_send 
[pythonrestapi-1 pythonrestapi]     await self.send( 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/hypercorn/protocol/h3.py", line 72, in stream_send 
[pythonrestapi-1 pythonrestapi]     self.connection.send_headers( 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/aioquic/h3/connection.py", line 501, in send_headers 
[pythonrestapi-1 pythonrestapi]     self._quic.send_stream_data( 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/aioquic/quic/connection.py", line 1146, in send_stream_data 
[pythonrestapi-1 pythonrestapi]     stream.sender.write(data, end_stream=end_stream) 
[pythonrestapi-1 pythonrestapi]   File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.12/site-packages/aioquic/quic/stream.py", line 314, in write 
[pythonrestapi-1 pythonrestapi]     assert self._reset_error_code is None, "cannot call write() after reset()" 
[pythonrestapi-1 pythonrestapi]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
[pythonrestapi-1 pythonrestapi] AssertionError: cannot call write() after reset() 

khteh avatar Mar 28 '25 09:03 khteh