langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
46.36k stars 6.55k forks source link

docker-compose error #7739

Closed qq253498229 closed 3 weeks ago

qq253498229 commented 3 weeks ago

Self Checks

Dify version

0.7.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

[root@VM-0-9-centos docker]# docker-compose up -d
WARNING: The CERTBOT_EMAIL variable is not set. Defaulting to a blank string.
WARNING: The CERTBOT_DOMAIN variable is not set. Defaulting to a blank string.
Creating docker_web_1 ... 
Creating docker_sandbox_1    ... error
Creating docker_ssrf_proxy_1 ... 
Creating docker_redis_1      ... 
Creating docker_db_1         ... 
Creating docker_weaviate_1   ... 

Creating docker_web_1        ... error
container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: time="2024-08-28T13:41:45+08:00" level=fatal msg="no such file or directory": unknown

ERROR: for docker_redis_1  Cannot start service redis: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: %!w(<nil>): unknown

ERROR: for docker_web_1  Cannot start service web: failed to create shim task: OCI runtime create failed: runc create failed: unable to start containeCreating docker_db_1         ... error
evel=fatal msg="no such file or directory": unknown

ERROR: for docker_db_1  Cannot start service db: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: time="2024-08-28T13:41:46+08:00" levCreating docker_ssrf_proxy_1 ... error

ERROR: for docker_weaviate_1  Cannot start service weaviate: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: writing syncT "procResume": write init-p: broken pipe: unknown

ERROR: for docker_ssrf_proxy_1  Cannot start service ssrf_proxy: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: writing syncT "procResume": write init-p: broken pipe: unknown

ERROR: for sandbox  Cannot start service sandbox: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: time="2024-08-28T13:41:45+08:00" level=fatal msg="no such file or directory": unknown

ERROR: for redis  Cannot start service redis: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: %!w(<nil>): unknown

ERROR: for web  Cannot start service web: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: time="2024-08-28T13:41:45+08:00" level=fatal msg="no such file or directory": unknown

ERROR: for db  Cannot start service db: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: time="2024-08-28T13:41:46+08:00" level=fatal msg="no such file or directory": unknown

ERROR: for weaviate  Cannot start service weaviate: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: writing syncT "procResume": write init-p: broken pipe: unknown

ERROR: for ssrf_proxy  Cannot start service ssrf_proxy: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: writing syncT "procResume": write init-p: broken pipe: unknown
ERROR: Encountered errors while bringing up the project.

✔️ Expected Behavior

normally work

❌ Actual Behavior

cause error

dosubot[bot] commented 3 weeks ago

@qq253498229 Hello! I'm here to help you with any bugs, questions, or contributions you may have. Let's work together to solve this issue.

I found some similar issues that might help you resolve the "failed to create shim task: OCI runtime create failed" errors:

  1. Code execution service is unavailable (closed):

    • The issue was related to network access problems caused by proxy settings. The solution was to add sandbox to the NO_PROXY environment variable in the docker-compose.yaml file:
      NO_PROXY: 'localhost,127.0.0.1,172.17.*.*, .local, weaviate, sandbox'
  2. Not able to run the docker-compose.yaml file (closed):

    • The solution was to ensure that the entire Docker directory is copied to the server, not just the docker-compose.yml file.
  3. 小白求问,请问我在执行了docker compose up -d后,返回这个结果怎么修复? (closed):

    • The recommended steps were:
      git clone PROJECT
      cd PROJECT/docker
      docker compose up -d

For your specific issue, ensure that your system meets the following prerequisites:

  1. Operating System and Software Requirements:

    • Linux platforms: Docker 19.03 or later, Docker Compose 1.25.1 or later.
  2. Clone the Dify Source Code:

    git clone https://github.com/langgenius/dify.git
  3. Start Dify: Navigate to the docker directory in the Dify source code and execute the following commands:

    cd dify/docker
    cp .env.example .env
    docker compose up -d
  4. Check Docker Compose Version: If your system has Docker Compose V2 installed, use docker compose instead of docker-compose. Verify this by running:

    docker compose version
  5. Ensure All Containers Are Running Successfully: After running docker compose up -d, check the status of all containers:

    docker compose ps

If the issue persists, it may be related to system resource constraints or specific Docker runtime configurations. Ensure that your Docker environment has sufficient resources allocated and that there are no conflicting configurations [1][2][3][4].

To continue talking to Dosu, mention @dosu.

crazywoola commented 3 weeks ago

You need the whole docker/ directory to run the application.

qq253498229 commented 3 weeks ago

@qq253498229 Hello! I'm here to help you with any bugs, questions, or contributions you may have. Let's work together to solve this issue.

I found some similar issues that might help you resolve the "failed to create shim task: OCI runtime create failed" errors:

  1. Code execution service is unavailable (closed):

    • The issue was related to network access problems caused by proxy settings. The solution was to add sandbox to the NO_PROXY environment variable in the docker-compose.yaml file:
      NO_PROXY: 'localhost,127.0.0.1,172.17.*.*, .local, weaviate, sandbox'
  2. Not able to run the docker-compose.yaml file (closed):

    • The solution was to ensure that the entire Docker directory is copied to the server, not just the docker-compose.yml file.
  3. 小白求问,请问我在执行了docker compose up -d后,返回这个结果怎么修复? (closed):

    • The recommended steps were:
      git clone PROJECT
      cd PROJECT/docker
      docker compose up -d

For your specific issue, ensure that your system meets the following prerequisites:

  1. Operating System and Software Requirements:

    • Linux platforms: Docker 19.03 or later, Docker Compose 1.25.1 or later.
  2. Clone the Dify Source Code:
    git clone https://github.com/langgenius/dify.git
  3. Start Dify: Navigate to the docker directory in the Dify source code and execute the following commands:
    cd dify/docker
    cp .env.example .env
    docker compose up -d
  4. Check Docker Compose Version: If your system has Docker Compose V2 installed, use docker compose instead of docker-compose. Verify this by running:
    docker compose version
  5. Ensure All Containers Are Running Successfully: After running docker compose up -d, check the status of all containers:
    docker compose ps

If the issue persists, it may be related to system resource constraints or specific Docker runtime configurations. Ensure that your Docker environment has sufficient resources allocated and that there are no conflicting configurations [1][2][3][4].

To continue talking to Dosu, mention @dosu.

@crazywoola I'm sorry, but none of these solutions solve my problem

You need the whole docker/ directory to run the application.

What exactly do you mean by that statement?

qq253498229 commented 3 weeks ago

Why is this issue marked closed? Is there a solution? Or am I asking the wrong question?

qq253498229 commented 3 weeks ago

You need the whole docker/ directory to run the application.

Is it incorrect that I execute docker-compose up -d in the dify/docker directory?

qq253498229 commented 3 weeks ago

I tried to start the db app individually, and the console reported the following error:

[root@VM-0-9-centos docker]# docker-compose up -d db
WARNING: The CERTBOT_EMAIL variable is not set. Defaulting to a blank string.
WARNING: The CERTBOT_DOMAIN variable is not set. Defaulting to a blank string.
Creating docker_db_1 ... error

ERROR: for docker_db_1  Cannot start service db: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: %!w(<nil>): unknown

ERROR: for db  Cannot start service db: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: %!w(<nil>): unknown
ERROR: Encountered errors while bringing up the project.
qq253498229 commented 3 weeks ago

This is system information:

[root@VM-0-9-centos docker]# uname -a
Linux VM-0-9-centos 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

[root@VM-0-9-centos docker]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"

[root@VM-0-9-centos docker]# arch 
x86_64
kurokobo commented 3 weeks ago

Update your docker and use docker compose instead of docker-compose. If you have further questions, ask in the discord or discussion on the GitHub, since here is the place to report bugs or feature request and not the place to ask usage questions.

qq253498229 commented 3 weeks ago

I have updated Docker, but there are still issues after using Docker Compose.

What else would you call a bug if this isn't one? I don't understand why you are ignoring user issues, which is very disappointing.

[root@VM-0-9-centos docker]# docker compose version
Docker Compose version v2.27.0

[root@VM-0-9-centos docker]# docker version
Client: Docker Engine - Community
 Version:           26.1.3
 API version:       1.45
 Go version:        go1.21.10
 Git commit:        b72abbb
 Built:             Thu May 16 08:34:39 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.1.3
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.10
  Git commit:       8e96db1
  Built:            Thu May 16 08:33:34 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.32
  GitCommit:        8b3b7ca2e5ce38e8f31a34f35b2b68ceb8470d89
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
[root@VM-0-9-centos docker]# docker compose up -d db
WARN[0000] The "CERTBOT_EMAIL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "CERTBOT_DOMAIN" variable is not set. Defaulting to a blank string. 
[+] Running 0/1
 ⠴ Container docker-db-1  Starting                                                                                            2.5s 
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: bind-mount /proc/2672746/ns/net -> /var/run/docker/netns/44c39b124b47: no such file or directory: unknown

I am very disappointed with you, and you don't need to answer my question anymore.

kurokobo commented 3 weeks ago

I still believe that your problem is specific to your environment and not a bug in the Dify.

Since Dify uses the official PostgreSQL image from Docker without any special tweaks, it is very unlikely that it is the Dify implementation that is causing the db container to fail to boot.

If it really is a bug, but even in that case it would be a bug in Docker or the container runtime, not in Dify.

stderr: bind-mount /proc/2672746/ns/net -> /var/run/docker/netns/44c39b124b47: no such file or directory: unknown

This behavior is performed internally by the container runtime when creating a container or a container network, and has nothing to do with the Dify implementation.

I reccomend you to: