Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

langchain-chatchatv0.2.9部署好之后偶尔出现异步问题

Open maxusheng123 opened this issue 1 year ago • 1 comments

2024-02-21 06:34:42,733 - runners.py[line:44] - ERROR: Task exception was never retrieved future: <Task finished name='Task-13266' coro=<AsyncClient.aclose() done, defined at /root/miniconda3/envs/xiaokaguiji/lib/python3.10/site-packages/httpx/_client.py:1967> exception=RuntimeError('unable to perform operation on <TCPTransport closed=True reading=False 0x7fd7c0730a30>; the handler is closed')> Traceback (most recent call last): File "/root/miniconda3/envs/xiaokaguiji/lib/python3.10/site-packages/httpx/_client.py", line 1974, in aclose await self._transport.aclose() File "/root/miniconda3/envs/xiaokaguiji/lib/python3.10/site-packages/httpx/_transports/default.py", line 378, in aclose await self._pool.aclose() File "/root/miniconda3/envs/xiaokaguiji/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 324, in aclose await connection.aclose() File "/root/miniconda3/envs/xiaokaguiji/lib/python3.10/site-packages/httpcore/_async/connection.py", line 173, in aclose await self._connection.aclose() File "/root/miniconda3/envs/xiaokaguiji/lib/python3.10/site-packages/httpcore/_async/http11.py", line 253, in aclose await self._network_stream.aclose() File "/root/miniconda3/envs/xiaokaguiji/lib/python3.10/site-packages/httpcore/_backends/anyio.py", line 54, in aclose await self._stream.aclose() File "/root/miniconda3/envs/xiaokaguiji/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 1257, in aclose self._transport.write_eof() File "uvloop/handles/stream.pyx", line 699, in uvloop.loop.UVStream.write_eof File "uvloop/handles/handle.pyx", line 159, in uvloop.loop.UVHandle._ensure_alive RuntimeError: unable to perform operation on <TCPTransport closed=True reading=False 0x7fd7c0730a30>; the handler is closed 在进行agent对话时偶尔会出现上面这个错,请教一下是啥原因。

maxusheng123 avatar Feb 21 '24 06:02 maxusheng123

🤖

嘿,@maxusheng123!很高兴再次见到你。希望你一切都好!

您遇到的这个问题,通常是在尝试在已关闭的连接上进行操作时出现的。在Langchain-Chatchat v0.2.9的上下文中,这可能是由于以下几个原因:

  1. 连接到模型工作器或控制器可能意外关闭。这可能是由于网络、服务器或代码本身的问题。

  2. 可能存在竞态条件,即在执行操作之前或同时关闭连接。如果多个进程或线程试图使用同一连接,可能会发生这种情况。

  3. FastAPI或uvicorn服务器的运行方式可能存在问题。如果服务器没有正确设置以处理异步任务,可能会过早关闭连接。

没有更具体的错误发生时的信息,很难确定确切的原因。但是,您可以开始通过检查网络和服务器日志,以及在代码中添加更多的错误处理和日志记录,来查看连接何时以及为何被关闭。

关于从Langchain-Chatchat v0.2.9过渡到v0.2.10的改变,我在仓库中没有找到具体的信息,可能需要在其他地方寻找,或者我可能遗漏了一些信息。

另外,我在Langchain-Chatchat仓库中找到了一些类似的已解决问题,可能对您有所帮助:

  1. API chat/chat报错
  2. [BUG] 运行之后,对话不反应,api.py报错,APIConnectionError、我看好多人遇到相同的问题,都没找到解决方法吗
  3. [BUG] 关闭websocket链接都会报错

希望这些信息能对您有所帮助。如果您需要更多的帮助,或者有更多的信息可以提供,欢迎随时向我提问。

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Feb 21 '24 06:02 dosubot[bot]

  1. agent是顺发的,如果你高并发可能会冲突出现问题
  2. agent中间执行失败是很正常的,这样就会无法请求

zRzRzRzRzRzRzR avatar Feb 22 '24 14:02 zRzRzRzRzRzRzR

有人知道这个解决办法吗

Nancy7zt avatar Aug 16 '24 07:08 Nancy7zt