首次安装设置管理员账户提示权限=错误 #20614

Closed
opened 2026-02-21 20:08:10 -05:00 by yindo · 8 comments
Owner

Originally created by @sunt1009 on GitHub (Nov 27, 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.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1.clone源码:git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/releases/latest | jq -r .tag_name)" https://github.com/langgenius/dify.git
2.cd dify/docker
3.cp .env.example .env
4.docker-compose up -d
以上步骤都是通过root用户执行的
5.执行成功访问:http://ip/install显示设置管理员界面,填写完账号及密码信息点击设置报错:
Setup failed: PermissionDenied (persistent) at write => permission denied Context: service: fs path: privkeys/171a95e8-020b-43ce-8c45-35628ddf172e/private.pem Source: Permission denied (os error 13)
Image

✔️ Expected Behavior

期望设置成功跳转到首页

Actual Behavior

实际点击设置保错:
Setup failed: PermissionDenied (persistent) at write => permission denied Context: service: fs path: privkeys/171a95e8-020b-43ce-8c45-35628ddf172e/private.pem Source: Permission denied (os error 13)

Originally created by @sunt1009 on GitHub (Nov 27, 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.10.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1.clone源码:git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/releases/latest | jq -r .tag_name)" https://github.com/langgenius/dify.git 2.cd dify/docker 3.cp .env.example .env 4.docker-compose up -d 以上步骤都是通过root用户执行的 5.执行成功访问:http://ip/install显示设置管理员界面,填写完账号及密码信息点击设置报错: Setup failed: PermissionDenied (persistent) at write => permission denied Context: service: fs path: privkeys/171a95e8-020b-43ce-8c45-35628ddf172e/private.pem Source: Permission denied (os error 13) <img width="1579" height="609" alt="Image" src="https://github.com/user-attachments/assets/31b06bdd-b3d6-4a35-96d3-cbbf3c54b9de" /> ### ✔️ Expected Behavior 期望设置成功跳转到首页 ### ❌ Actual Behavior 实际点击设置保错: Setup failed: PermissionDenied (persistent) at write => permission denied Context: service: fs path: privkeys/171a95e8-020b-43ce-8c45-35628ddf172e/private.pem Source: Permission denied (os error 13)
yindo added the 🐞 bug label 2026-02-21 20:08:10 -05:00
yindo closed this issue 2026-02-21 20:08:10 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 27, 2025):

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

This error is caused by the Docker container now running as a non-root user (UID 1001, GID 1001) by default, due to a recent change in the Dify Docker image. The container user needs write access to the privkeys directory and its parent storage directory on your host system. If these directories are owned by root or another user, the container cannot write the required private key file, resulting in the permission denied error (source).

To fix this, on your host system, run:

# Replace /path/to/storage with the actual path mapped to your container's storage volume
chown -R 1001:1001 /path/to/storage
chmod -R u+rwX /path/to/storage

Then restart your containers:

docker-compose down
docker-compose up -d

If you use SELinux or AppArmor, check that these security policies allow write access to the storage directory for Docker containers.

After these changes, retry the admin setup. This should resolve the permission denied error and allow the setup to complete successfully (code reference).

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 (Nov 27, 2025): <!-- Greeting --> Hi @sunt1009! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This error is caused by the Docker container now running as a non-root user (UID 1001, GID 1001) by default, due to a recent change in the Dify Docker image. The container user needs write access to the `privkeys` directory and its parent storage directory on your host system. If these directories are owned by root or another user, the container cannot write the required private key file, resulting in the permission denied error ([source](https://github.com/langgenius/dify/pull/26419)). To fix this, on your host system, run: ```bash # Replace /path/to/storage with the actual path mapped to your container's storage volume chown -R 1001:1001 /path/to/storage chmod -R u+rwX /path/to/storage ``` Then restart your containers: ```bash docker-compose down docker-compose up -d ``` If you use SELinux or AppArmor, check that these security policies allow write access to the storage directory for Docker containers. After these changes, retry the admin setup. This should resolve the permission denied error and allow the setup to complete successfully ([code reference](https://github.com/langgenius/dify/blob/dc9b3a7e034c348f437f5350543be8319591d29a/api/libs/rsa.py)). <!-- 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/a056eddc-8013-4d87-b80f-826d7358486e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a056eddc-8013-4d87-b80f-826d7358486e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a056eddc-8013-4d87-b80f-826d7358486e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a056eddc-8013-4d87-b80f-826d7358486e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a056eddc-8013-4d87-b80f-826d7358486e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a056eddc-8013-4d87-b80f-826d7358486e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a056eddc-8013-4d87-b80f-826d7358486e?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=This%20error%20is%20caused%20by%20the%20Docker%20container%20now%20running%20as%20a%20non-root%20user%20%28UID%201001%2C%20GID%201001%29%20by%20default%2C%20due%20to%20a%20recent%20change%20in%20the%20Dify%20Docker%20image.%20The%20container%20user%20needs%20write%20access%20to%20the%20%60privkeys%60%20directory%20and%20its%20parent%20storage%20directory%20on%20your%20host%20system.%20If%20these%20directories%20are%20owned%20by%20root%20or%20another%20user%2C%20the%20container%20cannot%20write%20the%20required%20private%20key%20file%2C%20resulting%20in%20the%20permission%20denied%20error%20%28%5Bsource%5D%28https%3A//github.com/langgenius/dify/pull/26419%29%29.%0A%0ATo%20fix%20this%2C%20on%20your%20host%20system%2C%20run%3A%0A%0A%60%60%60bash%0A%23%20Replace%20/path/to/storage%20with%20the%20actual%20path%20mapped%20to%20your%20container%27s%20storage%20volume%0Achown%20-R%201001%3A1001%20/path/to/storage%0Achmod%20-R%20u%2BrwX%20/path/to/storage%0A%60%60%60%0A%0AThen%20restart%20your%20containers%3A%0A%0A%60%60%60bash%0Adocker-compose%20down%0Adocker-compose%20up%20-d%0A%60%60%60%0A%0AIf%20you%20use%20SELinux%20or%20AppArmor%2C%20check%20that%20these%20security%20policies%20allow%20write%20access%20to%20the%20storage%20directory%20for%20Docker%20containers.%0A%0AAfter%20these%20changes%2C%20retry%20the%20admin%20setup.%20This%20should%20resolve%20the%20permission%20denied%20error%20and%20allow%20the%20setup%20to%20complete%20successfully%20%28%5Bcode%20reference%5D%28https%3A//github.com/langgenius/dify/blob/dc9b3a7e034c348f437f5350543be8319591d29a/api/libs/rsa.py%29%29.)&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/28791)
Author
Owner

@warlock-lv commented on GitHub (Nov 27, 2025):

I have the same problem, right now. i meet this trouble too. @laipz8200

@warlock-lv commented on GitHub (Nov 27, 2025): I have the same problem, right now. i meet this trouble too. @laipz8200
Author
Owner

@laipz8200 commented on GitHub (Nov 27, 2025):

Please reference our upgrade guide to setup your permissions.

https://github.com/langgenius/dify/releases/tag/1.10.1

Also, please submit issue in English.

@laipz8200 commented on GitHub (Nov 27, 2025): Please reference our upgrade guide to setup your permissions. https://github.com/langgenius/dify/releases/tag/1.10.1 Also, please submit issue in English.
Author
Owner

@lemisky commented on GitHub (Nov 27, 2025):

+1

@lemisky commented on GitHub (Nov 27, 2025): +1
Author
Owner

@dhf16 commented on GitHub (Dec 1, 2025):

I think u can try sudo chmod -R 777 {the path of your volumes of container}.

@dhf16 commented on GitHub (Dec 1, 2025): I think u can try sudo chmod -R 777 {the path of your volumes of container}.
Author
Owner

@wangxiaodong1021 commented on GitHub (Dec 2, 2025):

I think u can try sudo chmod -R 777 {the path of your volumes of container}.

This solves my problem. But does such permission have any complete security risks?

@wangxiaodong1021 commented on GitHub (Dec 2, 2025): > I think u can try sudo chmod -R 777 {the path of your volumes of container}. This solves my problem. But does such permission have any complete security risks?
Author
Owner

@dhf16 commented on GitHub (Dec 2, 2025):

I think u can try sudo chmod -R 777 {the path of your volumes of container}.

This solves my problem. But does such permission have any complete security risks?

Of course it has security risks, but this is the most direct way to solve the problem and I only need to deploy it on the intranet.

@dhf16 commented on GitHub (Dec 2, 2025): > > I think u can try sudo chmod -R 777 {the path of your volumes of container}. > > This solves my problem. But does such permission have any complete security risks? Of course it has security risks, but this is the most direct way to solve the problem and I only need to deploy it on the intranet.
Author
Owner

@Jackxwb commented on GitHub (Dec 2, 2025):

I think u can try sudo chmod -R 777 {the path of your volumes of container}.我觉得你可以试试 sudo chmod -R 777 {你的容器体积路径}。

By default, this directory exists in Dify (GitHub project pull folder)/docker/volumes/app/storage

@Jackxwb commented on GitHub (Dec 2, 2025): > I think u can try sudo chmod -R 777 {the path of your volumes of container}.我觉得你可以试试 sudo chmod -R 777 {你的容器体积路径}。 By default, this directory exists in `Dify (GitHub project pull folder)/docker/volumes/app/storage`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20614