MacOs,After modifying .env, diify-db-1 reports an error after re-run #8465

Closed
opened 2026-02-21 18:25:49 -05:00 by yindo · 1 comment
Owner

Originally created by @zuohaoda on GitHub (Feb 20, 2025).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

Version 0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

In macOS system(MAC M4), after pulling the code, Docker runs normally

Use docker compose down to modify the .env port and then reuse docker compose up -d to run the error:

After deleting the folder created during the first run(/volumes/db/data/pgdata), there will be no errors, but in this way, my previous configuration is lost, including the same problem in the future upgrade. Is there a solution?

✔️ Expected Behavior

No response

Actual Behavior

get error:
dify-db-1:

2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/pg_wal/._archive_status: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/pg_wal/._000000010000000000000002: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/pg_wal/._000000010000000000000003: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._pg_control: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1262: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2964: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1213: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1260: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1261: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1214: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2396: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._6000: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._3592: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._6243: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._6100: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4177: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4178: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2966: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2967: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4185: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4186: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4175: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4176: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2846: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2847: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4181: Operation not permitted
2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4182: Operation not permitted
Originally created by @zuohaoda on GitHub (Feb 20, 2025). ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version Version 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce In macOS system(MAC M4), after pulling the code, Docker runs normally Use `docker compose down` to modify the .env port and then reuse `docker compose up -d` to run the error: After deleting the folder created during the first run(/volumes/db/data/pgdata), there will be no errors, but in this way, my previous configuration is lost, including the same problem in the future upgrade. Is there a solution? ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior get error: dify-db-1: ``` 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/pg_wal/._archive_status: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/pg_wal/._000000010000000000000002: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/pg_wal/._000000010000000000000003: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._pg_control: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1262: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2964: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1213: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1260: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1261: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._1214: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2396: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._6000: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._3592: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._6243: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._6100: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4177: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4178: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2966: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2967: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4185: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4186: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4175: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4176: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2846: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._2847: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4181: Operation not permitted 2025-02-20 21:08:17 find: /var/lib/postgresql/data/pgdata/global/._4182: Operation not permitted ```
yindo added the 🐞 bug label 2026-02-21 18:25:49 -05:00
yindo closed this issue 2026-02-21 18:25:49 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 20, 2025):

Hey @zuohaoda! I'm here to help you with bugs, questions, and becoming a contributor. Let's tackle this issue together! 🤖

I found a similar issue related to "Permission denied" errors when running Docker on macOS. The suggested solution involves several steps to address file permission issues:

  1. Adjust File Permissions:
    Use the following commands to change permissions:

    chmod 777 ./volumes/db/data
    chmod 777 ./volumes/redis/data
    

    Be cautious with 777 permissions due to security risks. It's better to set permissions more restrictively based on your container's user/group needs.

  2. Configure Docker Compose User:
    Specify the user and group IDs in your docker-compose.yml to align with your host's file system permissions:

    services:
      db:
        user: "1001:1001"
    

    Replace 1001:1001 with the actual UID and GID from your system, which you can find using id -u and id -g.

  3. Use Named Volumes:
    To avoid permission issues, use Docker's named volumes for data persistence instead of mounting host directories. Define these volumes in your docker-compose.yml:

    volumes:
      db-data:
      redis-data:
    services:
      db:
        volumes:
          - db-data:/var/lib/postgresql/data
      redis:
        volumes:
          - redis-data:/data
    
  4. Ensure Docker File System Access:
    Make sure Docker Desktop has access to the directories you're using. You can add them in Docker Desktop > Preferences > Resources > File Sharing.

These steps should help resolve the permission issues you're encountering on macOS [1][2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Feb 20, 2025): <!-- Greeting --> Hey @zuohaoda! I'm here to help you with bugs, questions, and becoming a contributor. Let's tackle this issue together! 🤖 <!-- Answer --> I found a similar issue related to "Permission denied" errors when running Docker on macOS. The suggested solution involves several steps to address file permission issues: 1. **Adjust File Permissions**: Use the following commands to change permissions: ```bash chmod 777 ./volumes/db/data chmod 777 ./volumes/redis/data ``` Be cautious with `777` permissions due to security risks. It's better to set permissions more restrictively based on your container's user/group needs. 2. **Configure Docker Compose User**: Specify the user and group IDs in your `docker-compose.yml` to align with your host's file system permissions: ```yaml services: db: user: "1001:1001" ``` Replace `1001:1001` with the actual UID and GID from your system, which you can find using `id -u` and `id -g`. 3. **Use Named Volumes**: To avoid permission issues, use Docker's named volumes for data persistence instead of mounting host directories. Define these volumes in your `docker-compose.yml`: ```yaml volumes: db-data: redis-data: services: db: volumes: - db-data:/var/lib/postgresql/data redis: volumes: - redis-data:/data ``` 4. **Ensure Docker File System Access**: Make sure Docker Desktop has access to the directories you're using. You can add them in Docker Desktop > Preferences > Resources > File Sharing. These steps should help resolve the permission issues you're encountering on macOS <sup>[[1]](https://github.com/langgenius/dify/discussions/4822)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/4821)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/fe38ba6f-1ff2-47fd-b906-8c75fa3a8fe9?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/fe38ba6f-1ff2-47fd-b906-8c75fa3a8fe9?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/fe38ba6f-1ff2-47fd-b906-8c75fa3a8fe9?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/fe38ba6f-1ff2-47fd-b906-8c75fa3a8fe9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fe38ba6f-1ff2-47fd-b906-8c75fa3a8fe9?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/fe38ba6f-1ff2-47fd-b906-8c75fa3a8fe9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fe38ba6f-1ff2-47fd-b906-8c75fa3a8fe9?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8465