infiniflow / ragflow

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

[Question]: Ragflow docker image without embedding models not loading on MacBook M1Max #3228

Open embedsri opened 2 weeks ago

embedsri commented 2 weeks ago

Describe your problem

I'm unable to load this image that I built without embedding models on my macbook. docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE infiniflow/ragflow dev-slim 49bcb5b26952 2 hours ago 7.04GB

suc@Srirams-MacBook-Pro ragflow % docker run 49bcb5b26952
Traceback (most recent call last): File "/ragflow/api/utils/file_utils.py", line 126, in load_yaml_conf with open(conf_path) as f: ^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/ragflow/conf/service_conf.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/ragflow/api/ragflow_server.py", line 26, in from api.apps import app File "/ragflow/api/apps/init.py", line 26, in from api.db.db_models import close_connection File "/ragflow/api/db/db_models.py", line 33, in from api.settings import DATABASE, stat_logger, SECRET_KEY, DATABASE_TYPE File "/ragflow/api/settings.py", line 19, in from api.utils.file_utils import get_project_base_directory File "/ragflow/api/utils/init.py", line 67, in use_deserialize_safe_module = get_base_config( ^^^^^^^^^^^^^^^^ File "/ragflow/api/utils/init.py", line 58, in get_base_config config = file_utils.load_yaml_conf(config_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/api/utils/file_utils.py", line 130, in load_yaml_conf raise EnvironmentError( OSError: [Errno loading yaml file config from /ragflow/conf/service_conf.yaml failed:] [Errno 2] No such file or directory: '/ragflow/conf/service_conf.yaml' Traceback (most recent call last): File "/ragflow/api/utils/file_utils.py", line 126, in load_yaml_conf with open(conf_path) as f: ^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/ragflow/conf/service_conf.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/ragflow/api/ragflow_server.py", line 26, in from api.apps import app File "/ragflow/api/apps/init.py", line 26, in from api.db.db_models import close_connection File "/ragflow/api/db/db_models.py", line 33, in from api.settings import DATABASE, stat_logger, SECRET_KEY, DATABASE_TYPE File "/ragflow/api/settings.py", line 19, in from api.utils.file_utils import get_project_base_directory File "/ragflow/api/utils/init.py", line 67, in use_deserialize_safe_module = get_base_config( ^^^^^^^^^^^^^^^^ File "/ragflow/api/utils/init.py", line 58, in get_base_config config = file_utils.load_yaml_conf(config_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/api/utils/file_utils.py", line 130, in load_yaml_conf raise EnvironmentError( OSError: [Errno loading yaml file config from /ragflow/conf/service_conf.yaml failed:] [Errno 2] No such file or directory: '/ragflow/conf/service_conf.yaml' Traceback (most recent call last): File "/ragflow/api/utils/file_utils.py", line 126, in load_yaml_conf with open(conf_path) as f: ^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/ragflow/conf/service_conf.yaml'

KevinHuSh commented 2 weeks ago

Copy docker/service_conf.yaml intto container at /ragflow/conf/

embedsri commented 2 weeks ago

I did that and while that resolved the error , I encounter a new error.

Last login: Wed Oct 30 16:32:34 on ttys001 suc@MacBookPro ~ % cd ragflow/docker suc@MacBookPro docker % ls README.md docker-compose-base.yml docker-compose.yml init.sql ragflow-logs docker-compose-CN-oc9.yml docker-compose-gpu-CN-oc9.yml entrypoint.sh launch_backend_service.sh service_conf.yaml docker-compose-admin-tool.yml docker-compose-gpu.yml init-kibana.sh nginx suc@MacBookPro docker % docker cp service_conf.yaml infiniflow/ragflow:/ragflow/conf Successfully copied 3.58kB to infiniflow/ragflow:/ragflow/con Error response from daemon: No such container: infiniflow/rag flow suc@MacBookPro docker % docker cp service_conf.yaml dev-slim:/ragflow/conf Successfully copied 3.58kB to dev-slim:/ragflow/conf Error response from daemon: No such container: dev-slim suc@MacBookPro docker % docker cp service_conf.yaml 49bcb5b26952:/ragflow/conf Successfully copied 3.58kB to 49bcb5b26952:/ragflow/conf Error response from daemon: No such container: 49bcb5b26952 suc@MacBookPro docker % docker cp service_conf.yaml 49bcb5b26952:/ragflow/conf suc@MacBookPro docker % docker images ragflow
REPOSITORY TAG IMAGE ID CREATED SIZE suc@MacBookPro docker % docker images infiniflow/ragflow REPOSITORY TAG IMAGE ID CREATED SIZE infiniflow/ragflow dev-slim 49bcb5b26952 23 hours ago 7.04GB suc@MacBookPro docker % docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 88a8af567747 infiniflow/ragflow "./entrypoint.sh" 16 minutes ago Up 16 minutes zen_snyder a20df0eb0ab1 infiniflow/ragflow "./entrypoint.sh" 20 minutes ago Up 20 minutes quirky_volhard e4845e593ad6 49bcb5b26952 "./entrypoint.sh" 27 minutes ago Up 27 minutes sweet_benz f3dd1a5def12 49bcb5b26952 "./entrypoint.sh" 31 minutes ago Up 31 minutes hopeful_khayyam a41c86bac253 49bcb5b26952 "./entrypoint.sh" 22 hours ago Up 22 hours determined_liskov 20a5b029baa3 f0f41b0c6d74 "./entrypoint.sh" 2 days ago Up 24 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:5678->5678/tcp, 0.0.0.0:9380->9380/tcp ragflow-server 479739b03fb7 mysql:8.0.39 "docker-entrypoint.s…" 2 days ago Up 24 hours (healthy) 33060/tcp, 0.0.0.0:5455->3306/tcp ragflow-mysql b6399d81ec30 quay.io/minio/minio:RELEASE.2023-12-20T01-00-02Z "/usr/bin/docker-ent…" 2 days ago Up 24 hours 0.0.0.0:9000-9001->9000-9001/tcp ragflow-minio 5b4ea05202d9 docker.elastic.co/elasticsearch/elasticsearch:8.11.3 "/bin/tini -- /usr/l…" 2 days ago Up 24 hours (healthy) 9300/tcp, 0.0.0.0:1200->9200/tcp ragflow-es-01 c132b6fdd3fa valkey/valkey:8 "docker-entrypoint.s…" 2 days ago Up 24 hours 0.0.0.0:6379->6379/tcp ragflow-redis suc@MacBookPro docker % docker cp service_conf.yaml zen_snyder:/ragflow/conf Successfully copied 3.58kB to zen_snyder:/ragflow/conf suc@MacBookPro docker % vi ragflowOnMacMax1Pro

File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request raise err from None elastic_transport.ConnectionError: Connection error caused by: NameResolutionError(<urllib3.connection.HTTPConnection object at 0x7fffdce05010>: Failed to resolve 'es01' ([Errno -2] Name or service not known)) [WARNING] [2024-11-06 20:35:25,285] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 4 times in a row, putting on 8 second timeout [WARNING] [2024-11-06 20:35:26,088] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 1 times in a row, putting on 1 second timeout [WARNING] [2024-11-06 20:35:26,088] [_transport.perform_request] [line:395]: Retrying request after failure (attempt 0 of 3) Traceback (most recent call last): File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_transport.py", line 328, in perform_request meta, raw_data = node.perform_request( ^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request raise err from None elastic_transport.ConnectionError: Connection error caused by: NameResolutionError(<urllib3.connection.HTTPConnection object at 0x7fffdeae96a0>: Failed to resolve 'es01' ([Errno -2] Name or service not known)) [WARNING] [2024-11-06 20:35:26,100] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 2 times in a row, putting on 2 second timeout [WARNING] [2024-11-06 20:35:26,103] [_transport.perform_request] [line:395]: Retrying request after failure (attempt 1 of 3) Traceback (most recent call last): File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_transport.py", line 328, in perform_request meta, raw_data = node.perform_request( ^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request raise err from None elastic_transport.ConnectionError: Connection error caused by: NameResolutionError(<urllib3.connection.HTTPConnection object at 0x7fffdeae98e0>: Failed to resolve 'es01' ([Errno -2] Name or service not known)) [WARNING] [2024-11-06 20:35:26,115] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 3 times in a row, putting on 4 second timeout [WARNING] [2024-11-06 20:35:26,116] [_transport.perform_request] [line:395]: Retrying request after failure (attempt 2 of 3) Traceback (most recent call last): File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_transport.py", line 328, in perform_request meta, raw_data = node.perform_request( ^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request raise err from None elastic_transport.ConnectionError: Connection error caused by: NameResolutionError(<urllib3.connection.HTTPConnection object at 0x7fffdeae9bb0>: Failed to resolve 'es01' ([Errno -2] Name or service not known)) [WARNING] [2024-11-06 20:35:26,123] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 4 times in a row, putting on 8 second timeout [WARNING] [2024-11-06 20:35:26,319] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 1 times in a row, putting on 1 second timeout [WARNING] [2024-11-06 20:35:26,319] [_transport.perform_request] [line:395]: Retrying request after failure (attempt 0 of 3) Traceback (most recent call last): File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_transport.py", line 328, in perform_request meta, raw_data = node.perform_request( ^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request raise err from None elastic_transport.ConnectionError: Connection error caused by: NameResolutionError(<urllib3.connection.HTTPConnection object at 0x7fffddd96390>: Failed to resolve 'es01' ([Errno -2] Name or service not known)) [WARNING] [2024-11-06 20:35:26,328] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 2 times in a row, putting on 2 second timeout [WARNING] [2024-11-06 20:35:26,329] [_transport.perform_request] [line:395]: Retrying request after failure (attempt 1 of 3) Traceback (most recent call last): File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_transport.py", line 328, in perform_request meta, raw_data = node.perform_request( ^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request raise err from None elastic_transport.ConnectionError: Connection error caused by: NameResolutionError(<urllib3.connection.HTTPConnection object at 0x7fffddd96150>: Failed to resolve 'es01' ([Errno -2] Name or service not known)) [WARNING] [2024-11-06 20:35:26,338] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 3 times in a row, putting on 4 second timeout [WARNING] [2024-11-06 20:35:26,338] [_transport.perform_request] [line:395]: Retrying request after failure (attempt 2 of 3) Traceback (most recent call last): File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_transport.py", line 328, in perform_request meta, raw_data = node.perform_request( ^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/.venv/lib/python3.12/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request raise err from None elastic_transport.ConnectionError: Connection error caused by: NameResolutionError(<urllib3.connection.HTTPConnection object at 0x7fffddd95f10>: Failed to resolve 'es01' ([Errno -2] Name or service not known)) [WARNING] [2024-11-06 20:35:26,344] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 4 times in a row, putting on 8 second timeout [WARNING] [2024-11-06 20:35:27,130] [_node_pool.mark_dead] [line:249]: Node <Urllib3HttpNode(http://es01:9200)> has failed for 5 times in a row, putting on 16 second timeout [WARNING] [2024-11-06 20:35:27,131] [_transport.perform_request] [line:395]: Retrying request after failure (attempt 0 of 3) Traceback (most recent call last):

From a user experience standpoint, why is ragflow not as good as it could be on Macs?

KevinHuSh commented 2 weeks ago

The ES seems down. It's complicated for Macs.

embedsri commented 2 weeks ago

@KevinHuSh Thank you. What's the ES in Ragflow context? It appears to be the MongoDB elasticsearch vector database. How to resolve this error so I have ragflow working on mac?

gschmutz commented 1 week ago

@embedsri it works on my machine, Apple M1 Pro. Why don't you use the docker compose stack provided in the docker folder?

$ cd ragflow/docker
$ docker compose -f docker-compose.yml up -d
embedsri commented 1 week ago

@gschmutz Thanks. I just wanted to build one from source but took your suggestion and created the docker image. But I'm unable to add files to the knowledge base because I see this warning which doesn't allow me to do so:

Screenshot 2024-11-11 at 8 19 41 PM
KevinHuSh commented 1 week ago

Follow the warning message. At least you need to set an embedding model.

embedsri commented 1 week ago

@KevinHuSh Where in the RAGFlow interface is 'Settings>Model Providers'? I've set the embedding model in 'System Model Settings'

Screenshot 2024-11-12 at 9 15 40 PM

Am I just something simple and obvious?

KevinHuSh commented 1 week ago

I'm not sure if yuo setup the chat LLM?

embedsri commented 1 week ago

Is the knowledgebase not stored in persistent storage? After seeing some errors, I restarted the docker image but the knowledge base and the LLMs setup was lost. So, I retried this: docker compose -f docker-compose.yml 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 5/5 ✔ Container ragflow-minio Started 0.2s ✘ Container ragflow-es-01 Error 7.7s ✘ Container ragflow-mysql Error 1.2s ✔ Container ragflow-server Created 0.0s ✔ Container ragflow-redis Started 0.2s dependency failed to start: container ragflow-mysql is unhealthy and the rag flow-server process is not up. docker % docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 479739b03fb7 mysql:8.0.39 "docker-entrypoint.s…" 11 days ago Restarting (1) 2 seconds ago ragflow-mysql b6399d81ec30 quay.io/minio/minio:RELEASE.2023-12-20T01-00-02Z "/usr/bin/docker-ent…" 11 days ago Up 11 seconds 0.0.0.0:9000-9001->9000-9001/tcp ragflow-minio 5b4ea05202d9 docker.elastic.co/elasticsearch/elasticsearch:8.11.3 "/bin/tini -- /usr/l…" 11 days ago Up Less than a second (health: starting) 9300/tcp, 0.0.0.0:1200->9200/tcp ragflow-es-01 c132b6fdd3fa valkey/valkey:8 "docker-entrypoint.s…" 11 days ago Up 11 seconds 0.0.0.0:6379->6379/tcp ragflow-redis

How do I resolve this?

liguop2008 commented 2 days ago

我也出现这个问题了,有没有解决方案?大神, docker compose -f docker-compose.yml up -d 这个一切正常 docker logs -f ragflow-server 提示错误,如下: OSError: [Errno loading yaml file config from /ragflow/conf/service_conf.yaml failed:] [Errno 2] No such file or directory: '/ragflow/conf/service_conf.yaml' service_conf.yaml是存在的。权限也是够的。

mikejhan4455 commented 2 days ago

The main branch and the dev version image are under development and change every time.

Checkout to the branch '0.13.0' and setting RAGFLOW_IMAGE=infiniflow/ragflow:v0.13.0 solves the problem for me.

liguop2008 commented 2 days ago

您的邮件已收到!祝工作顺利!

KevinHuSh commented 2 days ago

Pull the latest code.

liguop2008 commented 2 days ago

The main branch and the dev version image are under development and change every time.

Checkout to the branch '0.13.0' and setting RAGFLOW_IMAGE=infiniflow/ragflow:v0.13.0 solves the problem for me. 我用的是这个RAGFLOW_IMAGE=infiniflow/ragflow:v0.13.0才提示上面的错误。

embedsri commented 2 days ago

Thank you for your assistance. I'm making progress but it is 2 steps forward and 1 step backward. This is what I see for remote branches:

MacBookPro ragflow % git branch -r -v origin/HEAD -> origin/main origin/api 1fafdb84 fix(API): fixed retrieval api parameters matching (#2550) origin/main cc5960b8 Vietnamese language support on web (#3549)

I'm on the main branch and when I just try to download a prebuilt Docker image for RAGFlow slim (dev-slim) with these in the .env RAGFLOW_IMAGE=infiniflow/ragflow:v0.13.0-slim MACOS=1: docker % docker compose -f docker-compose.yml up -d [+] Running 5/6 ⠹ Container ragflow-mysql Starting 2.6s ✔ Container ragflow-minio Started 2.6s ✔ Container ragflow-es-01 Started 2.6s ✔ Container ragflow-redis Started 2.6s ✔ Container ragflow-server Recreated 0.1s ! ragflow The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s Error response from daemon: Mounts denied: The path /Users/suc/ragflow/docker/init.sql is not shared from the host and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing. See https://docs.docker.com/desktop/settings/mac/#file-sharing for more info.

I'd loaded prebuilt docker image for M1Max arm64/v8 before as we all can see earlier in the thread. What happened to that now?

So, I'm back to building an image for M1Max bash build_docker_image.sh slim which is also giving an error:

=> ERROR [production 19/23] COPY --from=builder /ragflow/web/dist /ragflow/web/dist 0.0s


[production 19/23] COPY --from=builder /ragflow/web/dist /ragflow/web/dist:


Dockerfile.slim:126


124 |
125 | # Copy compiled web pages 126 | >>> COPY --from=builder /ragflow/web/dist /ragflow/web/dist 127 |
128 | # Copy Python environment and packages

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref lzlmsnquca292lao183jmu95t::nqwa5uq9uyftv19kzbu4hic6f: "/ragflow/web/dist": not found

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/fntjcoufsdt2mqwe8b37dh6eq