Dataset name duplication when using the same file #20903

Closed
opened 2026-02-21 20:09:44 -05:00 by yindo · 1 comment
Owner

Originally created by @nht1206 on GitHub (Dec 9, 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. Create a Knowledge Base using a specific file (e.g. file_name.docx).
  2. Create another one using the exact same file.
  3. Go to the one of these Knowledge Bases.
  4. Attemp to edit a field (e.g Description) and click "Save"

✔️ Expected Behavior

  1. Should allow users to save changes to the settings without throwing a name validation error.
  2. Automatically ensure unique names (e.g., file_name.docx..., file_name.docx... 1) same as knowledge pipelines

Actual Behavior

Returns the error: Dataset name already exists

Originally created by @nht1206 on GitHub (Dec 9, 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. Create a Knowledge Base using a specific file (e.g. `file_name.docx`). 2. Create another one using the exact same file. 3. Go to the one of these Knowledge Bases. 4. Attemp to edit a field (e.g Description) and click "Save" ### ✔️ Expected Behavior 1. Should allow users to save changes to the settings without throwing a name validation error. 2. Automatically ensure unique names (e.g., `file_name.docx...`, `file_name.docx... 1`) same as knowledge pipelines ### ❌ Actual Behavior Returns the error: `Dataset name already exists`
yindo added the 🐞 bug label 2026-02-21 20:09:44 -05:00
yindo closed this issue 2026-02-21 20:09:44 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 9, 2025):

The "Dataset name already exists" error happens because Dify enforces unique dataset names for knowledge bases. When you edit a knowledge base, the backend checks if another dataset with the same name exists for your tenant—even if you're only changing the description. If the frontend re-submits the same name (which often happens), the update fails if a duplicate exists. This logic is in the DatasetService and strictly blocks duplicates without auto-renaming or suffixing names for uniqueness, unlike knowledge pipelines, which generate unique names like "Untitled 1", "Untitled 2" if needed. So, the current behavior is by design and not a bug in validation logic—it's just stricter for knowledge bases than for pipelines.

There isn't an official workaround in 1.10.1, but you can avoid this error by manually ensuring each knowledge base has a unique name before saving changes. Bringing the auto-increment naming logic from pipelines into general knowledge base creation would improve this experience, but it's not implemented yet. For reference, see the relevant code and logic here and here.

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 (Dec 9, 2025): <!-- Answer --> The "Dataset name already exists" error happens because Dify enforces unique dataset names for knowledge bases. When you edit a knowledge base, the backend checks if another dataset with the same name exists for your tenant—even if you're only changing the description. If the frontend re-submits the same name (which often happens), the update fails if a duplicate exists. This logic is in the DatasetService and strictly blocks duplicates without auto-renaming or suffixing names for uniqueness, unlike knowledge pipelines, which generate unique names like "Untitled 1", "Untitled 2" if needed. So, the current behavior is by design and not a bug in validation logic—it's just stricter for knowledge bases than for pipelines. There isn't an official workaround in 1.10.1, but you can avoid this error by manually ensuring each knowledge base has a unique name before saving changes. Bringing the auto-increment naming logic from pipelines into general knowledge base creation would improve this experience, but it's not implemented yet. For reference, see the relevant code and logic [here](https://github.com/langgenius/dify/blob/56f8bdd724765b2d28f3041af9b1acdb375a3bd3/api/services/dataset_service.py#L198-L457) and [here](https://github.com/langgenius/dify/blob/56f8bdd724765b2d28f3041af9b1acdb375a3bd3/api/services/rag_pipeline/rag_pipeline_dsl_service.py#L911-L945). <!-- 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/6c27f8e0-7964-4ff6-871a-0adaa6ef3b5b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/6c27f8e0-7964-4ff6-871a-0adaa6ef3b5b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/6c27f8e0-7964-4ff6-871a-0adaa6ef3b5b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/6c27f8e0-7964-4ff6-871a-0adaa6ef3b5b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6c27f8e0-7964-4ff6-871a-0adaa6ef3b5b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/6c27f8e0-7964-4ff6-871a-0adaa6ef3b5b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6c27f8e0-7964-4ff6-871a-0adaa6ef3b5b?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=The%20%22Dataset%20name%20already%20exists%22%20error%20happens%20because%20Dify%20enforces%20unique%20dataset%20names%20for%20knowledge%20bases.%20When%20you%20edit%20a%20knowledge%20base%2C%20the%20backend%20checks%20if%20another%20dataset%20with%20the%20same%20name%20exists%20for%20your%20tenant%E2%80%94even%20if%20you%27re%20only%20changing%20the%20description.%20If%20the%20frontend%20re-submits%20the%20same%20name%20%28which%20often%20happens%29%2C%20the%20update%20fails%20if%20a%20duplicate%20exists.%20This%20logic%20is%20in%20the%20DatasetService%20and%20strictly%20blocks%20duplicates%20without%20auto-renaming%20or%20suffixing%20names%20for%20uniqueness%2C%20unlike%20knowledge%20pipelines%2C%20which%20generate%20unique%20names%20like%20%22Untitled%201%22%2C%20%22Untitled%202%22%20if%20needed.%20So%2C%20the%20current%20behavior%20is%20by%20design%20and%20not%20a%20bug%20in%20validation%20logic%E2%80%94it%27s%20just%20stricter%20for%20knowledge%20bases%20than%20for%20pipelines.%20%0A%0AThere%20isn%27t%20an%20official%20workaround%20in%201.10.1%2C%20but%20you%20can%20avoid%20this%20error%20by%20manually%20ensuring%20each%20knowledge%20base%20has%20a%20unique%20name%20before%20saving%20changes.%20Bringing%20the%20auto-increment%20naming%20logic%20from%20pipelines%20into%20general%20knowledge%20base%20creation%20would%20improve%20this%20experience%2C%20but%20it%27s%20not%20implemented%20yet.%20For%20reference%2C%20see%20the%20relevant%20code%20and%20logic%20%5Bhere%5D%28https%3A//github.com/langgenius/dify/blob/56f8bdd724765b2d28f3041af9b1acdb375a3bd3/api/services/dataset_service.py%23L198-L457%29%20and%20%5Bhere%5D%28https%3A//github.com/langgenius/dify/blob/56f8bdd724765b2d28f3041af9b1acdb375a3bd3/api/services/rag_pipeline/rag_pipeline_dsl_service.py%23L911-L945%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/29363)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20903