Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yangboz opened this issue Jun 12, 2024 · 8 comments
Open

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

yangboz opened this issue Jun 12, 2024 · 8 comments
Labels
question Further information is requested

Comments

@yangboz
Copy link

yangboz commented Jun 12, 2024

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?

@yangboz yangboz added the question Further information is requested label Jun 12, 2024
@JinHai-CN
Copy link
Contributor

Have you checked the FAQ document?

@yangboz
Copy link
Author

yangboz commented Jun 13, 2024

Have you checked the FAQ document?

where is it ? in README.MD. thanks.

@KevinHuSh
Copy link
Collaborator

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
Copy link
Author

yangboz commented Jun 13, 2024

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
Copy link
Author

yangboz commented Jun 13, 2024

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
Copy link
Collaborator

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
Copy link
Author

yangboz commented Jun 14, 2024

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
Copy link
Author

yangboz commented Jun 19, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants