[Bug] KB document update via API causes indexing to hang permanently, creates duplicate disabled chunks on retry #22071

Open
opened 2026-02-21 20:15:38 -05:00 by yindo · 3 comments
Owner

Originally created by @kaiadachi on GitHub (Feb 4, 2026).

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

v1.12.1

Cloud or Self Hosted

Cloud

Steps to reproduce

  1. Create a new Knowledge Base document - works fine
  2. Make any change to the document (via API update-by-file or UI edit)
  3. Re-indexing starts but hangs at "Embedding in progress... 0%" forever
  4. Pause and resume the indexing
  5. Duplicate chunks are created (old = enabled, new = disabled, same content)

✔️ Expected Behavior

  • Indexing completes normally
  • Old chunks are replaced with new chunks

Actual Behavior

  • Indexing hangs at 0% and never progresses
  • After pause/resume: both old chunks (enabled) and new chunks (disabled) exist with identical content

Additional context

  • This was working correctly before Feb 3, 2026 (pre-v1.12.0)
  • Occurs with both API and UI updates
  • Affects multiple environments
Originally created by @kaiadachi on GitHub (Feb 4, 2026). ### 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 v1.12.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce 1. Create a new Knowledge Base document - **works fine** 2. Make any change to the document (via API `update-by-file` or UI edit) 3. Re-indexing starts but hangs at "Embedding in progress... 0%" forever 4. Pause and resume the indexing 5. Duplicate chunks are created (old = enabled, new = disabled, same content) ### ✔️ Expected Behavior - Indexing completes normally - Old chunks are replaced with new chunks ### ❌ Actual Behavior - Indexing hangs at 0% and never progresses - After pause/resume: both old chunks (enabled) and new chunks (disabled) exist with identical content ### Additional context - This was working correctly before Feb 3, 2026 (pre-v1.12.0) - Occurs with both API and UI updates - Affects multiple environments
yindo added the 🐞 bugcloud labels 2026-02-21 20:15:38 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 4, 2026):

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

This bug is a known regression in v1.12.1, tracked in the main issue thread. Recent changes to the embedding and indexing workflow—especially in how document updates trigger segment deletion and re-indexing—appear to have introduced race conditions or state mismatches. When you update a KB document, the backend should delete all old segments and their vector index entries before re-indexing, but something is causing the process to hang at 0% and, after pause/resume, duplicate chunks (with old ones enabled and new ones disabled) are left behind instead of being replaced as expected. This affects both API and UI flows and is reproducible across environments [source].

There’s no official workaround documented yet. Avoid pausing/resuming indexing if possible, as this seems to trigger the duplication. If you need to clean up, you may have to manually delete disabled or duplicate chunks from the KB. If you’re troubleshooting, collect logs from the backend (especially around document_indexing_update_task and segment/chunk state changes) and share them in the main issue thread to help maintainers pinpoint the root cause [source].

The maintainers are actively investigating, and the bug is linked to recent PRs that changed the embedding process and summary index features [source]. Keep an eye on the main issue for updates and fixes.

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 (Feb 4, 2026): <!-- Greeting --> Hi @kaiadachi! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This bug is a known regression in v1.12.1, tracked in the main issue thread. Recent changes to the embedding and indexing workflow—especially in how document updates trigger segment deletion and re-indexing—appear to have introduced race conditions or state mismatches. When you update a KB document, the backend should delete all old segments and their vector index entries before re-indexing, but something is causing the process to hang at 0% and, after pause/resume, duplicate chunks (with old ones enabled and new ones disabled) are left behind instead of being replaced as expected. This affects both API and UI flows and is reproducible across environments [[source](https://github.com/langgenius/dify/issues/1542)]. There’s no official workaround documented yet. Avoid pausing/resuming indexing if possible, as this seems to trigger the duplication. If you need to clean up, you may have to manually delete disabled or duplicate chunks from the KB. If you’re troubleshooting, collect logs from the backend (especially around document_indexing_update_task and segment/chunk state changes) and share them in the main issue thread to help maintainers pinpoint the root cause [[source](https://github.com/langgenius/dify/blob/365f749ed5794da584154a63eafaab9587f31343/api/tasks/document_indexing_update_task.py#L19-L81)]. The maintainers are actively investigating, and the bug is linked to recent PRs that changed the embedding process and summary index features [[source](https://github.com/langgenius/dify/pull/30622)]. Keep an eye on the main issue for updates and fixes. <!-- 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/84d506d8-a1f0-4afa-a963-eb656cb64ed0?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/84d506d8-a1f0-4afa-a963-eb656cb64ed0?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/84d506d8-a1f0-4afa-a963-eb656cb64ed0?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/84d506d8-a1f0-4afa-a963-eb656cb64ed0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/84d506d8-a1f0-4afa-a963-eb656cb64ed0?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/84d506d8-a1f0-4afa-a963-eb656cb64ed0?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/84d506d8-a1f0-4afa-a963-eb656cb64ed0?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%20bug%20is%20a%20known%20regression%20in%20v1.12.1%2C%20tracked%20in%20the%20main%20issue%20thread.%20Recent%20changes%20to%20the%20embedding%20and%20indexing%20workflow%E2%80%94especially%20in%20how%20document%20updates%20trigger%20segment%20deletion%20and%20re-indexing%E2%80%94appear%20to%20have%20introduced%20race%20conditions%20or%20state%20mismatches.%20When%20you%20update%20a%20KB%20document%2C%20the%20backend%20should%20delete%20all%20old%20segments%20and%20their%20vector%20index%20entries%20before%20re-indexing%2C%20but%20something%20is%20causing%20the%20process%20to%20hang%20at%200%25%20and%2C%20after%20pause/resume%2C%20duplicate%20chunks%20%28with%20old%20ones%20enabled%20and%20new%20ones%20disabled%29%20are%20left%20behind%20instead%20of%20being%20replaced%20as%20expected.%20This%20affects%20both%20API%20and%20UI%20flows%20and%20is%20reproducible%20across%20environments%20%5B%5Bsource%5D%28https%3A//github.com/langgenius/dify/issues/1542%29%5D.%0A%0AThere%E2%80%99s%20no%20official%20workaround%20documented%20yet.%20Avoid%20pausing/resuming%20indexing%20if%20possible%2C%20as%20this%20seems%20to%20trigger%20the%20duplication.%20If%20you%20need%20to%20clean%20up%2C%20you%20may%20have%20to%20manually%20delete%20disabled%20or%20duplicate%20chunks%20from%20the%20KB.%20If%20you%E2%80%99re%20troubleshooting%2C%20collect%20logs%20from%20the%20backend%20%28especially%20around%20document_indexing_update_task%20and%20segment/chunk%20state%20changes%29%20and%20share%20them%20in%20the%20main%20issue%20thread%20to%20help%20maintainers%20pinpoint%20the%20root%20cause%20%5B%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/365f749ed5794da584154a63eafaab9587f31343/api/tasks/document_indexing_update_task.py%23L19-L81%29%5D.%0A%0AThe%20maintainers%20are%20actively%20investigating%2C%20and%20the%20bug%20is%20linked%20to%20recent%20PRs%20that%20changed%20the%20embedding%20process%20and%20summary%20index%20features%20%5B%5Bsource%5D%28https%3A//github.com/langgenius/dify/pull/30622%29%5D.%20Keep%20an%20eye%20on%20the%20main%20issue%20for%20updates%20and%20fixes.)&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/31951)
Author
Owner

@kaiadachi commented on GitHub (Feb 4, 2026):

@dosu Thanks for the confirmation, but this is frustrating.

We're paying customers using Dify Cloud for production, and this regression has completely broken our KB update workflow. Our end users are now stuck with outdated information.

A core feature like document re-indexing shouldn't break in a production release. This needs to be fixed ASAP.

Please notify me when a fix is available.

@kaiadachi commented on GitHub (Feb 4, 2026): @dosu Thanks for the confirmation, but this is frustrating. We're paying customers using Dify Cloud for production, and this regression has completely broken our KB update workflow. Our end users are now stuck with outdated information. A core feature like document re-indexing shouldn't break in a production release. This needs to be fixed ASAP. Please notify me when a fix is available.
Author
Owner

@dosubot[bot] commented on GitHub (Feb 4, 2026):

I completely understand how disruptive this is, especially in a production environment. The regression with KB document re-indexing is a known issue and is being actively investigated by the maintainers, but there is no official fix or ETA yet. I can't send proactive notifications when a fix is released, but you can stay updated by subscribing to the main GitHub issue thread—any progress or release notes will be posted there as soon as they're available. This bug is a top priority due to its impact on production workflows, and updates will be communicated in the main issue thread as soon as a resolution is ready.

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 (Feb 4, 2026): <!-- Answer --> I completely understand how disruptive this is, especially in a production environment. The regression with KB document re-indexing is a known issue and is being actively investigated by the maintainers, but there is no official fix or ETA yet. I can't send proactive notifications when a fix is released, but you can stay updated by subscribing to the main GitHub issue thread—any progress or release notes will be posted there as soon as they're available. This bug is a top priority due to its impact on production workflows, and updates will be communicated in the main issue thread as soon as a resolution is ready. <!-- 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/fb9431bc-516b-4e05-8519-8d6a69ffc163?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fb9431bc-516b-4e05-8519-8d6a69ffc163?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fb9431bc-516b-4e05-8519-8d6a69ffc163?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fb9431bc-516b-4e05-8519-8d6a69ffc163?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fb9431bc-516b-4e05-8519-8d6a69ffc163?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/fb9431bc-516b-4e05-8519-8d6a69ffc163?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fb9431bc-516b-4e05-8519-8d6a69ffc163?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=I%20completely%20understand%20how%20disruptive%20this%20is%2C%20especially%20in%20a%20production%20environment.%20The%20regression%20with%20KB%20document%20re-indexing%20is%20a%20known%20issue%20and%20is%20being%20actively%20investigated%20by%20the%20maintainers%2C%20but%20there%20is%20no%20official%20fix%20or%20ETA%20yet.%20I%20can%27t%20send%20proactive%20notifications%20when%20a%20fix%20is%20released%2C%20but%20you%20can%20stay%20updated%20by%20subscribing%20to%20the%20main%20GitHub%20issue%20thread%E2%80%94any%20progress%20or%20release%20notes%20will%20be%20posted%20there%20as%20soon%20as%20they%27re%20available.%20This%20bug%20is%20a%20top%20priority%20due%20to%20its%20impact%20on%20production%20workflows%2C%20and%20updates%20will%20be%20communicated%20in%20the%20main%20issue%20thread%20as%20soon%20as%20a%20resolution%20is%20ready.)&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/31951)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#22071