segment can not be used when enable by api after disable #6597

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

Originally created by @chzphoenix on GitHub (Nov 6, 2024).

Originally assigned to: @JohnJyong on GitHub.

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

lastest

Cloud or Self Hosted

Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

1、disable segment by api
2、enable it by api(content not change)

✔️ Expected Behavior

segment can be retrievaled

Actual Behavior

segment can not be retrievaled
because it is not added in vector databset

Originally created by @chzphoenix on GitHub (Nov 6, 2024). Originally assigned to: @JohnJyong on GitHub. ### 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 lastest ### Cloud or Self Hosted Self Hosted (Docker), Self Hosted (Source) ### Steps to reproduce 1、disable segment by api 2、enable it by api(content not change) ### ✔️ Expected Behavior segment can be retrievaled ### ❌ Actual Behavior segment can not be retrievaled because it is not added in vector databset
yindo added the 🐞 bug label 2026-02-21 18:16:28 -05:00
yindo closed this issue 2026-02-21 18:16:29 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 6, 2024):

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

I found a similar issue that might be related to your problem. The issue titled 数据集的段无法禁用 was closed and involved problems with enabling and disabling segments. The suggested solution was to handle errors when deleting Weaviate vectors by capturing 404 errors and allowing the deletion to proceed normally [1].

Regarding your issue, it seems that when a segment is re-enabled after being disabled, it should be added back to the vector database. However, if this is not happening, it might be due to a problem in the re-indexing process. Unfortunately, I couldn't find specific information on how Dify handles re-indexing of segments when they are re-enabled. It might be worth checking if there are any logs or error messages that could provide more insight into why the segment is not being added back to the vector database. Additionally, ensure that the segment is in a "completed" status and that the necessary permissions are in place when performing these actions via the API [2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 6, 2024): <!-- Greeting --> Hello @chzphoenix! I'm here to help you with any bugs, questions, or contributions you have for this project. Let's work together to solve this issue! <!-- Answer --> I found a similar issue that might be related to your problem. The issue titled [数据集的段无法禁用](https://github.com/langgenius/dify/issues/1370) was closed and involved problems with enabling and disabling segments. The suggested solution was to handle errors when deleting Weaviate vectors by capturing 404 errors and allowing the deletion to proceed normally <sup>[[1]](https://github.com/langgenius/dify/issues/1370)</sup>. Regarding your issue, it seems that when a segment is re-enabled after being disabled, it should be added back to the vector database. However, if this is not happening, it might be due to a problem in the re-indexing process. Unfortunately, I couldn't find specific information on how Dify handles re-indexing of segments when they are re-enabled. It might be worth checking if there are any logs or error messages that could provide more insight into why the segment is not being added back to the vector database. Additionally, ensure that the segment is in a "completed" status and that the necessary permissions are in place when performing these actions via the API <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/controllers/console/datasets/datasets_segments.py)</sup>. <!-- 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#6597