RAGflow启动之后,报错:WARNING:root:RedisDB.queue_info rag_flow_svr_queue got exception: no such key

安装RAGflowhttps://github.com/infiniflow/ragflow/blob/main/README_zh.md

安装完毕之后:

root@flexusx-8b5d:/ragflow/docker# docker-compose up -d
WARN[0000] The "HF_ENDPOINT" variable is not set. Defaulting to a blank string. 
WARN[0000] The "MACOS" variable is not set. Defaulting to a blank string. 
[+] Running 6/6
 ✔ Network docker_ragflow    Created                                                                               0.1s 
 ✔ Container ragflow-mysql   Healthy                                                                              11.1s 
 ✔ Container ragflow-redis   Started                                                                               0.6s 
 ✔ Container ragflow-es-01   Started                                                                               0.6s 
 ✔ Container ragflow-minio   Started                                                                               0.7s 
 ✔ Container ragflow-server  Started                                                                              11.4s 
root@flexusx-8b5d:/ragflow/docker# docker logs -f ragflow-server
2025-03-05 19:59:38,814 INFO     15 ragflow_server log path: /ragflow/logs/ragflow_server.log, log levels: {'peewee': 'WARNING', 'pdfminer': 'WARNING', 'root': 'INFO'}
2025-03-05 19:59:49,047 INFO     15 init database on cluster mode successfully
2025-03-05 20:00:05,108 INFO     15 
        ____   ___    ______ ______ __               
       / __ \ /   |  / ____// ____// /____  _      __
      / /_/ // /| | / / __ / /_   / // __ \| | /| / /
     / _, _// ___ |/ /_/ // __/  / // /_/ /| |/ |/ / 
    /_/ |_|/_/  |_|\____//_/    /_/ \____/ |__/|__/                             

    
2025-03-05 20:00:05,108 INFO     15 RAGFlow version: v0.17.0 slim
2025-03-05 20:00:05,108 INFO     15 project base: /ragflow
2025-03-05 20:00:05,109 INFO     15 Current configs, from /ragflow/conf/service_conf.yaml:
        ragflow: {'host': '0.0.0.0', 'http_port': 9380}
        mysql: {'name': 'rag_flow', 'user': 'root', 'password': '********', 'host': 'mysql', 'port': 3306, 'max_connections': 100, 'stale_timeout': 30}
        minio: {'user': 'rag_flow', 'password': '********', 'host': 'minio:9000'}
        es: {'hosts': 'http://es01:9200', 'username': 'elastic', 'password': '********'}
        infinity: {'uri': 'infinity:23817', 'db_name': 'default_db'}
        redis: {'db': 1, 'password': '********', 'host': 'redis:6379'}
2025-03-05 20:00:05,109 INFO     15 Use Elasticsearch http://es01:9200 as the doc engine.
2025-03-05 20:00:05,271 INFO     15 GET http://es01:9200/ [status:200 duration:0.161s]
2025-03-05 20:00:05,278 INFO     15 HEAD http://es01:9200/ [status:200 duration:0.006s]
2025-03-05 20:00:05,278 INFO     15 Elasticsearch http://es01:9200 is healthy.
2025-03-05 20:00:05,285 WARNING  15 Load term.freq FAIL!
2025-03-05 20:00:05,290 WARNING  15 Realtime synonym is disabled, since no redis connection.
2025-03-05 20:00:05,296 WARNING  15 Load term.freq FAIL!
2025-03-05 20:00:05,301 WARNING  15 Realtime synonym is disabled, since no redis connection.
2025-03-05 20:00:05,301 INFO     15 MAX_CONTENT_LENGTH: 134217728
2025-03-05 20:00:05,301 INFO     15 SERVER_QUEUE_MAX_LEN: 1024
2025-03-05 20:00:05,301 INFO     15 SERVER_QUEUE_RETENTION: 3600
2025-03-05 20:00:05,301 INFO     15 MAX_FILE_COUNT_PER_USER: 0
2025-03-05 20:00:07,515 INFO     15 init web data success:2.122746706008911
2025-03-05 20:00:07,517 INFO     15 RAGFlow HTTP server start...
2025-03-05 20:00:07,519 INFO     15 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.19.0.6:9380
2025-03-05 20:00:07,520 INFO     15 Press CTRL+C to quit
WARNING:root:Load term.freq FAIL!
WARNING:root:Realtime synonym is disabled, since no redis connection.
WARNING:root:Load term.freq FAIL!
WARNING:root:Realtime synonym is disabled, since no redis connection.
WARNING:root:RedisDB.queue_info rag_flow_svr_queue got exception: no such key
WARNING:root:RedisDB.queue_info rag_flow_svr_queue got exception: no such key
WARNING:root:RedisDB.queue_info rag_flow_svr_queue got exception: no such key

 

翻译:

警告:root:加载 term.freq 失败!
警告:root:由于没有 Redis 连接,实时同义词已禁用。
警告:root:加载 term.freq 失败!
警告:root:由于没有 Redis 连接,实时同义词已禁用。
警告:root:RedisDB.queue_info rag_flow_svr_queue 出现异常:没有这样的键。
警告:root:RedisDB.queue_info rag_flow_svr_queue 出现异常:没有这样的键。
警告:root:RedisDB.queue_info rag_flow_svr_queue 出现异常:没有这样的键。

异常原因:

Redis客户端操作某个键(key)时,如果该键不存在,就会抛出“ERR no such key”异常。说明在Redis中没有找到对应的键。

Redis里的两个key队列信息,分别是task_consumer_0和rag_flow_svr_queue,这两个是队列信息,第一个待处理文件,第二个是任务

但是,查看系统,Redis正常

因为Redis运行正常,可以忽略。我尝试手动加一个rag_flow_svr_queue,去掉告警,但是不成功。

Redis运行在Docker容器中,不能直接在Linux命令中操作Redis,而需要通过Docker命令进入容器内部进行操作。

1. 查找Redis容器名称或ID

首先,你需要找到运行Redis的Docker容器的名称或ID。可以使用以下命令:

docker ps

这将列出所有正在运行的容器。找到Redis容器的名称或ID,例如redis-containerabc12345

2. 进入Redis容器

使用docker exec命令进入Redis容器的命令行界面:

docker exec -it redis-container bash

redis-container替换为你的Redis容器名称或ID。

3. 操作Redis

进入容器后,你可以使用Redis的命令行工具redis-cli来操作Redis。例如,检查是否存在rag_flow_svr_queue键:

redis-cli -h redis -p 6379 -a ******** EXISTS rag_flow_svr_queue

替换********为实际的Redis密码。获取密码的操作,进入.env文件:

root@flexusx-8b5d:/ragflow/docker# vim .env

4. 初始化队列

如果键不存在,可能需要初始化队列。例如,可以使用以下命令创建一个空队列:

redis-cli -h redis -p 6379 -a ******** RPUSH rag_flow_svr_queue ""

5. 退出容器

完成操作后,退出容器:

exit

Redis 服务状态

  • Redis 服务正在运行:你能够成功连接到 Redis 服务器,说明 Redis 服务已经在运行。

  • 键不存在EXISTS rag_flow_svr_queue 命令返回 0,表示键 rag_flow_svr_queue 在 Redis 数据库中不存在。

  • 添加键:返回1,说明已经添加成功。

2025-05-14 11:46:44,531 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:46:44,534 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:46:44.530+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}} 2025-05-14 11:47:14,535 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:47:14,537 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:47:14.535+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}} 2025-05-14 11:47:44,538 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:47:44,541 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:47:44.538+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}} 2025-05-14 11:48:14,542 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:48:14,544 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:48:14.542+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}} 2025-05-14 11:48:44,545 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:48:44,547 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:48:44.545+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}} 2025-05-14 11:49:14,549 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:49:14,552 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:49:14.549+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}} 2025-05-14 11:49:44,554 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:49:44,556 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:49:44.554+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}} 2025-05-14 11:50:14,561 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:50:14,564 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:50:14.561+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}} 2025-05-14 11:50:44,567 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:50:44,569 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:50:44.567+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}} 2025-05-14 11:51:14,570 WARNING 23 RedisDB.queue_info rag_flow_svr_queue got exception: no such key 2025-05-14 11:51:14,574 INFO 23 task_executor_52396a01146b_0 reported heartbeat: {"name": "task_executor_52396a01146b_0", "now": "2025-05-14T11:51:14.570+08:00", "boot_at": "2025-05-14T10:12:43.033+08:00", "pending": 0, "lag": 0, "done": 0, "failed": 0, "current": {}}
05-15
ragflow解析文件出现valkey.exceptions.ResponseError: Command # 1 (XADD rag_flow_svr_queue * message {"id": "b17f361e40e311f0a29b0242ac120006", "doc_id": "0ff6b58e40e211f0bf560242ac120006", "progress": 0.0, "from_page": 0, "to_page": 100000000, "digest": "6e3ae32dc9b8a12f", "create_time": 1749000712871, "create_date": "2025-06-04 09:31:52", "update_time": 1749000712871, "update_date": "2025-06-04 09:31:52"}) of pipeline caused error: WRONGTYPE Operation against a key holding the wrong kind of value 2025-06-04 09:31:52,909 ERROR 16 RedisDB.queue_product rag_flow_svr_queue got exception: Command # 1 (XADD rag_flow_svr_queue * message {"id": "b17f361e40e311f0a29b0242ac120006", "doc_id": "0ff6b58e40e211f0bf560242ac120006", "progress": 0.0, "from_page": 0, "to_page": 100000000, "digest": "6e3ae32dc9b8a12f", "create_time": 1749000712871, "create_date": "2025-06-04 09:31:52", "update_time": 1749000712871, "update_date": "2025-06-04 09:31:52"}) of pipeline caused error: WRONGTYPE Operation against a key holding the wrong kind of value Traceback (most recent call last): File "/ragflow/rag/utils/redis_conn.py", line 203, in queue_product pipeline.execute() File "/ragflow/.venv/lib/python3.10/site-packages/valkey/client.py", line 1547, in execute return conn.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/client.py", line 1548, in <lambda> lambda: execute(conn, stack, raise_on_error), File "/ragflow/.venv/lib/python3.10/site-packages/valkey/client.py", line 1435, in _execute_transaction self.raise_first_error(commands, response) File "/ragflow/.venv/lib/python3.10/site-packages/valkey/client.py", line 1468, in raise_first_error raise r valkey.exceptions.ResponseError: Command # 1 (XADD rag_flow_svr_queue * message {"id": "b17f361e40e311f0a29b0242ac120006", "doc_id": "0ff6b58e40e211f0bf560242ac120006", "progress": 0.0, "from_page": 0, "to_page": 100000000, "digest": "6e3ae32dc9b8a12f", "create_time": 1749000712871, "create_date": "2025-06-04 09:31:52", "update_time": 1749000712871, "update_date": "2025-06-04 09:31:52"}) of pipeline caused error: WRONGTYPE Operation against a key holding the wrong kind of value 2025-06-04 09:31:52,910 ERROR 16 RedisDB.queue_product rag_flow_svr_queue got exception: Command # 1 (XADD rag_flow_svr_queue * message {"id": "b17f361e40e311f0a29b0242ac120006", "doc_id": "0ff6b58e40e211f0bf560242ac120006", "progress": 0.0, "from_page": 0, "to_page": 100000000, "digest": "6e3ae32dc9b8a12f", "create_time": 1749000712871, "create_date": "2025-06-04 09:31:52", "update_time": 1749000712871, "update_date": "2025-06-04 09:31:52"}) of pipeline caused error: WRONGTYPE Operation against a key holding the wrong kind of value Traceback (most recent call last): File "/ragflow/rag/utils/redis_conn.py", line 203, in queue_product pipeline.execute() File "/ragflow/.venv/lib/python3.10/site-packages/valkey/client.py", line 1547, in execute return conn.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/client.py", line 1548, in <lambda> lambda: execute(conn, stack, raise_on_error), File "/ragflow/.venv/lib/python3.10/site-packages/valkey/client.py", line 1435, in _execute_transaction self.raise_first_error(commands, response) File "/ragflow/.venv/lib/python3.10/site-packages/valkey/client.py", line 1468, in raise_first_error raise r valkey.exceptions.ResponseError: Command # 1 (XADD rag_flow_svr_queue * message {"id": "b17f361e40e311f0a29b0242ac120006", "doc_id": "0ff6b58e40e211f0bf560242ac120006", "progress": 0.0, "from_page": 0, "to_page": 100000000, "digest": "6e3ae32dc9b8a12f", "create_time": 1749000712871, "create_date": "2025-06-04 09:31:52", "update_time": 1749000712871, "update_date": "2025-06-04 09:31:52"}) of pipeline caused error: WRONGTYPE Operation against a key holding the wrong kind of value 2025-06-04 09:31:52,910 ERROR 16 Can't access Redis. Please check the Redis' status. Traceback (most recent call last): File "/ragflow/api/apps/document_app.py", line 383, in run queue_tasks(doc, bucket, name) File "<@beartype(api.db.services.task_service.queue_tasks) at 0x71bbe526ab90>", line 69, in queue_tasks File "/ragflow/api/db/services/task_service.py", line 276, in queue_tasks assert REDIS_CONN.queue_product( AssertionError: Can't access Redis. Please check the Redis' status. 2025-06-04 09:31:52,912 INFO 16 172.18.0.6 - - [04/Jun/2025 09:31:52] "POST /v1/document/run HTTP/1.1" 200 - 错误
06-05
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值