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.78k stars 2.23k forks source link

[Bug]: AttributeError: 'ESConnection' object has no attribute 'es' #2611

Closed ly0303521 closed 1 month ago

ly0303521 commented 1 month ago

Is there an existing issue for the same bug?

Branch name

main

Commit ID

832c90ac3e319e5f615dbbd1b52545ad3258b90f

Other environment information

ubuntu20.04

Actual behavior

sudo bash ./entrypoint.sh

Expected behavior

No response

Steps to reproduce

Follow the steps of "Launch service from source for development", after "sudo bash ./entrypoint.sh", the error comes

Additional information

No response

ly0303521 commented 1 month ago

(ragflow) ly@BOE:~/SPACE_SDD/Projects/ragflow$ sudo bash ./entrypoint.sh Traceback (most recent call last): File "/home/ly/SPACE_SDD/Projects/ragflow/api/ragflow_server.py", line 26, in Traceback (most recent call last): File "/home/ly/SPACE_SDD/Projects/ragflow/rag/svr/task_executor.py", line 29, in from api.apps import app File "/home/ly/SPACE_SDD/Projects/ragflow/api/apps/init.py", line 26, in from api.db.db_models import close_connection from api.db.services.file2document_service import File2DocumentService File "/home/ly/SPACE_SDD/Projects/ragflow/api/db/db_models.py", line 33, in File "/home/ly/SPACE_SDD/Projects/ragflow/api/db/services/init.py", line 18, in from api.settings import DATABASE, stat_logger, SECRET_KEY, DATABASE_TYPE File "/home/ly/SPACE_SDD/Projects/ragflow/api/settings.py", line 35, in from .user_service import UserService File "/home/ly/SPACE_SDD/Projects/ragflow/api/db/services/user_service.py", line 22, in from rag.utils.es_conn import ELASTICSEARCH from api.db.db_models import DB, UserTenant File "/home/ly/SPACE_SDD/Projects/ragflow/rag/utils/es_conn.py", line 462, in File "/home/ly/SPACE_SDD/Projects/ragflow/api/db/db_models.py", line 33, in from api.settings import DATABASE, stat_logger, SECRET_KEY, DATABASE_TYPE File "/home/ly/SPACE_SDD/Projects/ragflow/api/settings.py", line 35, in from rag.utils.es_conn import ELASTICSEARCH ELASTICSEARCH = ESConnection() File "/home/ly/SPACE_SDD/Projects/ragflow/rag/utils/es_conn.py", line 462, in ^^^^^^^^^^^^^^ File "/home/ly/SPACE_SDD/Projects/ragflow/rag/utils/init.py", line 28, in _singleton instances[key] = cls(*args, *kw) ^^^^^^^^^^^^^^^^ File "/home/ly/SPACE_SDD/Projects/ragflow/rag/utils/es_conn.py", line 23, in init ELASTICSEARCH = ESConnection() if not self.es.ping(): ^^^^^^^ ^^^^^^^^^^^^^^ File "/home/ly/SPACE_SDD/Projects/ragflow/rag/utils/init.py", line 28, in _singleton instances[key] = cls(args, **kw) AttributeError: 'ESConnection' object has no attribute 'es' ^^^^^^^^^^^^^^^^

JinHai-CN commented 1 month ago

Have you checked your Elasticsearch instance status?

ly0303521 commented 1 month ago

Have you checked your Elasticsearch instance status?

@JinHai-CN Thanks for your reply, I think there's no problem with base components of es01、mysql、minio、redis, because ragflow works very well when launching from docker, I just replace launching from docker with launching from source, the base components services are still running.

JinHai-CN commented 1 month ago

Check the host address of ES and the config if they are not matched.

ly0303521 commented 1 month ago

@JinHai-CN Thanks, you're right, "service_conf.yaml" is not set right. But another problem came out

AssertionError: View function mapping is overwriting an existing endpoint function: llm.delete_llm

ly0303521 commented 1 month ago

Because there two definition of "delete_llm" in "llm_app.py", in latest version, it's solved