infiniflow / ragflow

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

[Question]: Exception: Can't connect to ES cluster #1135

Closed yangboz closed 2 months ago

yangboz commented 4 months ago

Describe your problem

ping triggled exception for ever requesting from frontend.

File "/ragflow/rag/utils/es_conn.py", line 24, in init raise Exception("Can't connect to ES cluster") Exception: Can't connect to ES cluster Traceback (most recent call last): File "/ragflow/rag/svr/task_executor.py", line 28, in Traceback (most recent call last): File "/ragflow/api/ragflow_server.py", line 26, in from api.db.services.file2document_service import File2DocumentService File "/ragflow/api/db/services/init.py", line 18, in from api.apps import app File "/ragflow/api/apps/init.py", line 26, in from .user_service import UserService File "/ragflow/api/db/services/user_service.py", line 22, in from api.db.db_models import close_connection File "/ragflow/api/db/db_models.py", line 32, in from api.db.db_models import DB, UserTenant File "/ragflow/api/db/db_models.py", line 32, in from api.settings import DATABASE, stat_logger, SECRET_KEY File "/ragflow/api/settings.py", line 35, in from api.settings import DATABASE, stat_logger, SECRET_KEY File "/ragflow/api/settings.py", line 35, in from rag.utils.es_conn import ELASTICSEARCH File "/ragflow/rag/utils/es_conn.py", line 460, in from rag.utils.es_conn import ELASTICSEARCH File "/ragflow/rag/utils/es_conn.py", line 460, in ELASTICSEARCH = ESConnection() File "/ragflow/rag/utils/init.py", line 12, in _singleton ELASTICSEARCH = ESConnection() File "/ragflow/rag/utils/init.py", line 12, in _singleton instances[key] = cls(*args, *kw) File "/ragflow/rag/utils/es_conn.py", line 24, in init instances[key] = cls(args, **kw) File "/ragflow/rag/utils/es_conn.py", line 24, in init raise Exception("Can't connect to ES cluster") any idea? thanks. maybe it is ES docker image related M1 issue only?

JinHai-CN commented 4 months ago

Have you checked the FAQ document?

yangboz commented 4 months ago

Have you checked the FAQ document?

where is it ? in README.MD. thanks.

KevinHuSh commented 4 months ago

Make sure the code you pull and docker image you pull are on the same version. Do not use main branch code to run 0.7.0 version of docker image.

yangboz commented 4 months ago

Make sure the code you pull and docker image you pull are on the same version. Do not use main branch code to run 0.7.0 version of docker image.

did you mean change the version from of Elastic products STACK_VERSION=8.11.3 to 0.7.0 in .env file?

yangboz commented 4 months ago

Make sure the code you pull and docker image you pull are on the same version. Do not use main branch code to run 0.7.0 version of docker image.

even though after running ```docker-compose up -d , and verified rag flow-es01 is healthy, because of /ragflow/api/ragflow_server.py", line 26, in triggled File "/ragflow/rag/utils/es_conn.py", line 24, in _init, right?

Screenshot 2024-06-13 at 11 40 06
KevinHuSh commented 4 months ago

Make sure the code you pull and docker image you pull are on the same version. Do not use main branch code to run 0.7.0 version of docker image.

did you mean change the version from of Elastic products STACK_VERSION=8.11.3 to 0.7.0 in .env file?

No. It refers to the version of RAGFlow docker image. I suggest you to use dev version of docker image and pull the latest code.

yangboz commented 4 months ago

Again, after git reset --hard HEAD, docker-compose -f docker-compose-base.yml, move out ragflow_erver.py out of the api file folder, then direct run python ragflow_erver.py, errors thrown as following :

Connection error caused by: ProtocolError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))
[WARNING] [2024-06-14 17:14:56,205] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 8 times in a row, putting on 30 second timeout
Traceback (most recent call last):
  File "/Users/yangboz/git/ragflow/ragflow_server.py", line 26, in <module>
    from api.apps import app
  File "/Users/yangboz/git/ragflow/api/apps/__init__.py", line 26, in <module>
    from api.db.db_models import close_connection
  File "/Users/yangboz/git/ragflow/api/db/db_models.py", line 32, in <module>
    from api.settings import DATABASE, stat_logger, SECRET_KEY
  File "/Users/yangboz/git/ragflow/api/settings.py", line 35, in <module>
    from rag.utils.es_conn import ELASTICSEARCH
  File "/Users/yangboz/git/ragflow/rag/utils/es_conn.py", line 462, in <module>
    ELASTICSEARCH = ESConnection()
                    ^^^^^^^^^^^^^^

any idea? or any documents with this debug way. thanks.

yangboz commented 4 months ago

maybe is "" http://es01:9200)" in codebase debug level , the domain of http://es01 is not working , should be replaced with localhost or 0.0.0.0?

andymeadows commented 3 months ago

@yangboz , I posted the exact same issue in response to https://github.com/infiniflow/ragflow/issues/231?notification_referrer_id=NT_kwDOAANVr7IxMDEyNDA5ODExNjoyMTg1NDM#issuecomment-2153495658. The issue was closed with no explanation. This was (is) a legitimate problem.

We followed, exactly, the instructions at https://ragflow.io/docs/dev/#start-up-the-server. Twice, actually. And we were stuck with the error.

Today, we pulled the latest from the repo (again), and then ran docker compose up -d and it came to life. Try these steps. And note you may still get an error, but it's likely an error saying you haven't supplied keys for AI integration.

  1. Pull the latest from git@github.com:infiniflow/ragflow.git.
  2. Assuming it's created in a directory named ragflow, cd to ragflow/docker.
  3. run chmod ugo+x ./entrypoint.sh.
  4. run docker compose up -d

It should come up. At the time of this posting, HEAD points to #957cd55

yangboz commented 3 months ago

verified it only works with 0.7.0 version on ubuntu22.04, except on macOS M1 with any version of it . : -(

Valdanitooooo commented 3 months ago

I turned off the authentication for elasticsearch and skipped this error 😅

    environment:
      - node.name=es01
#      - ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
      - bootstrap.memory_lock=false
      - discovery.type=single-node
      - xpack.security.enabled=false
      - xpack.security.http.ssl.enabled=false
      - xpack.security.transport.ssl.enabled=false
      - TZ=${TIMEZONE}
yangboz commented 3 months ago

I turned off the authentication for elasticsearch and skipped this error 😅

    environment:
      - node.name=es01
#      - ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
      - bootstrap.memory_lock=false
      - discovery.type=single-node
      - xpack.security.enabled=false
      - xpack.security.http.ssl.enabled=false
      - xpack.security.transport.ssl.enabled=false
      - TZ=${TIMEZONE}

worth have a try.

yangboz commented 2 months ago

a working around is modify the ES configuration of local running local dev version of service_conf.yaml in respect of 0.0.0.0:12000->9200/tcp, :::12000->9200/tcp

cyhasuka commented 2 months ago

a working around is modify the ES configuration of local running local dev version of service_conf.yaml in respect of 0.0.0.0:12000->9200/tcp, :::12000->9200/tcp

Can you provide a specific solution on how and where this setting should be changed? Thank you very much! @yangboz

yangboz commented 2 months ago

a working around is modify the ES configuration of local running local dev version of service_conf.yaml in respect of 0.0.0.0:12000->9200/tcp, :::12000->9200/tcp

Can you provide a specific solution on how and where this setting should be changed? Thank you very much! @yangboz

then change the host and port in conf/service_conf.yaml to overwrite the default .env in docker system.

RyanRaw commented 2 months ago

我用中文回答吧,我也碰到了这个问题,我是win11 docker桌面版,用的是DEV分支。 进入elasticsearch docker执行设置用户名和密码的命令,重置所有密码为:infini_rag_flow

1.docker exec -it ragflow-es-01 /bin/bash 2.bin/elasticsearch-setup-passwords interactive

密码重置完成后,等待1分钟左右就可以正常使用了

Uluwatta commented 2 months ago

In my case it resolved when I update the es hosts to below on service_conf.yaml, it it helps anyone.

es:
  hosts: 'http://ragflow-es-01:9200'
Randname666 commented 1 month ago

This could be an overly excessive solution, but you can just edit /etc/hosts or alternatively, configure the DNS to point the resolution of es01 to 127.0.0.1. Also notice that for some reason the es01 is running at port 1200 rather than 9200 on the host. You can find it out by docker ps.

liudonghua123 commented 3 weeks ago

In my case it resolved when I update the es hosts to below on service_conf.yaml, it it helps anyone.

es:
  hosts: 'http://ragflow-es-01:9200'

I use docker compose to run it, I check the hosts of redis,mysql,es01,minio in the ragflow container, it's all working. So this isn't my case.

I also tried to bin/elasticsearch-setup-passwords interactive to reset all the passwords to infini_rag_flow, but it's the same error.

Details ``` ``` (client) root@xxs:~/ragflow/docker# docker compose -f docker-compose-selfhosted.yml exec ragflow bash WARN[0000] The "MACOS" variable is not set. Defaulting to a blank string. (base) bash-5.2# cat /etc/hosts 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.22.0.6 9c45d0b71e68 (base) bash-5.2# ping bash: ping: command not found (base) bash-5.2# cat /etc/os-release NAME="OpenCloudOS" VERSION="9.0" ID="opencloudos" ID_LIKE="opencloudos" VERSION_ID="9.0" PLATFORM_ID="platform:oc9" PRETTY_NAME="OpenCloudOS 9.0" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:opencloudos:opencloudos:9" HOME_URL="https://www.opencloudos.org/" BUG_REPORT_URL="https://bugs.opencloudos.tech/" (base) bash-5.2# (base) bash-5.2# yum install iputils Last metadata expiration check: 0:01:00 ago on Mon 30 Sep 2024 10:42:43 AM CST. Dependencies resolved. ====================================================================================================================================================================================== Package Architecture Version Repository Size ====================================================================================================================================================================================== Installing: iputils x86_64 20221126-2.oc9 BaseOS 168 k Transaction Summary ====================================================================================================================================================================================== Install 1 Package Total download size: 168 k Installed size: 578 k Is this ok [y/N]: y Downloading Packages: iputils-20221126-2.oc9.x86_64.rpm 429 kB/s | 168 kB 00:00 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 422 kB/s | 168 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : iputils-20221126-2.oc9.x86_64 1/1 Running scriptlet: iputils-20221126-2.oc9.x86_64 1/1 Verifying : iputils-20221126-2.oc9.x86_64 1/1 Installed: iputils-20221126-2.oc9.x86_64 Complete! (base) bash-5.2# ping es01 PING es01 (172.22.0.5) 56(84) bytes of data. 64 bytes from ragflow-es-01.docker_ragflow (172.22.0.5): icmp_seq=1 ttl=64 time=0.111 ms 64 bytes from ragflow-es-01.docker_ragflow (172.22.0.5): icmp_seq=2 ttl=64 time=0.063 ms ^C --- es01 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1018ms rtt min/avg/max/mdev = 0.063/0.087/0.111/0.024 ms (base) bash-5.2# ping redist ping: redist: Temporary failure in name resolution (base) bash-5.2# ping redis PING redis (172.22.0.4) 56(84) bytes of data. 64 bytes from ragflow-redis.docker_ragflow (172.22.0.4): icmp_seq=1 ttl=64 time=0.193 ms 64 bytes from ragflow-redis.docker_ragflow (172.22.0.4): icmp_seq=2 ttl=64 time=0.096 ms ^C --- redis ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.096/0.144/0.193/0.048 ms (base) bash-5.2# ping mysql PING mysql (172.22.0.3) 56(84) bytes of data. 64 bytes from ragflow-mysql.docker_ragflow (172.22.0.3): icmp_seq=1 ttl=64 time=0.176 ms 64 bytes from ragflow-mysql.docker_ragflow (172.22.0.3): icmp_seq=2 ttl=64 time=0.088 ms ^C --- mysql ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.088/0.132/0.176/0.044 ms (base) bash-5.2# (base) bash-5.2# ping minio PING minio (172.22.0.2) 56(84) bytes of data. 64 bytes from ragflow-minio.docker_ragflow (172.22.0.2): icmp_seq=1 ttl=64 time=0.170 ms 64 bytes from ragflow-minio.docker_ragflow (172.22.0.2): icmp_seq=2 ttl=64 time=0.071 ms ^C --- minio ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1022ms rtt min/avg/max/mdev = 0.071/0.120/0.170/0.049 ms (base) bash-5.2# curl curl: try 'curl --help' or 'curl --manual' for more information (base) bash-5.2# (base) bash-5.2# curl -v es01:9200 * Trying 172.22.0.5:9200... * Connected to es01 (172.22.0.5) port 9200 > GET / HTTP/1.1 > Host: es01:9200 > User-Agent: curl/8.4.0 > Accept: */* > < HTTP/1.1 401 Unauthorized < WWW-Authenticate: Basic realm="security" charset="UTF-8" < WWW-Authenticate: ApiKey < content-type: application/json < content-length: 403 < * Connection #0 to host es01 left intact {"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","ApiKey"]}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","ApiKey"]}},"status":401}(base) bash-5.2# (client) root@xxs:~/ragflow/docker# docker exec -it ragflow-es-01 /bin/bash elasticsearch@9ceca02e82db:~$ bin/elasticsearch-setup-passwords interactive ****************************************************************************** Note: The 'elasticsearch-setup-passwords' tool has been deprecated. This command will be removed in a future release. ****************************************************************************** Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user. You will be prompted to enter passwords as the process progresses. Please confirm that you would like to continue [y/N]y Enter password for [elastic]: Reenter password for [elastic]: Enter password for [apm_system]: Reenter password for [apm_system]: Enter password for [kibana_system]: Reenter password for [kibana_system]: Enter password for [logstash_system]: Reenter password for [logstash_system]: Enter password for [beats_system]: Reenter password for [beats_system]: Enter password for [remote_monitoring_user]: Reenter password for [remote_monitoring_user]: Changed password for user [apm_system] Changed password for user [kibana_system] Changed password for user [kibana] Changed password for user [logstash_system] Changed password for user [beats_system] Changed password for user [remote_monitoring_user] Changed password for user [elastic] elasticsearch@9ceca02e82db:~$ exit exit (client) root@xxs:~/ragflow/docker# ``` ```

image image

KevinHuSh commented 3 weeks ago

If you use docker and default configuration, hosts: http://es01:9200

liudonghua123 commented 3 weeks ago

Yes, I tested using curl -v -u elastic:infini_rag_flow xxx, the es should running ok. But the ragflow-server seems didn't pass the authentication info.

Details ``` (client) root@xxs:~/ragflow/docker# docker compose -f docker-compose-selfhosted.yml up -d WARN[0000] The "MACOS" variable is not set. Defaulting to a blank string. [+] Building 0.0s (0/0) [+] Running 11/11 ✔ Network docker_ragflow Created 0.1s ✔ Volume "docker_esdata01" Created 0.0s ✔ Volume "docker_mysql_data" Created 0.0s ✔ Volume "docker_minio_data" Created 0.0s ✔ Volume "docker_redis_data" Created 0.0s ✘ Container ragflow-mysql Error 34.4s ✔ Container ragflow-es-01 Healthy 43.9s ✔ Container ragflow-redis Started 1.8s ✔ Container ragflow-minio Started 5.0s ! es01 Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. 0.0s ✔ Container ragflow-server Created 0.3s dependency failed to start: container ragflow-mysql is unhealthy (client) root@xxs:~/ragflow/docker# docker compose -f docker-compose-selfhosted.yml up -d WARN[0000] The "MACOS" variable is not set. Defaulting to a blank string. [+] Building 0.0s (0/0) [+] Running 5/5 ✔ Container ragflow-minio Running 0.0s ✔ Container ragflow-mysql Healthy 0.5s ✔ Container ragflow-es-01 Healthy 0.5s ✔ Container ragflow-redis Running 0.0s ✔ Container ragflow-server Started 1.6s (client) root@xxs:~/ragflow/docker# (client) root@xxs:~/ragflow/docker# (client) root@xxs:~/ragflow/docker# tree . ├── docker-compose-admin-tool.yml ├── docker-compose-base.yml ├── docker-compose-CN-oc9.yml ├── docker-compose-gpu-CN-oc9.yml ├── docker-compose-gpu.yml ├── docker-compose-selfhosted.yml ├── docker-compose.yml ├── entrypoint.sh ├── init-kibana.sh ├── init.sql ├── launch_backend_service.sh ├── nginx │   ├── nginx.conf │   ├── proxy.conf │   └── ragflow.conf ├── ragflow-logs │   ├── api │   │   ├── ERROR.log │   │   ├── es.log │   │   └── WARNING.log │   └── rag │   ├── ERROR.log │   ├── es.log │   └── WARNING.log ├── README.md └── service_conf.yaml 4 directories, 22 files (client) root@xxs:~/ragflow/docker# tail -f ragflow-logs/rag/ERROR.log Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') ^C (client) root@xxs:~/ragflow/docker# docker compose -f docker-compose-selfhosted.yml ps WARN[0000] The "MACOS" variable is not set. Defaulting to a blank string. NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS ragflow-es-01 docker.elastic.co/elasticsearch/elasticsearch:8.11.3 "/bin/tini -- /usr/l…" es01 About a minute ago Up About a minute (healthy) 9300/tcp, 0.0.0.0:1200->9200/tcp, :::1200->9200/tcp ragflow-minio quay.io/minio/minio:RELEASE.2023-12-20T01-00-02Z "/usr/bin/docker-ent…" minio About a minute ago Up About a minute 0.0.0.0:9000-9001->9000-9001/tcp, :::9000-9001->9000-9001/tcp ragflow-mysql mysql:8.0.39 "docker-entrypoint.s…" mysql About a minute ago Up About a minute (healthy) 33060/tcp, 0.0.0.0:5455->3306/tcp, :::5455->3306/tcp ragflow-redis redis:7.2.4 "docker-entrypoint.s…" redis About a minute ago Up About a minute 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp ragflow-server edwardelric233/ragflow:oc9 "./entrypoint.sh" ragflow About a minute ago Up 43 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:9380->9380/tcp, :::9380->9380/tcp (client) root@xxs:~/ragflow/docker# curl -v -u elastic:infini_rag_flow localhost:1200 * Rebuilt URL to: localhost:1200/ * Trying 127.0.0.1... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 1200 (#0) * Server auth using Basic with user 'elastic' > GET / HTTP/1.1 > Host: localhost:1200 > Authorization: Basic ZWxhc3RpYzppbmZpbmlfcmFnX2Zsb3c= > User-Agent: curl/7.58.0 > Accept: */* > < HTTP/1.1 200 OK < X-elastic-product: Elasticsearch < content-type: application/json < content-length: 532 < { "name" : "es01", "cluster_name" : "docker-cluster", "cluster_uuid" : "S7mWxrw-RuGQiCwgTTZPig", "version" : { "number" : "8.11.3", "build_flavor" : "default", "build_type" : "docker", "build_hash" : "64cf052f3b56b1fd4449f5454cb88aca7e739d9a", "build_date" : "2023-12-08T11:33:53.634979452Z", "build_snapshot" : false, "lucene_version" : "9.8.0", "minimum_wire_compatibility_version" : "7.17.0", "minimum_index_compatibility_version" : "7.0.0" }, "tagline" : "You Know, for Search" } * Connection #0 to host localhost left intact (client) root@xxs:~/ragflow/docker# tail -f ragflow-logs/rag/ERROR.log Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') Fail to connect to es: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]') ^C (client) root@xxs:~/ragflow/docker# docker compose -f docker-compose-selfhosted.yml exec ragflow bash WARN[0000] The "MACOS" variable is not set. Defaulting to a blank string. (base) bash-5.2# curl -v -u elastic:infini_rag_flow es01:9200 * Trying 172.25.0.2:9200... * Connected to es01 (172.25.0.2) port 9200 * Server auth using Basic with user 'elastic' > GET / HTTP/1.1 > Host: es01:9200 > Authorization: Basic ZWxhc3RpYzppbmZpbmlfcmFnX2Zsb3c= > User-Agent: curl/8.4.0 > Accept: */* > < HTTP/1.1 200 OK < X-elastic-product: Elasticsearch < content-type: application/json < content-length: 532 < { "name" : "es01", "cluster_name" : "docker-cluster", "cluster_uuid" : "S7mWxrw-RuGQiCwgTTZPig", "version" : { "number" : "8.11.3", "build_flavor" : "default", "build_type" : "docker", "build_hash" : "64cf052f3b56b1fd4449f5454cb88aca7e739d9a", "build_date" : "2023-12-08T11:33:53.634979452Z", "build_snapshot" : false, "lucene_version" : "9.8.0", "minimum_wire_compatibility_version" : "7.17.0", "minimum_index_compatibility_version" : "7.0.0" }, "tagline" : "You Know, for Search" } * Connection #0 to host es01 left intact (base) bash-5.2# exit exit (client) root@xxs:~/ragflow/docker# ```
liudonghua123 commented 3 weeks ago

I found the issue is the auth of es is not used, strange?

image

KevinHuSh commented 3 weeks ago

That because it's a little complicated for most of user to configure. Even though, a lot of people fail on ES installation.

liudonghua123 commented 3 weeks ago

I tried to update es_conn.py in the ragflow container according to https://github.com/infiniflow/ragflow/commit/195498daaabaa4e5b1356d96ea66307ee7af89fb via adding this two lines of code.

                    basic_auth=(settings.ES["username"], settings.ES["password"]) if "username" in settings.ES and "password" in settings.ES else None,
                    verify_certs=False,

Then the original errors changed to Fail to connect to es: Connection error caused by: ConnectionError(Connection error caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f0e44f71050>: Failed to establish a new connection: [Errno 111] Connection refused)).

Maybe the image edwardelric233/ragflow:oc9 is too old, so I changed edwardelric233/ragflow:oc9 to registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow:dev-slim. And now it seems working now. But I see some other warnings.

ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/scholarly/_scholarly.py:312: SyntaxWarning: invalid escape sequence '\d'
ragflow-server  |   m = re.search("cites=[\d+,]*", object["citedby_url"])
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/bibtexparser/latexenc.py:93: SyntaxWarning: invalid escape sequence '\g'
ragflow-server  |   string = re.sub('([^{]|^)([A-Z])([^}]|$)', '\g<1>{\g<2>}\g<3>', string)
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/graspologic/align/seedless_procrustes.py:18: SyntaxWarning: invalid escape sequence '\i'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/ot/gromov/_quantized.py:233: SyntaxWarning: invalid escape sequence '\m'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/ot/gromov/_quantized.py:338: SyntaxWarning: invalid escape sequence '\m'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/ot/gromov/_quantized.py:411: SyntaxWarning: invalid escape sequence '\m'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/ot/gromov/_quantized.py:764: SyntaxWarning: invalid escape sequence '\m'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/ot/gromov/_quantized.py:857: SyntaxWarning: invalid escape sequence '\m'
ragflow-server  |   """
ragflow-server  | [WARNING] Load term.freq FAIL!
ragflow-server  | [WARNING] Load term.freq FAIL!
ragflow-server  | 
ragflow-server  |         ____   ___    ______ ______ __               
ragflow-server  |        / __ \ /   |  / ____// ____// /____  _      __
ragflow-server  |       / /_/ // /| | / / __ / /_   / // __ \| | /| / /
ragflow-server  |      / _, _// ___ |/ /_/ // __/  / // /_/ /| |/ |/ / 
ragflow-server  |     /_/ |_|/_/  |_|\____//_/    /_/ \____/ |__/|__/                             
ragflow-server  | 
ragflow-server  |     
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/hyppo/kgof/kernel.py:93: SyntaxWarning: invalid escape sequence '\s'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/hyppo/kgof/kernel.py:132: SyntaxWarning: invalid escape sequence '\s'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/hyppo/kgof/kernel.py:234: SyntaxWarning: invalid escape sequence '\s'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/graspologic/match/wrappers.py:74: SyntaxWarning: invalid escape sequence '\s'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/graspologic/pipeline/embed/adjacency_spectral_embedding.py:37: SyntaxWarning: invalid escape sequence '\S'
ragflow-server  |   """
ragflow-server  | /ragflow/.venv/lib/python3.12/site-packages/graspologic/pipeline/embed/laplacian_spectral_embedding.py:38: SyntaxWarning: invalid escape sequence '\S'
ragflow-server  |   """
ragflow-server  | /ragflow/graphrag/entity_resolution.py:189: SyntaxWarning: invalid escape sequence '\d'
ragflow-server  |   pattern_int = f"{re.escape(entity_index_delimiter)}(\d+){re.escape(entity_index_delimiter)}"
ragflow-server  | [INFO] [2024-10-02 23:05:49,029] [_internal._log] [line:97]: WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
ragflow-server  |  * Running on all addresses (0.0.0.0)
ragflow-server  |  * Running on http://127.0.0.1:9380
ragflow-server  |  * Running on http://172.26.0.6:9380
ragflow-server  | [INFO] [2024-10-02 23:05:49,030] [_internal._log] [line:97]: Press CTRL+C to quit

I found these warnings are coming from the docstring, for example /ragflow/.venv/lib/python3.12/site-packages/ot/gromov/_quantized.py:233. For these warnings, see also Python3.12 SyntaxWarning on triplequoted string \d must be \\d, How to fix "SyntaxWarning: invalid escape sequence" in Python?

image

KevinHuSh commented 3 weeks ago

I see.