infiniflow / ragflow

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

[Bug]: Error 111 connecting to redis #1776

Closed JayCroghan closed 1 month ago

JayCroghan commented 1 month ago

Is there an existing issue for the same bug?

Branch name

main

Commit ID

b9a50ef - but I have tried v0.8.0 same issue

Other environment information

Ubuntu 22.41

Actual behavior

I clone the repo.

I edit the files docker/.env and I change: REDIS_PORT=6381

I run `sudo ufw allow 6381'

$ cd ragflow/docker
$ chmod +x ./entrypoint.sh
$ docker compose up -d

I edit docker-compose.yml to change to non standard ports:

ports:
  - ${SVR_HTTP_PORT}:9380
  - 11021:80
  - 11022:443

They are the only changes.

This is the logs I get and nothing works:

[WARNING] [2024-08-01 10:58:40,516] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] [2024-08-01 10:58:40,518] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] Load term.freq FAIL!

    ____                 ______ __
   / __ \ ____ _ ____ _ / ____// /____  _      __
  / /_/ // __ `// __ `// /_   / // __ \| | /| / /
 / _, _// /_/ // /_/ // __/  / // /_/ /| |/ |/ /
/_/ |_| \__,_/ \__, //_/    /_/ \____/ |__/|__/
              /____/

[ERROR] [2024-08-01 10:58:53,617] [http_request._handle_response] [line:172]: Request: https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation failed, status: 401, message: Invalid API-key provided.
[INFO] [2024-08-01 10:58:56,460] [_internal._log] [line:96]: 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.25.0.6:9380
[INFO] [2024-08-01 10:58:56,460] [_internal._log] [line:96]: Press CTRL+C to quit
[WARNING] [2024-08-01 10:59:04,444] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:05,449] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:06,453] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:07,457] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:08,461] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:09,465] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:10,469] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:11,472] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:12,479] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:13,483] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.
[WARNING] [2024-08-01 10:59:14,487] [redis_conn.queue_consumer] [line:141]: [EXCEPTION]consumerrag_flow_svr_queue||Error 111 connecting to redis:6381. Connection refused.

Expected behavior

I expect it to run fine on non-standard ports.

Steps to reproduce

See Actual behavior

Additional information

I am not changing anything else.

KevinHuSh commented 1 month ago

Please check conf/service_conf.yml

kevinbaby0222 commented 1 month ago

Same issue. I changed redis port from 6379 -> 6381 in env and docker-compose.yml 2 files. Keep receving warning log image Here is my docker ps shows

JayCroghan commented 1 month ago

Yes I changed the ports there too at the very start, I knew it couldn’t only be changed in one place.

On Fri 2 Aug 2024 at 10:09, Kevin Hu @.***> wrote:

Please check conf/service_conf.yml

— Reply to this email directly, view it on GitHub https://github.com/infiniflow/ragflow/issues/1776#issuecomment-2264369433, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI55TC2LSLYAVAREQOJUTDZPLS57AVCNFSM6AAAAABL2KI4FKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRUGM3DSNBTGM . You are receiving this because you authored the thread.Message ID: @.***>

JayCroghan commented 1 month ago

docker-compose.yml

include:
  - path: ./docker-compose-base.yml
    env_file: ./.env

services:
  ragflow:
    depends_on:
      mysql:
        condition: service_healthy
      es01:
        condition: service_healthy
    image: infiniflow/ragflow:${RAGFLOW_VERSION}
    container_name: ragflow-server
    ports:
      - ${SVR_HTTP_PORT}:9380
      - 11021:80
      - 11022:443
    volumes:
      - ./service_conf.yaml:/ragflow/conf/service_conf.yaml
      - ./ragflow-logs:/ragflow/logs
      - ./nginx/ragflow.conf:/etc/nginx/conf.d/ragflow.conf
      - ./nginx/proxy.conf:/etc/nginx/proxy.conf
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
    environment:
      - TZ=${TIMEZONE}
      - HF_ENDPOINT=https://huggingface.co
      - MACOS=${MACOS}
    networks:
      - ragflow
    restart: always

.env

STACK_VERSION=8.11.3

# Port to expose Elasticsearch HTTP API to the host
ES_PORT=1200

# Set the Elasticsearch password
ELASTIC_PASSWORD=infini_rag_flow

# Port to expose Kibana to the host
KIBANA_PORT=6601
KIBANA_USER=rag_flow
KIBANA_PASSWORD=infini_rag_flow

# Increase or decrease based on the available host memory (in bytes)

MEM_LIMIT=8073741824

MYSQL_PASSWORD=infini_rag_flow
MYSQL_PORT=5455

# Port to expose minio to the host
MINIO_CONSOLE_PORT=9001
MINIO_PORT=9000

MINIO_USER=rag_flow
MINIO_PASSWORD=infini_rag_flow

REDIS_PORT=6381
REDIS_PASSWORD=infini_rag_flow

SVR_HTTP_PORT=9380

RAGFLOW_VERSION=dev

TIMEZONE='Asia/Shanghai'

######## OS setup for ES ###########
# sysctl vm.max_map_count
# sudo sysctl -w vm.max_map_count=262144
# However, this change is not persistent and will be reset after a system reboot.
# To make the change permanent, you need to update the /etc/sysctl.conf file.
# Add or update the following line in the file:
# vm.max_map_count=262144

service.conf

  host: 0.0.0.0
  http_port: 9380
mysql:
  name: 'rag_flow'
  user: 'root'
  password: 'infini_rag_flow'
  host: 'mysql'
  port: 3306
  max_connections: 100
  stale_timeout: 30
minio:
  user: 'rag_flow'
  password: 'infini_rag_flow'
  host: 'minio:9000'
es:
  hosts: 'http://es01:9200'
  username: 'elastic'
  password: 'infini_rag_flow'
redis:
  db: 1
  password: 'infini_rag_flow'
  host: 'redis:6381'
user_default_llm:
  factory: 'Tongyi-Qianwen'
  api_key: 'sk-xxxxxxxxxxxxx'
  base_url: ''
oauth:
  github:
    client_id: xxxxxxxxxxxxxxxxxxxxxxxxx
    secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    url: https://github.com/login/oauth/access_token
authentication:
  client:
    switch: false
    http_app_key:
    http_secret_key:
  site:
    switch: false
permission:
  switch: false
  component: false
  dataset: false

According to the documentation I should be good to go.

docker ps shows the below which means the change to the port has taken effect/

154d45ab40fa redis:7.2.4 "docker-entrypoint.s…" 39 seconds ago Up 37 seconds 0.0.0.0:6381->6379/tcp, :::6381->6379/tcp ragflow-redis

JayCroghan commented 1 month ago

The logs are also full of this on repeat even without doing anything:

[WARNING] [2024-08-02 06:17:16,056] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] Load term.freq FAIL!
Traceback (most recent call last):
  File "/ragflow/api/ragflow_server.py", line 26, in <module>
    from api.apps import app
  File "/ragflow/api/apps/__init__.py", line 97, in <module>
    client_urls_prefix = [
  File "/ragflow/api/apps/__init__.py", line 98, in <listcomp>
    register_page(path)
  File "/ragflow/api/apps/__init__.py", line 84, in register_page
    spec.loader.exec_module(page)
  File "/ragflow/api/apps/user_app.py", line 25, in <module>
    from api.db.services.llm_service import TenantLLMService, LLMService
  File "/ragflow/api/db/services/llm_service.py", line 18, in <module>
    from rag.llm import EmbeddingModel, CvModel, ChatModel, RerankModel, Seq2txtModel
  File "/ragflow/rag/llm/__init__.py", line 17, in <module>
    from .chat_model import *
  File "/ragflow/rag/llm/chat_model.py", line 31, in <module>
    from rag.svr.jina_server import Prompt,Generation
  File "/ragflow/rag/svr/jina_server.py", line 1, in <module>
    from jina import Deployment
ModuleNotFoundError: No module named 'jina'
[WARNING] Load term.freq FAIL!
kevinbaby0222 commented 1 month ago

Hi, there My solution is to not use .env and service.conf, directly change the value in docker-compose-base.yml to 6381. image

JayCroghan commented 1 month ago

I did that, I still get these errors constantly.

ModuleNotFoundError: No module named 'jina'
[WARNING] [2024-08-02 08:20:08,416] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] Load term.freq FAIL!
Traceback (most recent call last):
  File "/ragflow/api/ragflow_server.py", line 26, in <module>
    from api.apps import app
  File "/ragflow/api/apps/__init__.py", line 97, in <module>
    client_urls_prefix = [
  File "/ragflow/api/apps/__init__.py", line 98, in <listcomp>
    register_page(path)
  File "/ragflow/api/apps/__init__.py", line 84, in register_page
    spec.loader.exec_module(page)
  File "/ragflow/api/apps/user_app.py", line 25, in <module>
    from api.db.services.llm_service import TenantLLMService, LLMService
  File "/ragflow/api/db/services/llm_service.py", line 18, in <module>
    from rag.llm import EmbeddingModel, CvModel, ChatModel, RerankModel, Seq2txtModel
  File "/ragflow/rag/llm/__init__.py", line 17, in <module>
    from .chat_model import *
  File "/ragflow/rag/llm/chat_model.py", line 31, in <module>
    from rag.svr.jina_server import Prompt,Generation
  File "/ragflow/rag/svr/jina_server.py", line 1, in <module>
    from jina import Deployment
ModuleNotFoundError: No module named 'jina'
underlines commented 1 month ago

I have the exact same problem just running docker compose up -d without any config changes. The default redis port in all config files conf/service_conf.yaml, docker/.env, docker/docker-compose.yml, docker/dockr-compose-base.yml, docker/service_conf.yaml is 6379 which doesn't work, even when not changing it:

docker logs -f ragflow-server
[WARNING] [2024-08-01 23:06:20,843] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] [2024-08-01 23:06:20,847] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] Load term.freq FAIL!
Traceback (most recent call last):
  File "/ragflow/api/ragflow_server.py", line 26, in <module>
    from api.apps import app
  File "/ragflow/api/apps/__init__.py", line 97, in <module>
    client_urls_prefix = [
  File "/ragflow/api/apps/__init__.py", line 98, in <listcomp>
    register_page(path)
  File "/ragflow/api/apps/__init__.py", line 84, in register_page
    spec.loader.exec_module(page)
  File "/ragflow/api/apps/canvas_app.py", line 26, in <module>
    from graph.canvas import Canvas
  File "/ragflow/graph/canvas.py", line 25, in <module>
    from graph.component import component_class
  File "/ragflow/graph/component/__init__.py", line 17, in <module>
    from .google import Google, GoogleParam
  File "/ragflow/graph/component/google.py", line 17, in <module>
    from serpapi import GoogleSearch
ModuleNotFoundError: No module named 'serpapi'
JayCroghan commented 1 month ago

The reason I changed mine is redis is already running on my machine on that port but even when I disabled it I got the same error so tried changing the port which also did not work.

You are getting a ModuleNotFoundError except the module is different to the one mine says is missing.

KevinHuSh commented 1 month ago

I have the exact same problem just running docker compose up -d without any config changes. The default redis port in all config files conf/service_conf.yaml, docker/.env, docker/docker-compose.yml, docker/dockr-compose-base.yml, docker/service_conf.yaml is 6379 which doesn't work, even when not changing it:

docker logs -f ragflow-server
[WARNING] [2024-08-01 23:06:20,843] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] [2024-08-01 23:06:20,847] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] Load term.freq FAIL!
Traceback (most recent call last):
  File "/ragflow/api/ragflow_server.py", line 26, in <module>
    from api.apps import app
  File "/ragflow/api/apps/__init__.py", line 97, in <module>
    client_urls_prefix = [
  File "/ragflow/api/apps/__init__.py", line 98, in <listcomp>
    register_page(path)
  File "/ragflow/api/apps/__init__.py", line 84, in register_page
    spec.loader.exec_module(page)
  File "/ragflow/api/apps/canvas_app.py", line 26, in <module>
    from graph.canvas import Canvas
  File "/ragflow/graph/canvas.py", line 25, in <module>
    from graph.component import component_class
  File "/ragflow/graph/component/__init__.py", line 17, in <module>
    from .google import Google, GoogleParam
  File "/ragflow/graph/component/google.py", line 17, in <module>
    from serpapi import GoogleSearch
ModuleNotFoundError: No module named 'serpapi'

pip install google_search_results==2.4.2

JayCroghan commented 1 month ago

This is not fixed. I just got the latest version and I have the same errors in the logs:

[WARNING] Load term.freq FAIL!
Traceback (most recent call last):
  File "/ragflow/api/ragflow_server.py", line 26, in <module>
    from api.apps import app
  File "/ragflow/api/apps/__init__.py", line 97, in <module>
    client_urls_prefix = [
  File "/ragflow/api/apps/__init__.py", line 98, in <listcomp>
    register_page(path)
  File "/ragflow/api/apps/__init__.py", line 84, in register_page
    spec.loader.exec_module(page)
  File "/ragflow/api/apps/user_app.py", line 25, in <module>
    from api.db.services.llm_service import TenantLLMService, LLMService
  File "/ragflow/api/db/services/llm_service.py", line 18, in <module>
    from rag.llm import EmbeddingModel, CvModel, ChatModel, RerankModel, Seq2txtModel
  File "/ragflow/rag/llm/__init__.py", line 17, in <module>
    from .chat_model import *
  File "/ragflow/rag/llm/chat_model.py", line 31, in <module>
    from rag.svr.jina_server import Prompt,Generation
  File "/ragflow/rag/svr/jina_server.py", line 1, in <module>
    from jina import Deployment
ModuleNotFoundError: No module named 'jina'
[WARNING] [2024-08-09 15:23:30,147] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] [2024-08-09 15:23:30,331] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] Load term.freq FAIL!
Traceback (most recent call last):
  File "/ragflow/api/ragflow_server.py", line 26, in <module>
    from api.apps import app
  File "/ragflow/api/apps/__init__.py", line 97, in <module>
    client_urls_prefix = [
  File "/ragflow/api/apps/__init__.py", line 98, in <listcomp>
    register_page(path)
  File "/ragflow/api/apps/__init__.py", line 84, in register_page
    spec.loader.exec_module(page)
  File "/ragflow/api/apps/user_app.py", line 25, in <module>
    from api.db.services.llm_service import TenantLLMService, LLMService
  File "/ragflow/api/db/services/llm_service.py", line 18, in <module>
    from rag.llm import EmbeddingModel, CvModel, ChatModel, RerankModel, Seq2txtModel
  File "/ragflow/rag/llm/__init__.py", line 17, in <module>
    from .chat_model import *
  File "/ragflow/rag/llm/chat_model.py", line 31, in <module>
    from rag.svr.jina_server import Prompt,Generation
  File "/ragflow/rag/svr/jina_server.py", line 1, in <module>
    from jina import Deployment
ModuleNotFoundError: No module named 'jina'
[WARNING] [2024-08-09 15:23:39,686] [synonym.__init__] [line:40]: Realtime synonym is disabled, since no redis connection.
[WARNING] Load term.freq FAIL!
Traceback (most recent call last):
  File "/ragflow/api/ragflow_server.py", line 26, in <module>
    from api.apps import app
  File "/ragflow/api/apps/__init__.py", line 97, in <module>
    client_urls_prefix = [
  File "/ragflow/api/apps/__init__.py", line 98, in <listcomp>
    register_page(path)
  File "/ragflow/api/apps/__init__.py", line 84, in register_page
    spec.loader.exec_module(page)
  File "/ragflow/api/apps/user_app.py", line 25, in <module>
    from api.db.services.llm_service import TenantLLMService, LLMService
  File "/ragflow/api/db/services/llm_service.py", line 18, in <module>
    from rag.llm import EmbeddingModel, CvModel, ChatModel, RerankModel, Seq2txtModel
  File "/ragflow/rag/llm/__init__.py", line 17, in <module>
    from .chat_model import *
  File "/ragflow/rag/llm/chat_model.py", line 31, in <module>
    from rag.svr.jina_server import Prompt,Generation
  File "/ragflow/rag/svr/jina_server.py", line 1, in <module>
    from jina import Deployment
ModuleNotFoundError: No module named 'jina'