OpenBMB / XAgent

An Autonomous LLM Agent for Complex Task Solving
https://blog.x-agent.net/blog/xagent/
Apache License 2.0
7.82k stars 795 forks source link

(HTTP code 500) server error - Mounts denied: The path /assets/config is not shared from the host and is not known to Docker. #352

Closed Tseian closed 6 months ago

Tseian commented 6 months ago

Issue Description / 问题描述

(HTTP code 500) server error - Mounts denied: The path /assets/config 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/mac for more info.

Steps to Reproduce / 复现步骤

execute docker compose up in project root dir

image image image

File sharing settings look good. docker recognized the ./assets/config as /assets/config ?

image

Expected Behavior / 预期行为

Describe the behavior you expected to see. / 请描述您期望的正确行为。

Environment / 环境信息

Error Screenshots or Logs / 错误截图或日志

If possible, please provide relevant screenshots or logs of the error. / 如果可能,请提供相关的错误截图或日志文件。

Additional Notes / 其他备注

Tseian commented 6 months ago

image

Add an env variable to locate current work dir or is there any other solution?

export XAGENT_WORK_DIR=$(pwd)
docker compose up
Turingforce commented 6 months ago

May fix: failed to mount local volume

Address content in:docker-compose.yml

cd XAgent
vim docker-compose.yml
# replace DB_USERNAME: admin ; DB_PASSWORD: xagentmongodb ; DB_COLLECTION: TSM 
# replace /root/XAgent/assets/config
: wq

Example showed as below:

from .env

DB_USERNAME: admin  
DB_PASSWORD: xagentmongodb  
DB_COLLECTION: TSM  

From ./assets/config to absolute path /root/XAgent/assets/config

volumes:
  xagentmongodb:
  toolserverconfig:
    name: toolserverconfig
    driver: local
    driver_opts:
      type: none
      device: /root/XAgent/assets/config
      o: bind
sheng-di commented 5 months ago

image

Add an env variable to locate current work dir or is there any other solution?

export XAGENT_WORK_DIR=$(pwd)
docker compose up

Not fixed.

➜  XAgent git:(main) export XAGENT_WORK_DIR=$(pwd)
➜  XAgent git:(main) docker compose up
[+] Running 0/0
 ⠿ Volume "toolserverconfig"  Error                                                                                                    0.0

Code version for 2024-1-28.

sheng-di commented 5 months ago

May fix: failed to mount local volume

Address content in:docker-compose.yml

cd XAgent
vim docker-compose.yml
# replace DB_USERNAME: admin ; DB_PASSWORD: xagentmongodb ; DB_COLLECTION: TSM 
# replace /root/XAgent/assets/config
: wq

Example showed as below:

from .env

DB_USERNAME: admin  
DB_PASSWORD: xagentmongodb  
DB_COLLECTION: TSM  

From ./assets/config to absolute path /root/XAgent/assets/config

volumes:
  xagentmongodb:
  toolserverconfig:
    name: toolserverconfig
    driver: local
    driver_opts:
      type: none
      device: /root/XAgent/assets/config
      o: bind

From ./assets/config to absolute path /root/XAgent/assets/config --> Solved.