netease-youdao / QAnything

Question and Answer based on Anything.
https://qanything.ai
GNU Affero General Public License v3.0
11.3k stars 1.09k forks source link

[BUG] <elasticsearch.ApiError: ApiError(503, 'search_phase_execution_exception', None)> #258

Open kkkkkkkkkka opened 4 months ago

kkkkkkkkkka commented 4 months ago

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

当前行为 | Current Behavior

成功启动前后端服务,并且成功创建数据库,上传文档已解析,然后对话时无法回答。 sanic_api.log显示如下: Traceback (most recent call last): File "handle_request", line 132, in handle_request "_asgi_lifespan", File "/usr/local/lib/python3.10/dist-packages/sanic/response/types.py", line 547, in stream await self.streaming_fn(self) File "/workspace/qanything_local/qanything_kernel/qanything_server/handler.py", line 355, in generate_answer for resp, next_history in local_doc_qa.get_knowledge_based_answer( File "/workspace/qanything_local/qanything_kernel/core/local_doc_qa.py", line 225, in get_knowledge_based_answer source_documents = self.get_source_documents(retrieval_queries, milvus_kb) File "/workspace/qanything_local/qanything_kernel/core/local_doc_qa.py", line 133, in get_source_documents batch_result = milvus_kb.search_emb_async(embs=embs, top_k=top_k, queries=queries) File "/workspace/qanything_local/qanything_kernel/connector/database/milvus/milvus_client.py", line 181, in search_emb_async return future.result() File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result return self.get_result() File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in get_result raise self._exception File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) File "/workspace/qanything_local/qanything_kernel/connector/database/milvus/milvus_client.py", line 170, in __search_emb_sync es_records = self.client.search(queries) File "/workspace/qanything_local/qanything_kernel/connector/database/milvus/es_client.py", line 182, in search response = self.client.search( File "/usr/local/lib/python3.10/dist-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped return api(args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/elasticsearch/_sync/client/init.py", line 3836, in search return self.perform_request( # type: ignore[return-value] File "/usr/local/lib/python3.10/dist-packages/elasticsearch/_sync/client/_base.py", line 320, in perform_request raise HTTP_EXCEPTIONS.get(meta.status, ApiError)( elasticsearch.ApiError: ApiError(503, 'search_phase_execution_exception', None)

期望行为 | Expected Behavior

能够进行对话

运行环境 | Environment

- OS:
- NVIDIA Driver:
- CUDA:
- docker:
- docker-compose:
- NVIDIA GPU:
- NVIDIA GPU Memory:

QAnything日志 | QAnything logs

No response

复现方法 | Steps To Reproduce

No response

备注 | Anything else?

No response

kkkkkkkkkka commented 4 months ago

补充,除了问答之外,删除文档也会报这个错。 [2024-04-16 13:12:28 +0800] [1999] [ERROR] Exception occurred while handling uri: 'http://***/api/local_doc_qa/delete_files' Traceback (most recent call last): File "handle_request", line 97, in handle_request File "/workspace/qanything_local/qanything_kernel/qanything_server/handler.py", line 247, in delete_docs milvus_kb.delete_files(file_ids) File "/workspace/qanything_local/qanything_kernel/connector/database/milvus/milvus_client.py", line 288, in delete_files es_records = self.client.search(files_id, field='file_id') File "/workspace/qanything_local/qanything_kernel/connector/database/milvus/es_client.py", line 182, in search response = self.client.search( File "/usr/local/lib/python3.10/dist-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped return api(*args, *kwargs) File "/usr/local/lib/python3.10/dist-packages/elasticsearch/_sync/client/init.py", line 3836, in search return self.perform_request( # type: ignore[return-value] File "/usr/local/lib/python3.10/dist-packages/elasticsearch/_sync/client/_base.py", line 320, in perform_request raise HTTP_EXCEPTIONS.get(meta.status, ApiError)( elasticsearch.ApiError: ApiError(503, 'search_phase_execution_exception', None) ERROR:sanic.error:Exception occurred while handling uri: 'http://172.23.148.67:8777/api/local_doc_qa/delete_files' Traceback (most recent call last): File "handle_request", line 97, in handle_request File "/workspace/qanything_local/qanything_kernel/qanything_server/handler.py", line 247, in delete_docs milvus_kb.delete_files(file_ids) File "/workspace/qanything_local/qanything_kernel/connector/database/milvus/milvus_client.py", line 288, in delete_files es_records = self.client.search(files_id, field='file_id') File "/workspace/qanything_local/qanything_kernel/connector/database/milvus/es_client.py", line 182, in search response = self.client.search( File "/usr/local/lib/python3.10/dist-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped return api(args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/elasticsearch/_sync/client/init.py", line 3836, in search return self.perform_request( # type: ignore[return-value] File "/usr/local/lib/python3.10/dist-packages/elasticsearch/_sync/client/_base.py", line 320, in perform_request raise HTTP_EXCEPTIONS.get(meta.status, ApiError)( elasticsearch.ApiError: ApiError(503, 'search_phase_execution_exception', None)

fire717 commented 2 months ago

我也遇到这个问题了,有解决方案吗