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

[BUG] 知识问答报错:API通信遇到错误

Open linaiyue opened this issue 9 months ago • 1 comments

问题描述 / Problem Description 知识库问答,出现API通信错误,检索条目3变成1条也出错

复现问题的步骤 / Steps to Reproduce

  1. 执行 '$ python startup.py -a'
  2. 点击 '知识库问答'
  3. 输入问题
  4. 问题出现 / Problem occurs

预期的结果 / Expected Result 能正确检索文档

实际结果 / Actual Result API通信遇到错误:peer closed connection without sending complete message body (incomplete chunked read)

环境信息 / Environment Information

  • langchain-ChatGLM 版本/commit 号:0.0.354. fastchat版本:0.2.35
  • 是否使用 Docker 部署(是/否):否
  • 使用的模型(ChatGLM2-6B / Qwen-7B 等): ChatGLM3-6B
  • 使用的 Embedding 模型(moka-ai/m3e-base 等):bge-large-zh-v1.5 @ cuda
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss / Vector library used (faiss, milvus, pg_vector, etc.): faiss
  • 操作系统及版本 / Operating system and version: Linux-5.15.136-tegra-aarch64-with-glibc2.35
  • Python 版本 / Python version:3.10
  • 其他相关环境信息 / Other relevant environment information: cuda 12.1

附加信息 / Additional Information 添加与问题相关的任何其他信息 / Add any other information related to the issue. log.txt

linaiyue avatar May 15 '24 09:05 linaiyue

针对您遇到的“peer closed connection without sending complete message body (incomplete chunked read)”错误,这通常是因为服务器在完整的消息体被发送或接收之前关闭了连接。以下是一些基于您描述的情况可能的解决方案:

  1. 检查应用日志:寻找与RemoteProtocolErrorKeyError相关的特定错误消息或堆栈跟踪,这可以提供故障发生位置的更多上下文。

  2. 调整Uvicorn和FastAPI的配置:如果问题与负载大小限制有关,可以通过--limit-concurrency--limit-max-requests命令行参数或代码中的等效配置来调整这些设置。

  3. 确保端点正确解析和验证输入数据:特别是对于大文本,使用FastAPI中的Pydantic模型来强制输入验证。

  4. 优化文本修改逻辑的性能或增加Uvicorn及任何前置反向代理或负载均衡器的超时设置:如果处理超时是一个问题,考虑这些选项。

  5. 验证所有必需的NLTK资源是否在配置的NLTK_DATA_PATH中可用,并在应用代码中优雅地处理缺失资源

如果这些建议没有解决您的问题,提供更多关于导致此错误的API调用的具体函数或方法的信息将有助于进一步缩小问题的可能原因。

Details

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.

To continue the conversation, mention @dosu.

dosubot[bot] avatar May 15 '24 09:05 dosubot[bot]

把知识检索结果排序功能禁用掉(USE_RERANKER = False)就不会报这个错了,我看报错日志在排序过程中报错了

danny-zhu avatar May 25 '24 10:05 danny-zhu