Knowledge disappears when modifying a knowledge base that Permissions is set to “Partial team members” (no permission to view). #4876

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

Originally created by @0xAllenChen on GitHub (Aug 3, 2024).

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

0.6.15

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Set the knowledge permissions to "Partial team members"

image-20240804022517392

Database at this point:

Permissions have been granted to specific users.

image

  1. On the overview page, change the knowledge name or description and click save

    image

  2. The project disappears!

    image

    Database at this point:

    Permissions have been deleted!

    image

✔️ Expected Behavior

Permissions Data (Normal)

image

Actual Behavior

Permissions Data (Deleted)

image

Originally created by @0xAllenChen on GitHub (Aug 3, 2024). ### 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 0.6.15 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. **Set the knowledge permissions to "Partial team members"** ![image-20240804022517392](https://raw.githubusercontent.com/ChenZixinn/img_repository/master/image-20240804022517392.png) **Database at this point:** Permissions have been granted to specific users. ![image](https://raw.githubusercontent.com/ChenZixinn/img_repository/master/image-20240804021606448.png) 2. **On the overview page, change the knowledge name or description and click save** ![image](https://raw.githubusercontent.com/ChenZixinn/img_repository/master/image-20240804020254322.png) 3. **The project disappears!** ![image](https://raw.githubusercontent.com/ChenZixinn/img_repository/master/image-20240804020401389.png) **Database at this point:** **Permissions have been deleted!** ![image](https://raw.githubusercontent.com/ChenZixinn/img_repository/master/image-20240804021502321.png) ### ✔️ Expected Behavior Permissions Data (Normal) ![image](https://raw.githubusercontent.com/ChenZixinn/img_repository/master/image-20240804021606448.png) ### ❌ Actual Behavior Permissions Data (Deleted) ![image](https://raw.githubusercontent.com/ChenZixinn/img_repository/master/image-20240804021502321.png)
yindo added the 🐞 bug label 2026-02-21 18:08:25 -05:00
yindo closed this issue 2026-02-21 18:08:25 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 3, 2024):

@ChenZixinn Hello there! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let me know how I can assist you.

The issue you're experiencing with permissions being deleted when modifying a knowledge base set to "Partial team members" might be related to how the Dify platform handles permission updates. Unfortunately, specific details about database triggers, hooks, or conditions that might cause this behavior are not available in the provided documentation.

However, here are some potential areas to investigate:

  1. Database Triggers or Hooks: Check if there are any database triggers or hooks that execute when a knowledge base is modified, particularly those affecting the dataset_permissions table.

  2. Code Flow and Functions: Review the code responsible for saving changes to a knowledge base. Identify the functions or methods that update the database and see if they include logic that might inadvertently delete permissions.

  3. Transaction Management: Ensure that the backend handles transaction management correctly when updating knowledge base details. Look for any rollback mechanisms that might affect permission data.

  4. Logging and Debugging: Enable any logging or debugging mechanisms to gain insights into permission changes when a knowledge base is updated. This can help identify where the deletion occurs.

  5. Known Issues: Verify if there are any known issues or bugs in version 0.6.15 related to permission handling or knowledge base modifications.

For a more detailed investigation, you might need to dive into the specific code handling these operations. If you need further assistance, examining the relevant parts of the codebase or consulting with other maintainers might be necessary.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 3, 2024): <!-- Greeting --> @ChenZixinn Hello there! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let me know how I can assist you. <!-- Answer --> The issue you're experiencing with permissions being deleted when modifying a knowledge base set to "Partial team members" might be related to how the Dify platform handles permission updates. Unfortunately, specific details about database triggers, hooks, or conditions that might cause this behavior are not available in the provided documentation. However, here are some potential areas to investigate: 1. **Database Triggers or Hooks**: Check if there are any database triggers or hooks that execute when a knowledge base is modified, particularly those affecting the `dataset_permissions` table. 2. **Code Flow and Functions**: Review the code responsible for saving changes to a knowledge base. Identify the functions or methods that update the database and see if they include logic that might inadvertently delete permissions. 3. **Transaction Management**: Ensure that the backend handles transaction management correctly when updating knowledge base details. Look for any rollback mechanisms that might affect permission data. 4. **Logging and Debugging**: Enable any logging or debugging mechanisms to gain insights into permission changes when a knowledge base is updated. This can help identify where the deletion occurs. 5. **Known Issues**: Verify if there are any known issues or bugs in version 0.6.15 related to permission handling or knowledge base modifications. For a more detailed investigation, you might need to dive into the specific code handling these operations. If you need further assistance, examining the relevant parts of the codebase or consulting with other maintainers might be necessary. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4876