Docker-web-1 always restarting with some error!!!! #21215

Closed
opened 2026-02-21 20:11:28 -05:00 by yindo · 3 comments
Owner

Originally created by @Hgqin on GitHub (Dec 22, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

when i start at docker,docker-web-1 is error.

✔️ Expected Behavior

no

Actual Behavior

  1. Error information:

docker logs docker-web-1
write pipe: file already closed
libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed
libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed
libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed
libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed
libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed
libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed
libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed
libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to exec

Originally created by @Hgqin on GitHub (Dec 22, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce when i start at docker,docker-web-1 is error. ### ✔️ Expected Behavior no ### ❌ Actual Behavior 1. **Error information:** docker logs docker-web-1 write pipe: file already closed libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to execwrite pipe: file already closed libcontainer: container start initialization failed: standard_init_linux.go:242: exec user process caused "permission denied"libcontainer: container init failed to exec
yindo added the 🐞 bug label 2026-02-21 20:11:28 -05:00
yindo closed this issue 2026-02-21 20:11:28 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 22, 2025):

Hi @Hgqin! I'm Dosu and I’m helping the dify team.

Your error is likely caused by a permissions or file format issue with the entrypoint script or mounted volumes. Here’s a focused checklist to resolve it:

  1. If you built or edited files on Windows, convert entrypoint.sh to Unix format using dos2unix entrypoint.sh. Windows line endings (CRLF) can cause a “permission denied” error even if the file is marked executable. The script itself warns about this and provides conversion instructions (see Dockerfile and entrypoint.sh).
  2. Make sure entrypoint.sh is executable and owned by the correct user. The Dockerfile sets this with --chmod=755 and --chown=dify:dify, but if you override files or mount volumes from the host, you may need to run chmod +x entrypoint.sh and chown 1001:1001 entrypoint.sh on the host (Dockerfile reference).
  3. If you mount any host directories (like for storage), ensure their ownership matches the container user (UID 1001). A recent update added an init container to fix storage permissions automatically by running chown -R 1001:1001 on the storage directory before starting the main services (init container PR).
  4. Check your Docker runtime for restrictions (SELinux, AppArmor, rootless Docker) that might block execution.
  5. If the problem persists, try running without custom volume mounts to see if the issue is with host directory permissions.

These steps should resolve the “permission denied” and “write pipe: file already closed” errors for the docker-web-1 container.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 22, 2025): <!-- Greeting --> Hi @Hgqin! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Your error is likely caused by a permissions or file format issue with the entrypoint script or mounted volumes. Here’s a focused checklist to resolve it: 1. If you built or edited files on Windows, convert `entrypoint.sh` to Unix format using `dos2unix entrypoint.sh`. Windows line endings (CRLF) can cause a “permission denied” error even if the file is marked executable. The script itself warns about this and provides conversion instructions ([see Dockerfile and entrypoint.sh](https://github.com/langgenius/dify/blob/04ad68de70232a1c3cd3fe6a340e8b5fca5f1682/web/docker/entrypoint.sh#L1-L47)). 2. Make sure `entrypoint.sh` is executable and owned by the correct user. The Dockerfile sets this with `--chmod=755` and `--chown=dify:dify`, but if you override files or mount volumes from the host, you may need to run `chmod +x entrypoint.sh` and `chown 1001:1001 entrypoint.sh` on the host ([Dockerfile reference](https://github.com/langgenius/dify/blob/04ad68de70232a1c3cd3fe6a340e8b5fca5f1682/web/Dockerfile#L1-L85)). 3. If you mount any host directories (like for storage), ensure their ownership matches the container user (UID 1001). A recent update added an init container to fix storage permissions automatically by running `chown -R 1001:1001` on the storage directory before starting the main services ([init container PR](https://github.com/langgenius/dify/pull/29297)). 4. Check your Docker runtime for restrictions (SELinux, AppArmor, rootless Docker) that might block execution. 5. If the problem persists, try running without custom volume mounts to see if the issue is with host directory permissions. These steps should resolve the “permission denied” and “write pipe: file already closed” errors for the `docker-web-1` container. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/fd75cb13-1695-4cfa-8d20-380e2a7cb0c2?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fd75cb13-1695-4cfa-8d20-380e2a7cb0c2?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fd75cb13-1695-4cfa-8d20-380e2a7cb0c2?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fd75cb13-1695-4cfa-8d20-380e2a7cb0c2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fd75cb13-1695-4cfa-8d20-380e2a7cb0c2?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/fd75cb13-1695-4cfa-8d20-380e2a7cb0c2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fd75cb13-1695-4cfa-8d20-380e2a7cb0c2?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Your%20error%20is%20likely%20caused%20by%20a%20permissions%20or%20file%20format%20issue%20with%20the%20entrypoint%20script%20or%20mounted%20volumes.%20Here%E2%80%99s%20a%20focused%20checklist%20to%20resolve%20it%3A%0A%0A1.%20If%20you%20built%20or%20edited%20files%20on%20Windows%2C%20convert%20%60entrypoint.sh%60%20to%20Unix%20format%20using%20%60dos2unix%20entrypoint.sh%60.%20Windows%20line%20endings%20%28CRLF%29%20can%20cause%20a%20%E2%80%9Cpermission%20denied%E2%80%9D%20error%20even%20if%20the%20file%20is%20marked%20executable.%20The%20script%20itself%20warns%20about%20this%20and%20provides%20conversion%20instructions%20%28%5Bsee%20Dockerfile%20and%20entrypoint.sh%5D%28https%3A//github.com/langgenius/dify/blob/04ad68de70232a1c3cd3fe6a340e8b5fca5f1682/web/docker/entrypoint.sh%23L1-L47%29%29.%0A2.%20Make%20sure%20%60entrypoint.sh%60%20is%20executable%20and%20owned%20by%20the%20correct%20user.%20The%20Dockerfile%20sets%20this%20with%20%60--chmod%3D755%60%20and%20%60--chown%3Ddify%3Adify%60%2C%20but%20if%20you%20override%20files%20or%20mount%20volumes%20from%20the%20host%2C%20you%20may%20need%20to%20run%20%60chmod%20%2Bx%20entrypoint.sh%60%20and%20%60chown%201001%3A1001%20entrypoint.sh%60%20on%20the%20host%20%28%5BDockerfile%20reference%5D%28https%3A//github.com/langgenius/dify/blob/04ad68de70232a1c3cd3fe6a340e8b5fca5f1682/web/Dockerfile%23L1-L85%29%29.%0A3.%20If%20you%20mount%20any%20host%20directories%20%28like%20for%20storage%29%2C%20ensure%20their%20ownership%20matches%20the%20container%20user%20%28UID%201001%29.%20A%20recent%20update%20added%20an%20init%20container%20to%20fix%20storage%20permissions%20automatically%20by%20running%20%60chown%20-R%201001%3A1001%60%20on%20the%20storage%20directory%20before%20starting%20the%20main%20services%20%28%5Binit%20container%20PR%5D%28https%3A//github.com/langgenius/dify/pull/29297%29%29.%0A4.%20Check%20your%20Docker%20runtime%20for%20restrictions%20%28SELinux%2C%20AppArmor%2C%20rootless%20Docker%29%20that%20might%20block%20execution.%0A5.%20If%20the%20problem%20persists%2C%20try%20running%20without%20custom%20volume%20mounts%20to%20see%20if%20the%20issue%20is%20with%20host%20directory%20permissions.%0A%0AThese%20steps%20should%20resolve%20the%20%E2%80%9Cpermission%20denied%E2%80%9D%20and%20%E2%80%9Cwrite%20pipe%3A%20file%20already%20closed%E2%80%9D%20errors%20for%20the%20%60docker-web-1%60%20container.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/30012)
Author
Owner

@laipz8200 commented on GitHub (Dec 22, 2025):

This error seems to be caused by your Docker environment, not by Dify.

@laipz8200 commented on GitHub (Dec 22, 2025): This error seems to be caused by your Docker environment, not by Dify.
Author
Owner

@Hgqin commented on GitHub (Dec 22, 2025):

This error seems to be caused by your Docker environment, not by Dify.

I have assigned user to root in docker-compose.yaml, Now the container is starting.
Dify directory has been chown 777,but using default user dify is failed to start.

@Hgqin commented on GitHub (Dec 22, 2025): > This error seems to be caused by your Docker environment, not by Dify. I have assigned user to root in docker-compose.yaml, Now the container is starting. Dify directory has been chown 777,but using default user dify is failed to start.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21215