infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
22.21k stars 2.18k forks source link

[Bug]: rag\svr\task_executor.py socket.gaierror: [Errno -2] Name or service not known #3020

Open sweetboxwwy opened 2 weeks ago

sweetboxwwy commented 2 weeks ago

Is there an existing issue for the same bug?

Branch name

main

Commit ID

7f81fc8

Other environment information

centos 7
python 3.12

Actual behavior

[WARNING] [2024-10-25 17:36:59,658] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 1 times in a row, putting on 1 second timeout [WARNING] [2024-10-25 17:36:59,658] [_transport.perform_request] [line:415]: Retrying request after failure (attempt 0 of 3) Traceback (most recent call last): File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/connection.py", line 199, in _new_conn sock = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/util/connection.py", line 60, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/anaconda3/envs/rag/lib/python3.12/socket.py", line 976, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socket.gaierror: [Errno -2] Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/elastic_transport/_node/_http_urllib3.py", line 167, in perform_request response = self.pool.urlopen( ^^^^^^^^^^^^^^^^^^ File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/util/retry.py", line 449, in increment raise reraise(type(error), error, _stacktrace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/util/util.py", line 39, in reraise raise value File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request conn.request( File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/connection.py", line 441, in request self.endheaders() File "/data/anaconda3/envs/rag/lib/python3.12/http/client.py", line 1331, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/data/anaconda3/envs/rag/lib/python3.12/http/client.py", line 1091, in _send_output self.send(msg) File "/data/anaconda3/envs/rag/lib/python3.12/http/client.py", line 1035, in send self.connect() File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/connection.py", line 279, in connect self.sock = self._new_conn() ^^^^^^^^^^^^^^^^ File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/urllib3/connection.py", line 206, in _new_conn raise NameResolutionError(self.host, self, e) from e urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPConnection object at 0x7f02a26307d0>: Failed to resolve 'es01' ([Errno -2] Name or service not known)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/elastic_transport/_transport.py", line 342, in perform_request resp = node.perform_request( ^^^^^^^^^^^^^^^^^^^^^ File "/data/anaconda3/envs/rag/lib/python3.12/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request raise err from e elastic_transport.ConnectionError: Connection error caused by: NameResolutionError(<urllib3.connection.HTTPConnection object at 0x7f02a26307d0>: Failed to resolve 'es01' ([Errno -2] Name or service not known))

Expected behavior

No response

Steps to reproduce

cd /projects/ragflow
docker compose -f docker/docker-compose-base.yml -p "ragflow" up -d

export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY="";
/usr/sbin/nginx;
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/;
export PYTHONPATH=/projects/ragflow;
cd /projects;

python ragflow/rag/svr/task_executor.py

Additional information

No response

KevinHuSh commented 1 week ago

Check the ES configuration in conf/service_conf.yaml.

sweetboxwwy commented 1 week ago

Check the ES configuration in conf/service_conf.yaml.

I edited the /etc/hosts file and added the following content to solve thist bug:

127.0.0.1 es01 mysql minio redis