dataelement/bisheng

知识库错误

shishugen opened this issue · 2 comments

trace=110cca5abc1649a4aeed2a5c374908fa Node <Urllib3HttpNode(http://elasticsearch:9200)> has failed for 1 times in a row, putting on 1 second timeout
[2024-07-10 14:45:12.417710] [2024-07-10 14:45:12.414948] [ERROR process-9-126022542399168 bisheng.api.services.knowledge_imp:507] - trace=110cca5abc1649a4aeed2a5c374908fa Connection timed out
Traceback (most recent call last):

                           File "/usr/local/lib/python3.10/threading.py", line 973, in _bootstrap                                                                                                                                                                                                       
                             self._bootstrap_inner()                                                                                                                                                                                                                                                    
                             |    -> <function Thread._bootstrap_inner at 0x72a055ad0e50>                                                                                                                                                                                                               
                             -> <WorkerThread(AnyIO worker thread, started 126022542399168)>                                                                                                                                                                                                            
                           File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner                                                                                                                                                                                                
                             self.run()                                                                                                                                                                                                                                                                 
                             |    -> <function WorkerThread.run at 0x729e7c3cf640>                                                                                                                                                                                                                      
                             -> <WorkerThread(AnyIO worker thread, started 126022542399168)>                                                                                                                                                                                                            
                           File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 859, in run                                                                                                                                                                                 
                             result = context.run(func, *args)                                                                                                                                                                                                                                          
                                      |       |   |      -> ([KnowledgeFile(md5='b82ba51ceadc8175537c81850f313392fa7096a1a56b27e75d001930028c4780', user_id=1, object_name='original/11.t...                                                                                                            
                                      |       |   -> <function retry_files at 0x729ee0a04dc0>                                                                                                                                                                                                           
                                      |       -> <method 'run' of '_contextvars.Context' objects>                                                                                                                                                                                                       
                                      -> <_contextvars.Context object at 0x729ecfe2a080>                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                        
                         > File "/app/bisheng/api/services/knowledge_imp.py", line 505, in retry_files                                                                                                                                                                                                  
                             delete_knowledge_file_vectors(file_ids=list(new_files.keys()), clear_minio=False)                                                                                                                                                                                          
                             |                                           |         -> <method 'keys' of 'dict' objects>                                                                                                                                                                                 
                             |                                           -> {11: KnowledgeFile(user_id=1, knowledge_id=6, file_name='说明.txt', md5='b82ba51ceadc8175537c81850f313392fa7096a1a56b27e75d0019...                                                                                          
                             -> <function delete_knowledge_file_vectors at 0x729ee0a04a60>                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                        
                           File "/app/bisheng/api/services/knowledge_imp.py", line 187, in delete_knowledge_file_vectors                                                                                                                                                                                
                             esvectore_client = decide_vectorstores(index_name, 'ElasticKeywordsSearch', embeddings)                                                                                                                                                                                    
                                                |                   |                                    -> <bisheng.interface.embeddings.custom.FakeEmbedding object at 0x729e6442e920>                                                                                                                
                                                |                   -> 'col_1720593077_66ef7a07'                                                                                                                                                                                                        
                                                -> <function decide_vectorstores at 0x729ee0a04af0>                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                        
                           File "/app/bisheng/api/services/knowledge_imp.py", line 217, in decide_vectorstores                                                                                                                                                                                          
                             return instantiate_vectorstore(vector_store, class_object=class_obj, params=param)                                                                                                                                                                                         
                                    |                       |                          |                 -> {'index_name': 'col_1720593077_66ef7a07', 'embedding': '', 'elasticsearch_url': 'http://elasticsearch:9200', 'ssl_verify': {'...                                                            
                                    |                       |                          -> <class 'bisheng_langchain.vectorstores.elastic_keywords_search.ElasticKeywordsSearch'>                                                                                                                        
                                    |                       -> 'ElasticKeywordsSearch'                                                                                                                                                                                                                  
                                    -> <function instantiate_vectorstore at 0x729ee29e5e10>                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                        
                           File "/app/bisheng/interface/initialize/loading.py", line 512, in instantiate_vectorstore                                                                                                                                                                                    
                             vecstore = initializer(class_object, params, search_kwargs)                                                                                                                                                                                                                
                                        |           |             |       -> {}                                                                                                                                                                                                                         
                                        |           |             -> {'index_name': 'col_1720593077_66ef7a07', 'embedding': '', 'elasticsearch_url': 'http://elasticsearch:9200', 'ssl_verify': {'...                                                                                                   
                                        |           -> <class 'bisheng_langchain.vectorstores.elastic_keywords_search.ElasticKeywordsSearch'>                                                                                                                                                           
                                        -> <function initial_elastic at 0x729ee2c3e5f0>                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                        
                           File "/app/bisheng/interface/initialize/vector_store.py", line 260, in initial_elastic                                                                                                                                                                                       
                             return class_object.from_documents(**params)                                                                                                                                                                                                                               
                                    |            |                -> {'index_name': 'col_1720593077_66ef7a07', 'embedding': '', 'elasticsearch_url': 'http://elasticsearch:9200', 'ssl_verify': {'...                                                                                                   
                                    |            -> <classmethod(<function VectorStore.from_documents at 0x729f9f3483a0>)>                                                                                                                                                                              
                                    -> <class 'bisheng_langchain.vectorstores.elastic_keywords_search.ElasticKeywordsSearch'>                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                        
                           File "/usr/local/lib/python3.10/site-packages/langchain_core/vectorstores.py", line 550, in from_documents                                                                                                                                                                   
                             return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)                                                                                                                                                                                                     
                                    |   |          |      |                    |            -> {'index_name': 'col_1720593077_66ef7a07', 'elasticsearch_url': 'http://elasticsearch:9200', 'ssl_verify': {'basic_auth': ('el...                                                                         
                                    |   |          |      |                    -> []                                                                                                                                                                                                                    
                                    |   |          |      -> ''                                                                                                                                                                                                                                         
                                    |   |          -> []                                                                                                                                                                                                                                                
                                    |   -> <classmethod(<function ElasticKeywordsSearch.from_texts at 0x729ef2eea950>)>                                                                                                                                                                                 
                                    -> <class 'bisheng_langchain.vectorstores.elastic_keywords_search.ElasticKeywordsSearch'>                                                                                                                                                                           
                           File "/usr/local/lib/python3.10/site-packages/bisheng_langchain/vectorstores/elastic_keywords_search.py", line 305, in from_texts                                                                                                                                            
                             vectorsearch.add_texts(texts,                                                                                                                                                                                                                                              
                             |            |         -> []                                                                                                                                                                                                                                               
                             |            -> <function ElasticKeywordsSearch.add_texts at 0x729ef2eea680>                                                                                                                                                                                               
                             -> <bisheng_langchain.vectorstores.elastic_keywords_search.ElasticKeywordsSearch object at 0x729e6442e800>                                                                                                                                                                 
                           File "/usr/local/lib/python3.10/site-packages/bisheng_langchain/vectorstores/elastic_keywords_search.py", line 189, in add_texts                                                                                                                                             
                             self.client.indices.refresh(index=self.index_name)                                                                                                                                                                                                                         
                             |    |      |       |             |    -> 'col_1720593077_66ef7a07'                                                                                                                                                                                                        
                             |    |      |       |             -> <bisheng_langchain.vectorstores.elastic_keywords_search.ElasticKeywordsSearch object at 0x729e6442e800>                                                                                                                               
                             |    |      |       -> <function IndicesClient.refresh at 0x729efa073b50>                                                                                                                                                                                                  
                             |    |      -> <elasticsearch._sync.client.indices.IndicesClient object at 0x729e642c02e0>                                                                                                                                                                                 
                             |    -> <Elasticsearch(['http://elasticsearch:9200'])>                                                                                                                                                                                                                     
                             -> <bisheng_langchain.vectorstores.elastic_keywords_search.ElasticKeywordsSearch object at 0x729e6442e800>                                                                                                                                                                 
                           File "/usr/local/lib/python3.10/site-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped                                                                                                                                                                     
                             return api(*args, **kwargs)                                                                                                                                                                                                                                                
                                    |    |       -> {'index': 'col_1720593077_66ef7a07'}                                                                                                                                                                                                                
                                    |    -> (<elasticsearch._sync.client.indices.IndicesClient object at 0x729e642c02e0>,)                                                                                                                                                                              
                                    -> <function IndicesClient.refresh at 0x729efa073ac0>                                                                                                                                                                                                               
                           File "/usr/local/lib/python3.10/site-packages/elasticsearch/_sync/client/indices.py", line 3490, in refresh                                                                                                                                                                  
                             return self.perform_request(  # type: ignore                                                                                                                                                                                                                               
                                    |    -> <function NamespacedClient.perform_request at 0x729efa02c280>                                                                                                                                                                                               
                                    -> <elasticsearch._sync.client.indices.IndicesClient object at 0x729e642c02e0>                                                                                                                                                                                      
                           File "/usr/local/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 423, in perform_request                                                                                                                                                             
                             return self._client.perform_request(                                                                                                                                                                                                                                       
                                    |    |       -> <function BaseClient.perform_request at 0x729efa02c0d0>                                                                                                                                                                                             
                                    |    -> <Elasticsearch(['http://elasticsearch:9200'])>                                                                                                                                                                                                              
                                    -> <elasticsearch._sync.client.indices.IndicesClient object at 0x729e642c02e0>                                                                                                                                                                                      
                           File "/usr/local/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 271, in perform_request                                                                                                                                                             
                             response = self._perform_request(                                                                                                                                                                                                                                          
                                        |    -> <function BaseClient._perform_request at 0x729efa02c160>                                                                                                                                                                                                
                                        -> <Elasticsearch(['http://elasticsearch:9200'])>                                                                                                                                                                                                               
                           File "/usr/local/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 316, in _perform_request                                                                                                                                                            
                             meta, resp_body = self.transport.perform_request(                                                                                                                                                                                                                          
                                               |    -> <property object at 0x729e7c3a71a0>                                                                                                                                                                                                              
                                               -> <Elasticsearch(['http://elasticsearch:9200'])>                                                                                                                                                                                                        
                           File "/usr/local/lib/python3.10/site-packages/elastic_transport/_transport.py", line 342, in perform_request                                                                                                                                                                 
                             resp = node.perform_request(                                                                                                                                                                                                                                               
                                    |    -> <function Urllib3HttpNode.perform_request at 0x729ef9fc0310>                                                                                                                                                                                                
                                    -> <Urllib3HttpNode(http://elasticsearch:9200)>                                                                                                                                                                                                                     
                           File "/usr/local/lib/python3.10/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request                                                                                                                                                        
                             raise err from None                                                                                                                                                                                                                                                        
                                   -> ConnectionTimeout('Connection timed out during request')                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                        
                         elastic_transport.ConnectionTimeout: Connection timed out  

image
image
测试在容器内连接是没有问题的

最终怎么解决了吗