Skip to content

AssertionError: cannot call write() after reset() #352

@khteh

Description

@khteh
Traceback (most recent call last):
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/hypercorn/asyncio/worker_context.py", line 19, in restart
    await self._handle
  File "/usr/lib/python3.13/asyncio/futures.py", line 286, in __await__
    yield self  # This tells Task to wait for completion.
    ^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/tasks.py", line 375, in __wakeup
    future.result()
    ~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/asyncio/futures.py", line 194, in result
    raise self._make_cancelled_error()
  File "/usr/lib/python3.13/asyncio/tasks.py", line 306, in __step_run_and_handle_result
    result = coro.throw(exc)
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/hypercorn/protocol/quic.py", line 155, in _handle_timer
    await self.context.sleep(wait)
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/hypercorn/asyncio/worker_context.py", line 74, in sleep
    return await asyncio.sleep(wait)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/tasks.py", line 718, in sleep
    return await future
           ^^^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/futures.py", line 286, in __await__
    yield self  # This tells Task to wait for completion.
    ^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/tasks.py", line 375, in __wakeup
    future.result()
    ~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/asyncio/futures.py", line 194, in result
    raise self._make_cancelled_error()
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/hypercorn/asyncio/task_group.py", line 28, in _handle
    await app(scope, receive, send, sync_spawn, call_soon)
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/hypercorn/app_wrappers.py", line 34, in __call__
    await self.app(scope, receive, send)
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/quart/app.py", line 1735, in __call__
    await self.asgi_app(scope, receive, send)
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/quart/app.py", line 1761, in asgi_app
    await asgi_handler(receive, send)
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/quart/asgi.py", line 60, in __call__
    raise_task_exceptions(done)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/quart/utils.py", line 186, in raise_task_exceptions
    raise task.exception()
  File "/usr/lib/python3.13/asyncio/tasks.py", line 306, in __step_run_and_handle_result
    result = coro.throw(exc)
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/quart/asgi.py", line 117, in handle_request
    await asyncio.wait_for(self._send_response(send, response), timeout=timeout)
  File "/usr/lib/python3.13/asyncio/tasks.py", line 507, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/quart/asgi.py", line 158, in _send_response
    await send(
    ...<4 lines>...
    )
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/hypercorn/protocol/http_stream.py", line 200, in app_send
    await self._send_closed()
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/hypercorn/protocol/http_stream.py", line 244, in _send_closed
    await self.send(EndBody(stream_id=self.stream_id))
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/hypercorn/protocol/h3.py", line 83, in stream_send
    self.connection.send_data(event.stream_id, b"", True)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/aioquic/h3/connection.py", line 557, in send_data
    self._quic.send_stream_data(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        stream_id, encode_frame(FrameType.DATA, data), end_stream
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/aioquic/quic/connection.py", line 1139, in send_stream_data
    stream.sender.write(data, end_stream=end_stream)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/Python/rag-agent/.venv/lib/python3.13/site-packages/aioquic/quic/stream.py", line 334, in write
    assert self._reset_error_code is None, "cannot call write() after reset()"
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: cannot call write() after reset()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions