ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: Connection exception of redis

Open TomTigerDong opened this issue 11 months ago • 14 comments

Describe your problem

报告RAGFlow安装后的Redis连接异常问题.md

TomTigerDong avatar Feb 15 '25 08:02 TomTigerDong

ubuntu24.04上安装ragflow,可以正常拉取,但无法正常运行

TomTigerDong avatar Feb 15 '25 08:02 TomTigerDong

我也是ubuntu24.04,弄了一下午了,issues看来看去也没找到类似错误,直到我刚看到你的报告,但是我全部组件都能正常运行,也能启动RAGFlow,进web操作页面,我的问题表现出来不一样,目前试出来的问题有1、无法添加LLM模型,点击后按钮出现loading状态后无反应,看到发送了网络请求,但是请求没得到回复 2、无法进行聊天对话,我部署的带模型的版本,表现状态为点击后无反应。 ragflow-server日志一直报错RedisDB.queue_info rag_flow_svr_queue got exception: no such key,如下, 2025-02-15 16:55:48,423 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T16:55:48.421+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 16:56:18,434 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 16:56:18,435 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T16:56:18.433+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 16:56:48,461 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 16:56:48,462 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T16:56:48.461+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 16:56:49,478 INFO 15 Retrying request to /chat/completions in 0.988217 seconds 2025-02-15 16:57:18,493 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 16:57:18,494 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T16:57:18.493+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 16:57:48,516 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 16:57:48,517 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T16:57:48.516+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 16:58:18,541 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 16:58:18,542 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T16:58:18.540+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 16:58:48,566 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 16:58:48,566 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T16:58:48.565+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 16:59:04,646 INFO 15 Retrying request to /chat/completions in 1.599328 seconds 2025-02-15 16:59:18,595 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 16:59:18,596 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T16:59:18.595+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 16:59:48,611 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 16:59:48,611 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T16:59:48.610+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 17:00:18,643 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 17:00:18,644 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T17:00:18.642+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 17:00:46,600 INFO 15 172.22.0.6 - - [15/Feb/2025 17:00:46] "GET /v1/llm/my_llms HTTP/1.1" 200 - 2025-02-15 17:00:46,601 INFO 15 172.22.0.6 - - [15/Feb/2025 17:00:46] "GET /v1/user/tenant_info HTTP/1.1" 200 - 2025-02-15 17:00:46,627 INFO 15 172.22.0.6 - - [15/Feb/2025 17:00:46] "GET /v1/llm/factories HTTP/1.1" 200 - 2025-02-15 17:00:48,675 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 17:00:48,676 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T17:00:48.674+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-15 17:01:18,707 WARNING 17 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-15 17:01:18,708 INFO 17 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-15T17:01:18.707+08:00", "boot_at": "2025-02-15T16:47:18.011+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null}

Image

DolphinSh avatar Feb 15 '25 09:02 DolphinSh

The same issue for me (win10 wsl2 ubuntu24.04 ) : http://127.0.0.1 web no response "RedisDB.queue_info rag_flow_svr_queue got exception: no such key"

/opt/docker/ragflow/docker# docker ps -a 5 containers running

docker logs -f ragflow-server 2025-02-16 01:22:42,137 INFO 22 RAGFlow HTTP server start... 2025-02-16 01:22:42,138 INFO 22 WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:9380
  • Running on http://172.18.0.6:9380 2025-02-16 01:22:42,138 INFO 22 Press CTRL+C to quit 2025-02-16 01:22:42,145 INFO 24 init database on cluster mode successfully ....................... 2025-02-16 01:22:47,276 WARNING 24 RedisDB.queue_info rag_flow_svr_queue got exception: no such key2025-02-16 01:22:47,276 INFO 24 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-16T01:22:47.276+08:00", "boot_at": "2025-02-16T01:22:47.255+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-16 01:23:17,307 WARNING 24 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-16 01:23:17,307 INFO 24 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-16T01:23:17.306+08:00", "boot_at": "2025-02-16T01:22:47.255+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-16 01:23:47,322 WARNING 24 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-16 01:23:47,322 INFO 24 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-16T01:23:47.321+08:00", "boot_at": "2025-02-16T01:22:47.255+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null}

docker logs -f ragflow-redis 1:C 15 Feb 2025 17:20:28.526 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. 1:C 15 Feb 2025 17:20:28.526 * oO0OoO0OoO0Oo Valkey is starting oO0OoO0OoO0Oo 1:C 15 Feb 2025 17:20:28.526 * Valkey version=8.0.2, bits=64, commit=00000000, modified=0, pid=1, just started 1:C 15 Feb 2025 17:20:28.526 * Configuration loaded 1:M 15 Feb 2025 17:20:28.526 * monotonic clock: POSIX clock_gettime 1:M 15 Feb 2025 17:20:28.527 * Running mode=standalone, port=6379. 1:M 15 Feb 2025 17:20:28.527 * Server initialized 1:M 15 Feb 2025 17:20:28.527 * Loading RDB produced by Valkey version 8.0.2 1:M 15 Feb 2025 17:20:28.527 * RDB age 167 seconds 1:M 15 Feb 2025 17:20:28.527 * RDB memory usage when created 1.05 Mb 1:M 15 Feb 2025 17:20:28.527 * Done loading RDB, keys loaded: 2, keys expired: 0. 1:M 15 Feb 2025 17:20:28.527 * DB loaded from disk: 0.000 seconds 1:M 15 Feb 2025 17:20:28.527 * Ready to accept connections tcp

micjac99 avatar Feb 15 '25 17:02 micjac99

又研究了一下,在虚拟部署Rocky Linux v9.5 系统,部署ragflow v0.16.0-slim版本,启动后依然是一样的错误,提示 RedisDB.queue_info rag_flow_svr_queue got exception: no such key。能进web页面,实现注册和登录、llm大模型只能添加ollama,实现文档解析,和对话聊天。试了OpenAI-API-Compatible、SILICONFLOW,无法添加。

DolphinSh avatar Feb 16 '25 08:02 DolphinSh

We intend to create an international community, so we encourage using English for communication.

JinHai-CN avatar Feb 16 '25 11:02 JinHai-CN

try again with website http://localhost Still on response env: Ubuntu22.04 +ragflowv-v0.15.1 on window10 WLS2 docker-compose-V2

ragflow log: Traceback (most recent call last): File "/ragflow/rag/utils/redis_conn.py", line 226, in get_unacked_for group_info = self.REDIS.xinfo_groups(queue_name) File "/ragflow/.venv/lib/python3.10/site-packages/valkey/commands/core.py", line 3810, in xinfo_groups return self.execute_command("XINFO GROUPS", name) File "/ragflow/.venv/lib/python3.10/site-packages/valkey/client.py", line 564, in execute_command conn = self.connection or pool.get_connection(command_name, **options) File "/ragflow/.venv/lib/python3.10/site-packages/valkey/connection.py", line 1107, in get_connection connection.connect() File "/ragflow/.venv/lib/python3.10/site-packages/valkey/connection.py", line 308, in connect raise ConnectionError(self._error_message(e)) valkey.exceptions.ConnectionError: Error -2 connecting to redis:6379. Name or service not known. 2025-02-16 19:15:11,736 ERROR 19 RedisDB.queue_consumer rag_flow_svr_queue got exception: Error -2 connecting to redis:6379. Name or service not known. Traceback (most recent call last): File "/ragflow/.venv/lib/python3.10/site-packages/valkey/connection.py", line 302, in connect sock = self.retry.call_with_retry( File "/ragflow/.venv/lib/python3.10/site-packages/valkey/retry.py", line 62, in call_with_retry return do() File "/ragflow/.venv/lib/python3.10/site-packages/valkey/connection.py", line 303, in lambda: self._connect(), lambda error: self.disconnect(error) File "/ragflow/.venv/lib/python3.10/site-packages/valkey/connection.py", line 696, in _connect for res in socket.getaddrinfo( File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known . . . 2025-02-16 19:18:30,841 INFO 23 Use Elasticsearch http://es01:9200 as the doc engine. 2025-02-16 19:18:30,897 INFO 23 GET http://es01:9200/ [status:200 duration:0.055s] 2025-02-16 19:18:30,899 INFO 23 HEAD http://es01:9200/ [status:200 duration:0.001s] 2025-02-16 19:18:30,899 INFO 23 Elasticsearch http://es01:9200 is healthy. 2025-02-16 19:18:30,902 WARNING 23 Load term.freq FAIL! 2025-02-16 19:18:30,905 WARNING 23 Realtime synonym is disabled, since no redis connection. 2025-02-16 19:18:30,909 WARNING 23 Load term.freq FAIL! 2025-02-16 19:18:30,911 WARNING 23 Realtime synonym is disabled, since no redis connection. 2025-02-16 19:18:30,911 INFO 23 MAX_CONTENT_LENGTH: 134217728 2025-02-16 19:18:30,911 INFO 23 SERVER_QUEUE_MAX_LEN: 1024 2025-02-16 19:18:30,911 INFO 23 SERVER_QUEUE_RETENTION: 3600 2025-02-16 19:18:30,911 INFO 23 MAX_FILE_COUNT_PER_USER: 0 2025-02-16 19:18:33,836 INFO 23 init web data success:2.5364346504211426 2025-02-16 19:18:33,837 INFO 23 RAGFlow HTTP server start... 2025-02-16 19:18:33,838 INFO 23 WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:9380
  • Running on http://172.18.0.6:9380 2025-02-16 19:18:33,838 INFO 23 Press CTRL+C to quit 2025-02-16 19:18:35,303 INFO 24

/_ /_ / / / / _____ _______ / / _____ / / / __ `/ / /// / __/ | |// _ / / / / / __/ __ / / / / / // ( ) ,< / /> </ / // // / // // / / // _,///|| /_____//||_/_/_,/_/___//

2025-02-16 19:18:35,303 INFO 24 TaskExecutor: RAGFlow version: v0.15.1 slim 2025-02-16 19:18:35,304 INFO 24 Use Elasticsearch http://es01:9200 as the doc engine. 2025-02-16 19:18:35,307 INFO 24 GET http://es01:9200/ [status:200 duration:0.003s] 2025-02-16 19:18:35,309 INFO 24 HEAD http://es01:9200/ [status:200 duration:0.001s] 2025-02-16 19:18:35,309 INFO 24 Elasticsearch http://es01:9200 is healthy. 2025-02-16 19:18:35,311 WARNING 24 Load term.freq FAIL! 2025-02-16 19:18:35,314 WARNING 24 Realtime synonym is disabled, since no redis connection. 2025-02-16 19:18:35,317 WARNING 24 Load term.freq FAIL! 2025-02-16 19:18:35,319 WARNING 24 Realtime synonym is disabled, since no redis connection. 2025-02-16 19:18:35,319 INFO 24 MAX_CONTENT_LENGTH: 134217728 2025-02-16 19:18:35,320 INFO 24 SERVER_QUEUE_MAX_LEN: 1024 2025-02-16 19:18:35,320 INFO 24 SERVER_QUEUE_RETENTION: 3600 2025-02-16 19:18:35,320 INFO 24 MAX_FILE_COUNT_PER_USER: 0 2025-02-16 19:18:35,321 WARNING 24 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-16 19:18:35,321 INFO 24 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-16T19:18:35.321+08:00", "boot_at": "2025-02-16T19:18:35.303+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-16 19:19:05,352 WARNING 24 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-16 19:19:05,353 INFO 24 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-16T19:19:05.352+08:00", "boot_at": "2025-02-16T19:18:35.303+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null} 2025-02-16 19:19:35,383 WARNING 24 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-02-16 19:19:35,394 INFO 24 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-02-16T19:19:35.383+08:00", "boot_at": "2025-02-16T19:18:35.303+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": null}

connect redis by command, it seem successfully check no rag_flow_svr_queue key docker exec -it ba redis-cli -a infini_rag_flow Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe. 127.0.0.1:6379> EXISTS rag_flow_svr_queue (integer) 0

It seems python problem in ragflow image, which make connecting failure to radis

micjac99 avatar Feb 16 '25 12:02 micjac99

no such key is a warning log which can be ignored. Check the status of redis.

Image

KevinHuSh avatar Feb 17 '25 03:02 KevinHuSh

no such key is a warning log which can be ignored. Check the status of redis.

Image

First of all, thank you very much for your response. Today, I successfully resolved the issue of being unable to add some model providers in the v0.16.0 slim version. I have now successfully added the models from OpenAI and SILICONFLOW, and have verified that both the knowledge base document parsing and chat functions are working normally.

My solution was to check the logs for the error message “RedisDB.queue_info rag_flow_svr_queue got exception: no such key” after starting the ragflow-server. If this error appears, please restart the ragflow-es-01, ragflow-mysql, ragflow-minio, and ragflow-redis containers, and repeat the process until the “no such key” error no longer appears in the ragflow-server logs. At that point, the system will function normally and you will be able to successfully add the model providers. (Do not restart the ragflow-server container along with them.)

I have attempted to deploy the ragflow project over ten times (because you have done such an outstanding job and I really want to use it), but each time I start it up, I encounter the “no such key” error. Upon inspection, I confirmed that the Redis status is normal: whether in the ragflow system monitoring or when connecting to ragflow-redis via a third-party Redis client, the connection is successful and keys can be added and deleted.

However, once I enter the web system, some model providers still cannot be added. I suspect that the error “RedisDB.queue_info rag_flow_svr_queue got exception: no such key” in the logs might be affecting the addition of these model providers.

After a normal startup, the ragflow-server log no longer outputs "no such key." The log is as

Image

DolphinSh avatar Feb 17 '25 10:02 DolphinSh

Finally, it was found that three containers were not running. After manually starting the containers, the webpage of ragflow could be used normally. However, when checking the logs using the command line, there were still warning messages.

TomTigerDong avatar Feb 20 '25 00:02 TomTigerDong

Warning message could be ignored.

KevinHuSh avatar Feb 20 '25 06:02 KevinHuSh

no such key is a warning log which can be ignored. Check the status of redis. Image

First of all, thank you very much for your response. Today, I successfully resolved the issue of being unable to add some model providers in the v0.16.0 slim version. I have now successfully added the models from OpenAI and SILICONFLOW, and have verified that both the knowledge base document parsing and chat functions are working normally.

My solution was to check the logs for the error message “RedisDB.queue_info rag_flow_svr_queue got exception: no such key” after starting the ragflow-server. If this error appears, please restart the ragflow-es-01, ragflow-mysql, ragflow-minio, and ragflow-redis containers, and repeat the process until the “no such key” error no longer appears in the ragflow-server logs. At that point, the system will function normally and you will be able to successfully add the model providers. (Do not restart the ragflow-server container along with them.)

I have attempted to deploy the ragflow project over ten times (because you have done such an outstanding job and I really want to use it), but each time I start it up, I encounter the “no such key” error. Upon inspection, I confirmed that the Redis status is normal: whether in the ragflow system monitoring or when connecting to ragflow-redis via a third-party Redis client, the connection is successful and keys can be added and deleted.

However, once I enter the web system, some model providers still cannot be added. I suspect that the error “RedisDB.queue_info rag_flow_svr_queue got exception: no such key” in the logs might be affecting the addition of these model providers.

After a normal startup, the ragflow-server log no longer outputs "no such key." The log is as

Image

Sorry, I can't achieve by following your steps.

baliyeyu020 avatar Feb 28 '25 06:02 baliyeyu020

same issue

yssAI avatar Mar 18 '25 09:03 yssAI

same issue here.

colin4k avatar May 20 '25 04:05 colin4k

I found the solution: docker exec -it ragflow-redis bash redis-cli -h redis -p 6379 -a infini_rag_flow RPUSH rag_flow_svr_queue ""

colin4k avatar May 20 '25 04:05 colin4k