Knowledge dataset: document created with empty content #20598

Closed
opened 2026-02-21 20:08:06 -05:00 by yindo · 11 comments
Owner

Originally created by @talenhon on GitHub (Nov 26, 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

v1.10.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Using Postman to upload create_by_text to the dify knowledge.
    curl --location --globoff 'https://api.dify.com/v1/datasets/{data_set_id}/document/create_by_text' \ --header 'Authorization: Bearer {auth}' \ --header 'Content-Type: application/json' \ --data '{"name": "text","text": "text","indexing_technique": "high_quality","process_rule": {"mode": "automatic"}, "doc_form": "hierarchical_model", "doc_language": "English"}'

  2. Go to dify knowledge, showing 0 in the words

Image

✔️ Expected Behavior

When using Dify API create_by_text / upload_by_file, document is created with content.

Actual Behavior

When using Dify API create_by_text / upload_by_file, document is created with empty content (words).

Image
Originally created by @talenhon on GitHub (Nov 26, 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 v1.10.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Using Postman to upload create_by_text to the dify knowledge. `curl --location --globoff 'https://api.dify.com/v1/datasets/{data_set_id}/document/create_by_text' \ --header 'Authorization: Bearer {auth}' \ --header 'Content-Type: application/json' \ --data '{"name": "text","text": "text","indexing_technique": "high_quality","process_rule": {"mode": "automatic"}, "doc_form": "hierarchical_model", "doc_language": "English"}'` 3. Go to dify knowledge, showing 0 in the words <img width="889" height="579" alt="Image" src="https://github.com/user-attachments/assets/a3acd71a-9eac-4f55-bea5-f565741a86fa" /> ### ✔️ Expected Behavior When using Dify API create_by_text / upload_by_file, document is created with content. ### ❌ Actual Behavior When using Dify API create_by_text / upload_by_file, document is created with empty content (words). <img width="1367" height="179" alt="Image" src="https://github.com/user-attachments/assets/12b8929c-f04b-44df-8d56-6a440bca2c9a" />
yindo added the 🐞 bug label 2026-02-21 20:08:06 -05:00
yindo closed this issue 2026-02-21 20:08:06 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 26, 2025):

This issue is almost always caused by a problem in the asynchronous document processing pipeline. When you use the API to create a document, Dify saves the file and creates a document entry immediately, but the actual content extraction and word count update happen later in a background Celery worker. If that worker fails, is not running, or can't access required resources, the document stays empty (zero words) in the UI.

Common causes include: the vector database container (like Weaviate) is missing or misconfigured, the Celery worker is not running, Python or locale dependencies are missing in the worker container, or the embedding provider API key (e.g., OPENAI_API_KEY) is not set. Any of these will break the indexing pipeline and result in empty documents, even though the API returns 200 OK and the file is uploaded successfully. See the detailed breakdown and troubleshooting steps here: dify-docs issue #397.

To fix:

  • Make sure your vector DB container is running and healthy, and that VECTOR_STORE env vars match across all services.
  • Confirm the Celery worker is running (docker compose ps should show it as healthy).
  • Check that all Python and locale dependencies are installed in the worker container (no locale or Python errors in logs).
  • Ensure OPENAI_API_KEY is set in the API and worker containers.
  • Inspect logs for errors in the API, worker, and vector DB containers, especially around document indexing and extraction.
  • Try uploading a small file and watch the logs and UI for indexing progress.

If the problem persists after these checks, collect logs from the worker and API containers during a document upload and share them for further diagnosis.

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 (Nov 26, 2025): <!-- Answer --> This issue is almost always caused by a problem in the asynchronous document processing pipeline. When you use the API to create a document, Dify saves the file and creates a document entry immediately, but the actual content extraction and word count update happen later in a background Celery worker. If that worker fails, is not running, or can't access required resources, the document stays empty (zero words) in the UI. Common causes include: the vector database container (like Weaviate) is missing or misconfigured, the Celery worker is not running, Python or locale dependencies are missing in the worker container, or the embedding provider API key (e.g., `OPENAI_API_KEY`) is not set. Any of these will break the indexing pipeline and result in empty documents, even though the API returns 200 OK and the file is uploaded successfully. See the detailed breakdown and troubleshooting steps here: [dify-docs issue #397](https://github.com/langgenius/dify-docs/issues/397). To fix: - Make sure your vector DB container is running and healthy, and that `VECTOR_STORE` env vars match across all services. - Confirm the Celery worker is running (`docker compose ps` should show it as healthy). - Check that all Python and locale dependencies are installed in the worker container (no locale or Python errors in logs). - Ensure `OPENAI_API_KEY` is set in the API and worker containers. - Inspect logs for errors in the API, worker, and vector DB containers, especially around document indexing and extraction. - Try uploading a small file and watch the logs and UI for indexing progress. If the problem persists after these checks, collect logs from the worker and API containers during a document upload and share them for further diagnosis. <!-- 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/43431e13-c089-4c57-851b-263aee03499c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/43431e13-c089-4c57-851b-263aee03499c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/43431e13-c089-4c57-851b-263aee03499c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/43431e13-c089-4c57-851b-263aee03499c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/43431e13-c089-4c57-851b-263aee03499c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/43431e13-c089-4c57-851b-263aee03499c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/43431e13-c089-4c57-851b-263aee03499c?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%20issue%20is%20almost%20always%20caused%20by%20a%20problem%20in%20the%20asynchronous%20document%20processing%20pipeline.%20When%20you%20use%20the%20API%20to%20create%20a%20document%2C%20Dify%20saves%20the%20file%20and%20creates%20a%20document%20entry%20immediately%2C%20but%20the%20actual%20content%20extraction%20and%20word%20count%20update%20happen%20later%20in%20a%20background%20Celery%20worker.%20If%20that%20worker%20fails%2C%20is%20not%20running%2C%20or%20can%27t%20access%20required%20resources%2C%20the%20document%20stays%20empty%20%28zero%20words%29%20in%20the%20UI.%0A%0ACommon%20causes%20include%3A%20the%20vector%20database%20container%20%28like%20Weaviate%29%20is%20missing%20or%20misconfigured%2C%20the%20Celery%20worker%20is%20not%20running%2C%20Python%20or%20locale%20dependencies%20are%20missing%20in%20the%20worker%20container%2C%20or%20the%20embedding%20provider%20API%20key%20%28e.g.%2C%20%60OPENAI_API_KEY%60%29%20is%20not%20set.%20Any%20of%20these%20will%20break%20the%20indexing%20pipeline%20and%20result%20in%20empty%20documents%2C%20even%20though%20the%20API%20returns%20200%20OK%20and%20the%20file%20is%20uploaded%20successfully.%20See%20the%20detailed%20breakdown%20and%20troubleshooting%20steps%20here%3A%20%5Bdify-docs%20issue%20%23397%5D%28https%3A//github.com/langgenius/dify-docs/issues/397%29.%0A%0ATo%20fix%3A%0A-%20Make%20sure%20your%20vector%20DB%20container%20is%20running%20and%20healthy%2C%20and%20that%20%60VECTOR_STORE%60%20env%20vars%20match%20across%20all%20services.%0A-%20Confirm%20the%20Celery%20worker%20is%20running%20%28%60docker%20compose%20ps%60%20should%20show%20it%20as%20healthy%29.%0A-%20Check%20that%20all%20Python%20and%20locale%20dependencies%20are%20installed%20in%20the%20worker%20container%20%28no%20locale%20or%20Python%20errors%20in%20logs%29.%0A-%20Ensure%20%60OPENAI_API_KEY%60%20is%20set%20in%20the%20API%20and%20worker%20containers.%0A-%20Inspect%20logs%20for%20errors%20in%20the%20API%2C%20worker%2C%20and%20vector%20DB%20containers%2C%20especially%20around%20document%20indexing%20and%20extraction.%0A-%20Try%20uploading%20a%20small%20file%20and%20watch%20the%20logs%20and%20UI%20for%20indexing%20progress.%0A%0AIf%20the%20problem%20persists%20after%20these%20checks%2C%20collect%20logs%20from%20the%20worker%20and%20API%20containers%20during%20a%20document%20upload%20and%20share%20them%20for%20further%20diagnosis.)&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/28763)
Author
Owner

@talenhon commented on GitHub (Nov 27, 2025):

@dosu
Tried below two scenarios,

  1. Upload file within UI: Upload a txt file to the same dataset, document successfully uploaded, with chunks and results are able to capture.
  2. Update text using api: upload the text to the same dataset. document is created with empty content (0 words).
Image
@talenhon commented on GitHub (Nov 27, 2025): @dosu Tried below two scenarios, 1. Upload file within UI: Upload a txt file to the same dataset, document successfully uploaded, with chunks and results are able to capture. 2. Update text using api: upload the text to the same dataset. document is created with empty content (0 words). <img width="1354" height="215" alt="Image" src="https://github.com/user-attachments/assets/5eb907a6-07e7-4445-ab52-d022f030cea6" />
Author
Owner

@dosubot[bot] commented on GitHub (Nov 27, 2025):

Your UI and API uploads both use the same backend pipeline, so if UI uploads work but API uploads create empty documents, it's almost always due to either (1) a problem with the API payload or (2) the Celery worker not listening on the correct queues.

First, double-check your API payload: both the "name" and "text" fields must be present and non-empty. Recent backend changes strictly validate these fields—if "name" is missing when "text" is provided, the backend will silently skip content extraction, resulting in an empty document even if the API call returns 200 OK. Make sure your JSON looks like:

{
  "name": "your_filename.txt",
  "text": "your file content here",
  "indexing_technique": "high_quality",
  "process_rule": {"mode": "automatic"},
  "doc_form": "hierarchical_model",
  "doc_language": "English"
}

See the stricter validation logic here: source.

Second, confirm your Celery worker is running and listening on both the dataset and priority_dataset queues. If the worker is not started with these queues, document indexing tasks from API uploads will not be processed, and the documents will stay empty. The default Docker setup should include these queues, but if you override CELERY_QUEUES or CELERY_WORKER_QUEUES, make sure they include at least "dataset,priority_dataset" (source).

If both the payload and worker queues are correct, check your worker logs for any validation or processing errors right after an API upload. If you see errors about missing fields or failed extraction, that's the root cause.

Let me know if you want help reviewing your exact API payload or worker logs.

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 (Nov 27, 2025): <!-- Answer --> Your UI and API uploads both use the same backend pipeline, so if UI uploads work but API uploads create empty documents, it's almost always due to either (1) a problem with the API payload or (2) the Celery worker not listening on the correct queues. First, double-check your API payload: both the "name" and "text" fields must be present and non-empty. Recent backend changes strictly validate these fields—if "name" is missing when "text" is provided, the backend will silently skip content extraction, resulting in an empty document even if the API call returns 200 OK. Make sure your JSON looks like: ```json { "name": "your_filename.txt", "text": "your file content here", "indexing_technique": "high_quality", "process_rule": {"mode": "automatic"}, "doc_form": "hierarchical_model", "doc_language": "English" } ``` See the stricter validation logic here: [source](https://github.com/langgenius/dify/pull/28236). Second, confirm your Celery worker is running and listening on both the dataset and priority_dataset queues. If the worker is not started with these queues, document indexing tasks from API uploads will not be processed, and the documents will stay empty. The default Docker setup should include these queues, but if you override CELERY_QUEUES or CELERY_WORKER_QUEUES, make sure they include at least "dataset,priority_dataset" ([source](https://github.com/langgenius/dify/blob/58f448a926174fa90a2d971432dacb218a990c11/api/docker/entrypoint.sh#L22-L68)). If both the payload and worker queues are correct, check your worker logs for any validation or processing errors right after an API upload. If you see errors about missing fields or failed extraction, that's the root cause. Let me know if you want help reviewing your exact API payload or worker logs. <!-- 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/4e3afaeb-0843-48db-80d9-87b9e10eb5dd?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4e3afaeb-0843-48db-80d9-87b9e10eb5dd?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4e3afaeb-0843-48db-80d9-87b9e10eb5dd?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4e3afaeb-0843-48db-80d9-87b9e10eb5dd?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4e3afaeb-0843-48db-80d9-87b9e10eb5dd?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4e3afaeb-0843-48db-80d9-87b9e10eb5dd?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4e3afaeb-0843-48db-80d9-87b9e10eb5dd?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=Your%20UI%20and%20API%20uploads%20both%20use%20the%20same%20backend%20pipeline%2C%20so%20if%20UI%20uploads%20work%20but%20API%20uploads%20create%20empty%20documents%2C%20it%27s%20almost%20always%20due%20to%20either%20%281%29%20a%20problem%20with%20the%20API%20payload%20or%20%282%29%20the%20Celery%20worker%20not%20listening%20on%20the%20correct%20queues.%0A%0AFirst%2C%20double-check%20your%20API%20payload%3A%20both%20the%20%22name%22%20and%20%22text%22%20fields%20must%20be%20present%20and%20non-empty.%20Recent%20backend%20changes%20strictly%20validate%20these%20fields%E2%80%94if%20%22name%22%20is%20missing%20when%20%22text%22%20is%20provided%2C%20the%20backend%20will%20silently%20skip%20content%20extraction%2C%20resulting%20in%20an%20empty%20document%20even%20if%20the%20API%20call%20returns%20200%20OK.%20Make%20sure%20your%20JSON%20looks%20like%3A%0A%60%60%60json%0A%7B%0A%20%20%22name%22%3A%20%22your_filename.txt%22%2C%0A%20%20%22text%22%3A%20%22your%20file%20content%20here%22%2C%0A%20%20%22indexing_technique%22%3A%20%22high_quality%22%2C%0A%20%20%22process_rule%22%3A%20%7B%22mode%22%3A%20%22automatic%22%7D%2C%0A%20%20%22doc_form%22%3A%20%22hierarchical_model%22%2C%0A%20%20%22doc_language%22%3A%20%22English%22%0A%7D%0A%60%60%60%0ASee%20the%20stricter%20validation%20logic%20here%3A%20%5Bsource%5D%28https%3A//github.com/langgenius/dify/pull/28236%29.%0A%0ASecond%2C%20confirm%20your%20Celery%20worker%20is%20running%20and%20listening%20on%20both%20the%20dataset%20and%20priority_dataset%20queues.%20If%20the%20worker%20is%20not%20started%20with%20these%20queues%2C%20document%20indexing%20tasks%20from%20API%20uploads%20will%20not%20be%20processed%2C%20and%20the%20documents%20will%20stay%20empty.%20The%20default%20Docker%20setup%20should%20include%20these%20queues%2C%20but%20if%20you%20override%20CELERY_QUEUES%20or%20CELERY_WORKER_QUEUES%2C%20make%20sure%20they%20include%20at%20least%20%22dataset%2Cpriority_dataset%22%20%28%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/58f448a926174fa90a2d971432dacb218a990c11/api/docker/entrypoint.sh%23L22-L68%29%29.%0A%0AIf%20both%20the%20payload%20and%20worker%20queues%20are%20correct%2C%20check%20your%20worker%20logs%20for%20any%20validation%20or%20processing%20errors%20right%20after%20an%20API%20upload.%20If%20you%20see%20errors%20about%20missing%20fields%20or%20failed%20extraction%2C%20that%27s%20the%20root%20cause.%0A%0ALet%20me%20know%20if%20you%20want%20help%20reviewing%20your%20exact%20API%20payload%20or%20worker%20logs.)&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/28763)
Author
Owner

@talenhon commented on GitHub (Nov 27, 2025):

@dosu
Here's the request body: both the "name" and "text" fields must be present and non-empty

{
    "name": "text",
    "text": "text",
    "indexing_technique": "high_quality",
    "process_rule": {"mode": "automatic"},
    "doc_form": "hierarchical_model",
    "doc_language": "English"
}

And the response: 200 with norms

{
    "document": {
        "id": "dc065bc3-e1da-443d-b369-fad58cd184fd",
        "position": 4,
        "data_source_type": "upload_file",
        "data_source_info": {
            "upload_file_id": "6fce037a-2002-4067-8358-bd688db7a6b2"
        },
        "data_source_detail_dict": {
            "upload_file": {
                "id": "6fce037a-2002-4067-8358-bd688db7a6b2",
                "name": "text",
                "size": 4,
                "extension": "txt",
                "mime_type": "text/plain",
                "created_by": "72c3d0a8-7f75-4420-93d1-f874225dbcbd",
                "created_at": 1764225816.066173
            }
        },
        "dataset_process_rule_id": "1c531502-4338-4f19-917b-d4ccb545d381",
        "name": "text",
        "created_from": "api",
        "created_by": "72c3d0a8-7f75-4420-93d1-f874225dbcbd",
        "created_at": 1764213476,
        "tokens": 0,
        "indexing_status": "parsing",
        "error": null,
        "enabled": true,
        "disabled_at": null,
        "disabled_by": null,
        "archived": false,
        "display_status": "indexing",
        "word_count": 0,
        "hit_count": 0,
        "doc_form": "hierarchical_model",
        "doc_metadata": [
            {
                "id": "built-in",
                "name": "document_name",
                "type": "string",
                "value": "text"
            },
            {
                "id": "built-in",
                "name": "uploader",
                "type": "string",
                "value": "talenhon"
            },
            {
                "id": "built-in",
                "name": "upload_date",
                "type": "time",
                "value": "1764213476.0"
            },
            {
                "id": "built-in",
                "name": "last_update_date",
                "type": "time",
                "value": "1764225816.188019"
            },
            {
                "id": "built-in",
                "name": "source",
                "type": "string",
                "value": "file_upload"
            }
        ]
    },
    "batch": "20251127064336633034"
}

Worker Log -- No error

2025-11-27 10:30:55.699 INFO [MainThread] [strategy.py:161] - Task tasks.document_indexing_task.priority_document_indexing_task[cf250bc9-b9c4-4c8d-854a-32a5ac08a01e] received
2025-11-27 10:30:55.700 INFO [Dummy-450] [document_indexing_task.py:167] - priority document indexing task received: 12763198-a92e-4b38-b350-9555e78f8aba - d55317b7-627a-4442-a09b-b1a74b9dd4c0 - ['1635f1fa-3338-46b1-b3e1-ca96efb86c62']
2025-11-27 10:30:55.702 INFO [Dummy-450] [document_indexing_task.py:85] - Start process document: 1635f1fa-3338-46b1-b3e1-ca96efb86c62
2025-11-27 10:30:55.850 INFO [Dummy-450] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-11-27 10:30:55.925 INFO [Dummy-450] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/dispatch/text_embedding/num_tokens "HTTP/1.1 200 OK"
2025-11-27 10:30:55.981 INFO [Dummy-450] [document_indexing_task.py:102] - Processed dataset: d55317b7-627a-4442-a09b-b1a74b9dd4c0 latency: 0.2808062300318852
2025-11-27 10:30:55.981 INFO [Dummy-450] [document_indexing_task.py:125] - document indexing tenant isolation queue next tasks: []
2025-11-27 10:30:56.015 INFO [Dummy-450] [trace.py:128] - Task tasks.document_indexing_task.priority_document_indexing_task[cf250bc9-b9c4-4c8d-854a-32a5ac08a01e] succeeded in 0.3156577539630234s: None
2025-11-27 10:31:07.682 INFO [MainThread] [strategy.py:161] - Task schedule.workflow_schedule_task.poll_workflow_schedules[79bc64ba-3bc9-4463-84bc-8a0ec735f446] received
2025-11-27 10:31:07.719 INFO [Dummy-451] [trace.py:128] - Task schedule.workflow_schedule_task.poll_workflow_schedules[79bc64ba-3bc9-4463-84bc-8a0ec735f446] succeeded in 0.03594772703945637s: None

Here's From the UI console

# NAME CHUNKING MODE WORDS RETRIEVAL COUNT UPLOAD TIME STATUS ACTION
1 text Parent-child 0 0 11/27/2025 06:30 PM Available
@talenhon commented on GitHub (Nov 27, 2025): @dosu Here's the request body: both the "name" and "text" fields must be present and non-empty ``` { "name": "text", "text": "text", "indexing_technique": "high_quality", "process_rule": {"mode": "automatic"}, "doc_form": "hierarchical_model", "doc_language": "English" } ``` And the response: 200 with norms ``` { "document": { "id": "dc065bc3-e1da-443d-b369-fad58cd184fd", "position": 4, "data_source_type": "upload_file", "data_source_info": { "upload_file_id": "6fce037a-2002-4067-8358-bd688db7a6b2" }, "data_source_detail_dict": { "upload_file": { "id": "6fce037a-2002-4067-8358-bd688db7a6b2", "name": "text", "size": 4, "extension": "txt", "mime_type": "text/plain", "created_by": "72c3d0a8-7f75-4420-93d1-f874225dbcbd", "created_at": 1764225816.066173 } }, "dataset_process_rule_id": "1c531502-4338-4f19-917b-d4ccb545d381", "name": "text", "created_from": "api", "created_by": "72c3d0a8-7f75-4420-93d1-f874225dbcbd", "created_at": 1764213476, "tokens": 0, "indexing_status": "parsing", "error": null, "enabled": true, "disabled_at": null, "disabled_by": null, "archived": false, "display_status": "indexing", "word_count": 0, "hit_count": 0, "doc_form": "hierarchical_model", "doc_metadata": [ { "id": "built-in", "name": "document_name", "type": "string", "value": "text" }, { "id": "built-in", "name": "uploader", "type": "string", "value": "talenhon" }, { "id": "built-in", "name": "upload_date", "type": "time", "value": "1764213476.0" }, { "id": "built-in", "name": "last_update_date", "type": "time", "value": "1764225816.188019" }, { "id": "built-in", "name": "source", "type": "string", "value": "file_upload" } ] }, "batch": "20251127064336633034" } ``` Worker Log -- No error ``` 2025-11-27 10:30:55.699 INFO [MainThread] [strategy.py:161] - Task tasks.document_indexing_task.priority_document_indexing_task[cf250bc9-b9c4-4c8d-854a-32a5ac08a01e] received 2025-11-27 10:30:55.700 INFO [Dummy-450] [document_indexing_task.py:167] - priority document indexing task received: 12763198-a92e-4b38-b350-9555e78f8aba - d55317b7-627a-4442-a09b-b1a74b9dd4c0 - ['1635f1fa-3338-46b1-b3e1-ca96efb86c62'] 2025-11-27 10:30:55.702 INFO [Dummy-450] [document_indexing_task.py:85] - Start process document: 1635f1fa-3338-46b1-b3e1-ca96efb86c62 2025-11-27 10:30:55.850 INFO [Dummy-450] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-11-27 10:30:55.925 INFO [Dummy-450] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/dispatch/text_embedding/num_tokens "HTTP/1.1 200 OK" 2025-11-27 10:30:55.981 INFO [Dummy-450] [document_indexing_task.py:102] - Processed dataset: d55317b7-627a-4442-a09b-b1a74b9dd4c0 latency: 0.2808062300318852 2025-11-27 10:30:55.981 INFO [Dummy-450] [document_indexing_task.py:125] - document indexing tenant isolation queue next tasks: [] 2025-11-27 10:30:56.015 INFO [Dummy-450] [trace.py:128] - Task tasks.document_indexing_task.priority_document_indexing_task[cf250bc9-b9c4-4c8d-854a-32a5ac08a01e] succeeded in 0.3156577539630234s: None 2025-11-27 10:31:07.682 INFO [MainThread] [strategy.py:161] - Task schedule.workflow_schedule_task.poll_workflow_schedules[79bc64ba-3bc9-4463-84bc-8a0ec735f446] received 2025-11-27 10:31:07.719 INFO [Dummy-451] [trace.py:128] - Task schedule.workflow_schedule_task.poll_workflow_schedules[79bc64ba-3bc9-4463-84bc-8a0ec735f446] succeeded in 0.03594772703945637s: None ``` Here's From the UI console | # | NAME | CHUNKING MODE | WORDS | RETRIEVAL COUNT | UPLOAD TIME | STATUS | ACTION | | -- | -- | -- | -- | -- | -- | -- | -- | | 1 | text | Parent-child | 0 | 0 | 11/27/2025 06:30 PM | Available | |
Author
Owner

@dosubot[bot] commented on GitHub (Nov 27, 2025):

This behavior is expected with such a minimal payload. Dify's indexing pipeline skips segments if the cleaned or split content is empty or trivial—very short text like "text" often results in zero segments, so the document appears empty even though the API call succeeds and the worker logs show no errors. This is by design: the segmenter drops nodes where the content is empty or only whitespace after cleaning and splitting.

To confirm, try uploading a longer, more substantial text via the API. If the document then shows a nonzero word count, the system is working as intended for non-trivial content. If longer texts also result in empty documents, let me know and we can dig into configuration or environment issues (like storage, FILES_URL, or worker queues).

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 (Nov 27, 2025): <!-- Answer --> This behavior is expected with such a minimal payload. Dify's indexing pipeline skips segments if the cleaned or split content is empty or trivial—very short text like "text" often results in zero segments, so the document appears empty even though the API call succeeds and the worker logs show no errors. This is by design: the segmenter drops nodes where the content is empty or only whitespace after cleaning and splitting. To confirm, try uploading a longer, more substantial text via the API. If the document then shows a nonzero word count, the system is working as intended for non-trivial content. If longer texts also result in empty documents, let me know and we can dig into configuration or environment issues (like storage, FILES_URL, or worker queues). <!-- 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/93c268ba-df5c-4409-987a-927aa5df2373?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/93c268ba-df5c-4409-987a-927aa5df2373?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/93c268ba-df5c-4409-987a-927aa5df2373?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/93c268ba-df5c-4409-987a-927aa5df2373?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/93c268ba-df5c-4409-987a-927aa5df2373?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/93c268ba-df5c-4409-987a-927aa5df2373?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/93c268ba-df5c-4409-987a-927aa5df2373?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%20behavior%20is%20expected%20with%20such%20a%20minimal%20payload.%20Dify%27s%20indexing%20pipeline%20skips%20segments%20if%20the%20cleaned%20or%20split%20content%20is%20empty%20or%20trivial%E2%80%94very%20short%20text%20like%20%22text%22%20often%20results%20in%20zero%20segments%2C%20so%20the%20document%20appears%20empty%20even%20though%20the%20API%20call%20succeeds%20and%20the%20worker%20logs%20show%20no%20errors.%20This%20is%20by%20design%3A%20the%20segmenter%20drops%20nodes%20where%20the%20content%20is%20empty%20or%20only%20whitespace%20after%20cleaning%20and%20splitting.%0A%0ATo%20confirm%2C%20try%20uploading%20a%20longer%2C%20more%20substantial%20text%20via%20the%20API.%20If%20the%20document%20then%20shows%20a%20nonzero%20word%20count%2C%20the%20system%20is%20working%20as%20intended%20for%20non-trivial%20content.%20If%20longer%20texts%20also%20result%20in%20empty%20documents%2C%20let%20me%20know%20and%20we%20can%20dig%20into%20configuration%20or%20environment%20issues%20%28like%20storage%2C%20FILES_URL%2C%20or%20worker%20queues%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/28763)
Author
Owner

@talenhon commented on GitHub (Nov 27, 2025):

@dosu Tried a long one

{"name": "IELTS","text": "We are all explorers. Our desire to discover, and then share that new-found knowledge, is part of what makes us human – indeed, this has played an important part in our success as a species. Long before the first caveman slumped down beside the fire and grunted news that there were plenty of wildebeest over yonder, our ancestors had learnt the value of sending out scouts to investigate the unknown. This questing nature of ours undoubtedly helped our species spread around the globe, just as it nowadays no doubt helps the last nomadic Penan maintain their existence in the depleted forests of Borneo, and a visitor negotiate the subways of New York.\n\nOver the years, we’ve come to think of explorers as a peculiar breed – different from the rest of us, different from those of us who are merely ‘well travelled’, even; and perhaps there is a type of person more suited to seeking out the new, a type of caveman more inclined to risk venturing out. That, however, doesn’t take away from the fact that we all have this enquiring instinct, even today; and that in all sorts of professions – whether artist, marine biologist or astronomer – borders of the unknown are being tested each day.\n\nThomas Hardy set some of his novels in Egdon Heath, a fictional area of uncultivated land, and used the landscape to suggest the desires and fears of his characters. He is delving into matters we all recognise because they are common to humanity. This is surely an act of exploration, and into a world as remote as the author chooses. Explorer and travel writer Peter Fleming talks of the moment when the explorer returns to the existence he has left behind with his loved ones. The traveller ‘who has for weeks or months seen himself only as a puny and irrelevant alien crawling laboriously over a country in which he has no roots and no background, suddenly encounters his other self, a relatively solid figure, with a place in the minds of certain people’. \n\n","indexing_technique": "high_quality","process_rule": {"mode": "automatic"},    "doc_form": "hierarchical_model",
    "doc_language": "English"}

HTTP response:

{
    "document": {
        "id": "3fea1f57-597b-413c-b8c8-b458f5f4260c",
        "position": 4,
        "data_source_type": "upload_file",
        "data_source_info": {
            "upload_file_id": "e8cc08fe-1b60-4d13-9b21-80c9baa79933"
        },
        "data_source_detail_dict": {
            "upload_file": {
                "id": "e8cc08fe-1b60-4d13-9b21-80c9baa79933",
                "name": "IELTS",
                "size": 1954,
                "extension": "txt",
                "mime_type": "text/plain",
                "created_by": "72c3d0a8-7f75-4420-93d1-f874225dbcbd",
                "created_at": 1764259897.735305
            }
        },
        "dataset_process_rule_id": "e93cc0b6-77c6-4733-903b-dd80d0737124",
        "name": "IELTS",
        "created_from": "api",
        "created_by": "72c3d0a8-7f75-4420-93d1-f874225dbcbd",
        "created_at": 1764259898,
        "tokens": null,
        "indexing_status": "parsing",
        "error": null,
        "enabled": true,
        "disabled_at": null,
        "disabled_by": null,
        "archived": false,
        "display_status": "indexing",
        "word_count": null,
        "hit_count": 0,
        "doc_form": "hierarchical_model",
        "doc_metadata": [
            {
                "id": "built-in",
                "name": "document_name",
                "type": "string",
                "value": "IELTS"
            },
            {
                "id": "built-in",
                "name": "uploader",
                "type": "string",
                "value": "talenhon"
            },
            {
                "id": "built-in",
                "name": "upload_date",
                "type": "time",
                "value": "1764259898.0"
            },
            {
                "id": "built-in",
                "name": "last_update_date",
                "type": "time",
                "value": "1764259897.759809"
            },
            {
                "id": "built-in",
                "name": "source",
                "type": "string",
                "value": "file_upload"
            }
        ]
    },
    "batch": "20251127161137795537"
}

Worker Log

2025-11-27 16:11:37.758 INFO [MainThread] [strategy.py:161] - Task tasks.document_indexing_task.priority_document_indexing_task[832d00cd-b1ed-4461-adf5-e398a9773f48] received
2025-11-27 16:11:37.758 INFO [Dummy-820] [document_indexing_task.py:167] - priority document indexing task received: 12763198-a92e-4b38-b350-9555e78f8aba - d55317b7-627a-4442-a09b-b1a74b9dd4c0 - ['3fea1f57-597b-413c-b8c8-b458f5f4260c']
2025-11-27 16:11:37.761 INFO [Dummy-820] [document_indexing_task.py:85] - Start process document: 3fea1f57-597b-413c-b8c8-b458f5f4260c
2025-11-27 16:11:37.921 INFO [Dummy-820] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-11-27 16:11:37.998 INFO [Dummy-820] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/dispatch/text_embedding/num_tokens "HTTP/1.1 200 OK"
2025-11-27 16:11:38.045 INFO [Dummy-820] [document_indexing_task.py:102] - Processed dataset: d55317b7-627a-4442-a09b-b1a74b9dd4c0 latency: 0.2867944350000471
2025-11-27 16:11:38.046 INFO [Dummy-820] [document_indexing_task.py:125] - document indexing tenant isolation queue next tasks: []
2025-11-27 16:11:38.073 INFO [Dummy-820] [trace.py:128] - Task tasks.document_indexing_task.priority_document_indexing_task[832d00cd-b1ed-4461-adf5-e398a9773f48] succeeded in 0.315259046969004s: None
# NAME CHUNKING MODE WORDS RETRIEVAL COUNT UPLOAD TIME STATUS ACTION
1 IELTS Parent-child 0 0 11/28/2025 12:11 AM Available  
@talenhon commented on GitHub (Nov 27, 2025): @dosu Tried a long one ``` {"name": "IELTS","text": "We are all explorers. Our desire to discover, and then share that new-found knowledge, is part of what makes us human – indeed, this has played an important part in our success as a species. Long before the first caveman slumped down beside the fire and grunted news that there were plenty of wildebeest over yonder, our ancestors had learnt the value of sending out scouts to investigate the unknown. This questing nature of ours undoubtedly helped our species spread around the globe, just as it nowadays no doubt helps the last nomadic Penan maintain their existence in the depleted forests of Borneo, and a visitor negotiate the subways of New York.\n\nOver the years, we’ve come to think of explorers as a peculiar breed – different from the rest of us, different from those of us who are merely ‘well travelled’, even; and perhaps there is a type of person more suited to seeking out the new, a type of caveman more inclined to risk venturing out. That, however, doesn’t take away from the fact that we all have this enquiring instinct, even today; and that in all sorts of professions – whether artist, marine biologist or astronomer – borders of the unknown are being tested each day.\n\nThomas Hardy set some of his novels in Egdon Heath, a fictional area of uncultivated land, and used the landscape to suggest the desires and fears of his characters. He is delving into matters we all recognise because they are common to humanity. This is surely an act of exploration, and into a world as remote as the author chooses. Explorer and travel writer Peter Fleming talks of the moment when the explorer returns to the existence he has left behind with his loved ones. The traveller ‘who has for weeks or months seen himself only as a puny and irrelevant alien crawling laboriously over a country in which he has no roots and no background, suddenly encounters his other self, a relatively solid figure, with a place in the minds of certain people’. \n\n","indexing_technique": "high_quality","process_rule": {"mode": "automatic"}, "doc_form": "hierarchical_model", "doc_language": "English"} ``` HTTP response: ``` { "document": { "id": "3fea1f57-597b-413c-b8c8-b458f5f4260c", "position": 4, "data_source_type": "upload_file", "data_source_info": { "upload_file_id": "e8cc08fe-1b60-4d13-9b21-80c9baa79933" }, "data_source_detail_dict": { "upload_file": { "id": "e8cc08fe-1b60-4d13-9b21-80c9baa79933", "name": "IELTS", "size": 1954, "extension": "txt", "mime_type": "text/plain", "created_by": "72c3d0a8-7f75-4420-93d1-f874225dbcbd", "created_at": 1764259897.735305 } }, "dataset_process_rule_id": "e93cc0b6-77c6-4733-903b-dd80d0737124", "name": "IELTS", "created_from": "api", "created_by": "72c3d0a8-7f75-4420-93d1-f874225dbcbd", "created_at": 1764259898, "tokens": null, "indexing_status": "parsing", "error": null, "enabled": true, "disabled_at": null, "disabled_by": null, "archived": false, "display_status": "indexing", "word_count": null, "hit_count": 0, "doc_form": "hierarchical_model", "doc_metadata": [ { "id": "built-in", "name": "document_name", "type": "string", "value": "IELTS" }, { "id": "built-in", "name": "uploader", "type": "string", "value": "talenhon" }, { "id": "built-in", "name": "upload_date", "type": "time", "value": "1764259898.0" }, { "id": "built-in", "name": "last_update_date", "type": "time", "value": "1764259897.759809" }, { "id": "built-in", "name": "source", "type": "string", "value": "file_upload" } ] }, "batch": "20251127161137795537" } ``` Worker Log ``` 2025-11-27 16:11:37.758 INFO [MainThread] [strategy.py:161] - Task tasks.document_indexing_task.priority_document_indexing_task[832d00cd-b1ed-4461-adf5-e398a9773f48] received 2025-11-27 16:11:37.758 INFO [Dummy-820] [document_indexing_task.py:167] - priority document indexing task received: 12763198-a92e-4b38-b350-9555e78f8aba - d55317b7-627a-4442-a09b-b1a74b9dd4c0 - ['3fea1f57-597b-413c-b8c8-b458f5f4260c'] 2025-11-27 16:11:37.761 INFO [Dummy-820] [document_indexing_task.py:85] - Start process document: 3fea1f57-597b-413c-b8c8-b458f5f4260c 2025-11-27 16:11:37.921 INFO [Dummy-820] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-11-27 16:11:37.998 INFO [Dummy-820] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/dispatch/text_embedding/num_tokens "HTTP/1.1 200 OK" 2025-11-27 16:11:38.045 INFO [Dummy-820] [document_indexing_task.py:102] - Processed dataset: d55317b7-627a-4442-a09b-b1a74b9dd4c0 latency: 0.2867944350000471 2025-11-27 16:11:38.046 INFO [Dummy-820] [document_indexing_task.py:125] - document indexing tenant isolation queue next tasks: [] 2025-11-27 16:11:38.073 INFO [Dummy-820] [trace.py:128] - Task tasks.document_indexing_task.priority_document_indexing_task[832d00cd-b1ed-4461-adf5-e398a9773f48] succeeded in 0.315259046969004s: None ``` | # | NAME | CHUNKING MODE | WORDS | RETRIEVAL COUNT | UPLOAD TIME | STATUS | ACTION | | -- | -- | -- | -- | -- | -- | -- | -- | 1 | IELTS | Parent-child | 0 | 0 | 11/28/2025 12:11 AM | Available |   |
Author
Owner

@dosubot[bot] commented on GitHub (Nov 27, 2025):

Since uploading via the UI works but API uploads create empty documents (even with substantial text), the most likely cause is a storage access/configuration issue. In Dify, the worker processes API-uploaded files by reading them directly from the storage backend using the file key, not via HTTP or FILES_URL. If the worker container can't access the storage (e.g., local volume not mounted, wrong STORAGE_TYPE, or missing credentials for S3/Azure), extraction silently fails and the document remains empty—even if logs show no error and the API returns 200 OK. This is a known issue and matches other user reports where API-created files are empty or 0 bytes due to storage misconfiguration or missing volume mounts, while UI uploads work because the web server and worker share the same storage context (source).

To resolve:

  • Make sure both the API and worker containers have access to the same storage backend and, for local storage, the same mounted volume (e.g., ./volumes/app/storage:/app/api/storage).
  • After an API upload, exec into the worker container and check that the uploaded file exists and is non-empty at the expected path.
  • Double-check STORAGE_TYPE and related credentials in both containers.
  • If using S3/Azure/etc., verify the worker can access the storage service.

If all storage settings are correct and the problem persists, enable debug logging in the worker and check for silent extraction or storage errors during document indexing.

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 (Nov 27, 2025): <!-- Answer --> Since uploading via the UI works but API uploads create empty documents (even with substantial text), the most likely cause is a storage access/configuration issue. In Dify, the worker processes API-uploaded files by reading them directly from the storage backend using the file key, not via HTTP or FILES_URL. If the worker container can't access the storage (e.g., local volume not mounted, wrong STORAGE_TYPE, or missing credentials for S3/Azure), extraction silently fails and the document remains empty—even if logs show no error and the API returns 200 OK. This is a known issue and matches other user reports where API-created files are empty or 0 bytes due to storage misconfiguration or missing volume mounts, while UI uploads work because the web server and worker share the same storage context ([source](https://github.com/langgenius/dify/issues/22694)). To resolve: - Make sure both the API and worker containers have access to the same storage backend and, for local storage, the same mounted volume (e.g., `./volumes/app/storage:/app/api/storage`). - After an API upload, exec into the worker container and check that the uploaded file exists and is non-empty at the expected path. - Double-check STORAGE_TYPE and related credentials in both containers. - If using S3/Azure/etc., verify the worker can access the storage service. If all storage settings are correct and the problem persists, enable debug logging in the worker and check for silent extraction or storage errors during document indexing. <!-- 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/65637824-28ce-4fc5-8ced-ded06a474b50?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/65637824-28ce-4fc5-8ced-ded06a474b50?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/65637824-28ce-4fc5-8ced-ded06a474b50?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/65637824-28ce-4fc5-8ced-ded06a474b50?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/65637824-28ce-4fc5-8ced-ded06a474b50?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/65637824-28ce-4fc5-8ced-ded06a474b50?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/65637824-28ce-4fc5-8ced-ded06a474b50?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=Since%20uploading%20via%20the%20UI%20works%20but%20API%20uploads%20create%20empty%20documents%20%28even%20with%20substantial%20text%29%2C%20the%20most%20likely%20cause%20is%20a%20storage%20access/configuration%20issue.%20In%20Dify%2C%20the%20worker%20processes%20API-uploaded%20files%20by%20reading%20them%20directly%20from%20the%20storage%20backend%20using%20the%20file%20key%2C%20not%20via%20HTTP%20or%20FILES_URL.%20If%20the%20worker%20container%20can%27t%20access%20the%20storage%20%28e.g.%2C%20local%20volume%20not%20mounted%2C%20wrong%20STORAGE_TYPE%2C%20or%20missing%20credentials%20for%20S3/Azure%29%2C%20extraction%20silently%20fails%20and%20the%20document%20remains%20empty%E2%80%94even%20if%20logs%20show%20no%20error%20and%20the%20API%20returns%20200%20OK.%20This%20is%20a%20known%20issue%20and%20matches%20other%20user%20reports%20where%20API-created%20files%20are%20empty%20or%200%20bytes%20due%20to%20storage%20misconfiguration%20or%20missing%20volume%20mounts%2C%20while%20UI%20uploads%20work%20because%20the%20web%20server%20and%20worker%20share%20the%20same%20storage%20context%20%28%5Bsource%5D%28https%3A//github.com/langgenius/dify/issues/22694%29%29.%0A%0ATo%20resolve%3A%0A-%20Make%20sure%20both%20the%20API%20and%20worker%20containers%20have%20access%20to%20the%20same%20storage%20backend%20and%2C%20for%20local%20storage%2C%20the%20same%20mounted%20volume%20%28e.g.%2C%20%60./volumes/app/storage%3A/app/api/storage%60%29.%0A-%20After%20an%20API%20upload%2C%20exec%20into%20the%20worker%20container%20and%20check%20that%20the%20uploaded%20file%20exists%20and%20is%20non-empty%20at%20the%20expected%20path.%0A-%20Double-check%20STORAGE_TYPE%20and%20related%20credentials%20in%20both%20containers.%0A-%20If%20using%20S3/Azure/etc.%2C%20verify%20the%20worker%20can%20access%20the%20storage%20service.%0A%0AIf%20all%20storage%20settings%20are%20correct%20and%20the%20problem%20persists%2C%20enable%20debug%20logging%20in%20the%20worker%20and%20check%20for%20silent%20extraction%20or%20storage%20errors%20during%20document%20indexing.)&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/28763)
Author
Owner

@talenhon commented on GitHub (Nov 30, 2025):

@dosu

  1. API and worker containers have access to the same storage backend.

  2. Tried both opendl and s3, both storage shows upload complete with a upload file exist in the storage. (1.9kb in size)

  3. Enabled logging on worker

2025-12-01 01:15:34.440 INFO [MainThread] [strategy.py:161] - Task tasks.document_indexing_task.priority_document_indexing_task[a5c4b0d7-783f-47d5-9369-543606cdd1d9] received
2025-12-01 01:15:34.440 DEBUG [MainThread] [base.py:149] - TaskPool: Apply <function fast_trace_task at 0xffff7ff0fa60> (args:('tasks.document_indexing_task.priority_document_indexing_task', 'a5c4b0d7-783f-47d5-9369-543606cdd1d9', {'lang': 'py', 'task': 'tasks.document_indexing_task.priority_document_indexing_task', 'id': 'a5c4b0d7-783f-47d5-9369-543606cdd1d9', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'group_index': None, 'retries': 0, 'timelimit': [None, None], 'root_id': 'a5c4b0d7-783f-47d5-9369-543606cdd1d9', 'parent_id': None, 'argsrepr': '()', 'kwargsrepr': "{'tenant_id': '12763198-a92e-4b38-b350-9555e78f8aba', 'dataset_id': 'd55317b7-627a-4442-a09b-b1a74b9dd4c0', 'document_ids': ['bce58a44-a0d7-4e5a-9c93-ba5f31f84cc5']}", 'origin': 'gen18@019b8756b420', 'ignore_result': True, 'replaced_task_nesting': 0, 'stamped_headers': None, 'stamps': {}, 'properties': {'correlation_id': 'a5c4b0d7-783f-47d5-9369-543606cdd1d9', 'reply_to': '11bcfd7f-07ee-3a49-bfb5-0834cc22010b', 'delivery_mode': 2, 'delivery_info': {'exchange': '', 'routing_key': 'priority_dataset'}, 'priority': 0, 'body_encoding': 'base64',... kwargs:{})
2025-12-01 01:15:34.440 INFO [Dummy-14] [document_indexing_task.py:167] - priority document indexing task received: 12763198-a92e-4b38-b350-9555e78f8aba - d55317b7-627a-4442-a09b-b1a74b9dd4c0 - ['bce58a44-a0d7-4e5a-9c93-ba5f31f84cc5']
2025-12-01 01:15:34.443 INFO [Dummy-14] [document_indexing_task.py:85] - Start process document: bce58a44-a0d7-4e5a-9c93-ba5f31f84cc5
2025-12-01 01:15:34.453 DEBUG [Dummy-14] [opendal_storage.py:74] - file upload_files/12763198-a92e-4b38-b350-9555e78f8aba/bdbc6b13-c1c8-48c2-b045-0751840674ce.txt downloaded to /tmp/tmpliz9k4de/jpbhwmou.txt
2025-12-01 01:15:34.466 DEBUG [Dummy-14] [_config.py:82] - load_ssl_context verify=True cert=None trust_env=True http2=False
2025-12-01 01:15:34.467 DEBUG [Dummy-14] [_config.py:148] - load_verify_locations cafile='/app/api/.venv/lib/python3.12/site-packages/certifi/cacert.pem'
2025-12-01 01:15:34.505 DEBUG [Dummy-14] [_trace.py:47] - connect_tcp.started host='plugin_daemon' port=5002 local_address=None timeout=300.0 socket_options=None
2025-12-01 01:15:34.509 DEBUG [Dummy-14] [_trace.py:47] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0xffff601675f0>
2025-12-01 01:15:34.509 DEBUG [Dummy-14] [_trace.py:47] - send_request_headers.started request=<Request [b'GET']>
2025-12-01 01:15:34.509 DEBUG [Dummy-14] [_trace.py:47] - send_request_headers.complete
2025-12-01 01:15:34.510 DEBUG [Dummy-14] [_trace.py:47] - send_request_body.started request=<Request [b'GET']>
2025-12-01 01:15:34.510 DEBUG [Dummy-14] [_trace.py:47] - send_request_body.complete
2025-12-01 01:15:34.510 DEBUG [Dummy-14] [_trace.py:47] - receive_response_headers.started request=<Request [b'GET']>
2025-12-01 01:15:34.512 DEBUG [Dummy-14] [_trace.py:47] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/json; charset=utf-8'), (b'Date', b'Mon, 01 Dec 2025 01:15:34 GMT'), (b'Transfer-Encoding', b'chunked')])
2025-12-01 01:15:34.513 INFO [Dummy-14] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-12-01 01:15:34.513 DEBUG [Dummy-14] [_trace.py:47] - receive_response_body.started request=<Request [b'GET']>
2025-12-01 01:15:34.514 DEBUG [Dummy-14] [_trace.py:47] - receive_response_body.complete
2025-12-01 01:15:34.514 DEBUG [Dummy-14] [_trace.py:47] - response_closed.started
2025-12-01 01:15:34.514 DEBUG [Dummy-14] [_trace.py:47] - response_closed.complete
2025-12-01 01:15:34.515 DEBUG [Dummy-14] [_trace.py:47] - close.started
2025-12-01 01:15:34.515 DEBUG [Dummy-14] [_trace.py:47] - close.complete
2025-12-01 01:15:34.547 DEBUG [Dummy-14] [_config.py:82] - load_ssl_context verify=True cert=None trust_env=True http2=False
2025-12-01 01:15:34.548 DEBUG [Dummy-14] [_config.py:148] - load_verify_locations cafile='/app/api/.venv/lib/python3.12/site-packages/certifi/cacert.pem'
2025-12-01 01:15:34.585 DEBUG [Dummy-14] [_trace.py:47] - connect_tcp.started host='plugin_daemon' port=5002 local_address=None timeout=300.0 socket_options=None
2025-12-01 01:15:34.587 DEBUG [Dummy-14] [_trace.py:47] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0xffff60058860>
2025-12-01 01:15:34.587 DEBUG [Dummy-14] [_trace.py:47] - send_request_headers.started request=<Request [b'POST']>
2025-12-01 01:15:34.587 DEBUG [Dummy-14] [_trace.py:47] - send_request_headers.complete
2025-12-01 01:15:34.588 DEBUG [Dummy-14] [_trace.py:47] - send_request_body.started request=<Request [b'POST']>
2025-12-01 01:15:34.589 DEBUG [Dummy-14] [_trace.py:47] - send_request_body.complete
2025-12-01 01:15:34.589 DEBUG [Dummy-14] [_trace.py:47] - receive_response_headers.started request=<Request [b'POST']>
2025-12-01 01:15:34.591 DEBUG [Dummy-14] [_trace.py:47] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'text/event-stream'), (b'Date', b'Mon, 01 Dec 2025 01:15:34 GMT'), (b'Transfer-Encoding', b'chunked')])
2025-12-01 01:15:34.592 INFO [Dummy-14] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/dispatch/text_embedding/num_tokens "HTTP/1.1 200 OK"
2025-12-01 01:15:34.592 DEBUG [Dummy-14] [_trace.py:47] - receive_response_body.started request=<Request [b'POST']>
2025-12-01 01:15:34.593 DEBUG [Dummy-14] [_trace.py:47] - receive_response_body.failed exception=GeneratorExit()
2025-12-01 01:15:34.594 DEBUG [Dummy-14] [_trace.py:47] - response_closed.started
2025-12-01 01:15:34.594 DEBUG [Dummy-14] [_trace.py:47] - response_closed.complete
2025-12-01 01:15:34.625 INFO [Dummy-14] [document_indexing_task.py:102] - Processed dataset: d55317b7-627a-4442-a09b-b1a74b9dd4c0 latency: 0.1841462339507416
2025-12-01 01:15:34.626 INFO [Dummy-14] [document_indexing_task.py:125] - document indexing tenant isolation queue next tasks: []
2025-12-01 01:15:34.658 INFO [Dummy-14] [trace.py:128] - Task tasks.document_indexing_task.priority_document_indexing_task[a5c4b0d7-783f-47d5-9369-543606cdd1d9] succeeded in 0.21797144296579063s: None
@talenhon commented on GitHub (Nov 30, 2025): @dosu 1. API and worker containers have access to the same storage backend. 2. Tried both opendl and s3, both storage shows upload complete with a upload file exist in the storage. (1.9kb in size) 3. Enabled logging on worker ``` 2025-12-01 01:15:34.440 INFO [MainThread] [strategy.py:161] - Task tasks.document_indexing_task.priority_document_indexing_task[a5c4b0d7-783f-47d5-9369-543606cdd1d9] received 2025-12-01 01:15:34.440 DEBUG [MainThread] [base.py:149] - TaskPool: Apply <function fast_trace_task at 0xffff7ff0fa60> (args:('tasks.document_indexing_task.priority_document_indexing_task', 'a5c4b0d7-783f-47d5-9369-543606cdd1d9', {'lang': 'py', 'task': 'tasks.document_indexing_task.priority_document_indexing_task', 'id': 'a5c4b0d7-783f-47d5-9369-543606cdd1d9', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'group_index': None, 'retries': 0, 'timelimit': [None, None], 'root_id': 'a5c4b0d7-783f-47d5-9369-543606cdd1d9', 'parent_id': None, 'argsrepr': '()', 'kwargsrepr': "{'tenant_id': '12763198-a92e-4b38-b350-9555e78f8aba', 'dataset_id': 'd55317b7-627a-4442-a09b-b1a74b9dd4c0', 'document_ids': ['bce58a44-a0d7-4e5a-9c93-ba5f31f84cc5']}", 'origin': 'gen18@019b8756b420', 'ignore_result': True, 'replaced_task_nesting': 0, 'stamped_headers': None, 'stamps': {}, 'properties': {'correlation_id': 'a5c4b0d7-783f-47d5-9369-543606cdd1d9', 'reply_to': '11bcfd7f-07ee-3a49-bfb5-0834cc22010b', 'delivery_mode': 2, 'delivery_info': {'exchange': '', 'routing_key': 'priority_dataset'}, 'priority': 0, 'body_encoding': 'base64',... kwargs:{}) 2025-12-01 01:15:34.440 INFO [Dummy-14] [document_indexing_task.py:167] - priority document indexing task received: 12763198-a92e-4b38-b350-9555e78f8aba - d55317b7-627a-4442-a09b-b1a74b9dd4c0 - ['bce58a44-a0d7-4e5a-9c93-ba5f31f84cc5'] 2025-12-01 01:15:34.443 INFO [Dummy-14] [document_indexing_task.py:85] - Start process document: bce58a44-a0d7-4e5a-9c93-ba5f31f84cc5 2025-12-01 01:15:34.453 DEBUG [Dummy-14] [opendal_storage.py:74] - file upload_files/12763198-a92e-4b38-b350-9555e78f8aba/bdbc6b13-c1c8-48c2-b045-0751840674ce.txt downloaded to /tmp/tmpliz9k4de/jpbhwmou.txt 2025-12-01 01:15:34.466 DEBUG [Dummy-14] [_config.py:82] - load_ssl_context verify=True cert=None trust_env=True http2=False 2025-12-01 01:15:34.467 DEBUG [Dummy-14] [_config.py:148] - load_verify_locations cafile='/app/api/.venv/lib/python3.12/site-packages/certifi/cacert.pem' 2025-12-01 01:15:34.505 DEBUG [Dummy-14] [_trace.py:47] - connect_tcp.started host='plugin_daemon' port=5002 local_address=None timeout=300.0 socket_options=None 2025-12-01 01:15:34.509 DEBUG [Dummy-14] [_trace.py:47] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0xffff601675f0> 2025-12-01 01:15:34.509 DEBUG [Dummy-14] [_trace.py:47] - send_request_headers.started request=<Request [b'GET']> 2025-12-01 01:15:34.509 DEBUG [Dummy-14] [_trace.py:47] - send_request_headers.complete 2025-12-01 01:15:34.510 DEBUG [Dummy-14] [_trace.py:47] - send_request_body.started request=<Request [b'GET']> 2025-12-01 01:15:34.510 DEBUG [Dummy-14] [_trace.py:47] - send_request_body.complete 2025-12-01 01:15:34.510 DEBUG [Dummy-14] [_trace.py:47] - receive_response_headers.started request=<Request [b'GET']> 2025-12-01 01:15:34.512 DEBUG [Dummy-14] [_trace.py:47] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/json; charset=utf-8'), (b'Date', b'Mon, 01 Dec 2025 01:15:34 GMT'), (b'Transfer-Encoding', b'chunked')]) 2025-12-01 01:15:34.513 INFO [Dummy-14] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-12-01 01:15:34.513 DEBUG [Dummy-14] [_trace.py:47] - receive_response_body.started request=<Request [b'GET']> 2025-12-01 01:15:34.514 DEBUG [Dummy-14] [_trace.py:47] - receive_response_body.complete 2025-12-01 01:15:34.514 DEBUG [Dummy-14] [_trace.py:47] - response_closed.started 2025-12-01 01:15:34.514 DEBUG [Dummy-14] [_trace.py:47] - response_closed.complete 2025-12-01 01:15:34.515 DEBUG [Dummy-14] [_trace.py:47] - close.started 2025-12-01 01:15:34.515 DEBUG [Dummy-14] [_trace.py:47] - close.complete 2025-12-01 01:15:34.547 DEBUG [Dummy-14] [_config.py:82] - load_ssl_context verify=True cert=None trust_env=True http2=False 2025-12-01 01:15:34.548 DEBUG [Dummy-14] [_config.py:148] - load_verify_locations cafile='/app/api/.venv/lib/python3.12/site-packages/certifi/cacert.pem' 2025-12-01 01:15:34.585 DEBUG [Dummy-14] [_trace.py:47] - connect_tcp.started host='plugin_daemon' port=5002 local_address=None timeout=300.0 socket_options=None 2025-12-01 01:15:34.587 DEBUG [Dummy-14] [_trace.py:47] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0xffff60058860> 2025-12-01 01:15:34.587 DEBUG [Dummy-14] [_trace.py:47] - send_request_headers.started request=<Request [b'POST']> 2025-12-01 01:15:34.587 DEBUG [Dummy-14] [_trace.py:47] - send_request_headers.complete 2025-12-01 01:15:34.588 DEBUG [Dummy-14] [_trace.py:47] - send_request_body.started request=<Request [b'POST']> 2025-12-01 01:15:34.589 DEBUG [Dummy-14] [_trace.py:47] - send_request_body.complete 2025-12-01 01:15:34.589 DEBUG [Dummy-14] [_trace.py:47] - receive_response_headers.started request=<Request [b'POST']> 2025-12-01 01:15:34.591 DEBUG [Dummy-14] [_trace.py:47] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'text/event-stream'), (b'Date', b'Mon, 01 Dec 2025 01:15:34 GMT'), (b'Transfer-Encoding', b'chunked')]) 2025-12-01 01:15:34.592 INFO [Dummy-14] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/12763198-a92e-4b38-b350-9555e78f8aba/dispatch/text_embedding/num_tokens "HTTP/1.1 200 OK" 2025-12-01 01:15:34.592 DEBUG [Dummy-14] [_trace.py:47] - receive_response_body.started request=<Request [b'POST']> 2025-12-01 01:15:34.593 DEBUG [Dummy-14] [_trace.py:47] - receive_response_body.failed exception=GeneratorExit() 2025-12-01 01:15:34.594 DEBUG [Dummy-14] [_trace.py:47] - response_closed.started 2025-12-01 01:15:34.594 DEBUG [Dummy-14] [_trace.py:47] - response_closed.complete 2025-12-01 01:15:34.625 INFO [Dummy-14] [document_indexing_task.py:102] - Processed dataset: d55317b7-627a-4442-a09b-b1a74b9dd4c0 latency: 0.1841462339507416 2025-12-01 01:15:34.626 INFO [Dummy-14] [document_indexing_task.py:125] - document indexing tenant isolation queue next tasks: [] 2025-12-01 01:15:34.658 INFO [Dummy-14] [trace.py:128] - Task tasks.document_indexing_task.priority_document_indexing_task[a5c4b0d7-783f-47d5-9369-543606cdd1d9] succeeded in 0.21797144296579063s: None ```
Author
Owner

@dosubot[bot] commented on GitHub (Nov 30, 2025):

Your storage and worker setup look correct, and the logs confirm the file is downloaded and processed without errors. At this point, the most likely cause is that the document content is being dropped during cleaning or segmentation due to the process_rule or segmentation settings.

Dify's indexing pipeline will silently skip all segments if, after cleaning and splitting, the content is empty or doesn't meet the segmentation criteria (like chunk size or separator). This can happen if the process_rule is too aggressive, misconfigured, or if the payload structure for hierarchical segmentation is incorrect. For example, if you're using hierarchical mode, your payload must include both segmentation and subchunk_segmentation inside process_rule.rules, with parent_mode outside segmentation—otherwise, the API returns 200 OK but creates no segments, resulting in empty documents even for large files (details and example payload).

Try the following:

  • Double-check your process_rule structure matches the working example for hierarchical segmentation.
  • Switch from "automatic" to "custom" segmentation/cleaning in your API payload and reduce cleaning aggressiveness (e.g., disable remove_urls_emails).
  • Test with a minimal, known-good hierarchical payload to rule out silent payload structure errors.
  • If possible, add debug logging to capture the cleaned text and split segments during indexing to see if content is being dropped.

If you want, share your exact process_rule and segmentation settings, and I can help review them for subtle issues.

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 (Nov 30, 2025): <!-- Answer --> Your storage and worker setup look correct, and the logs confirm the file is downloaded and processed without errors. At this point, the most likely cause is that the document content is being dropped during cleaning or segmentation due to the process_rule or segmentation settings. Dify's indexing pipeline will silently skip all segments if, after cleaning and splitting, the content is empty or doesn't meet the segmentation criteria (like chunk size or separator). This can happen if the process_rule is too aggressive, misconfigured, or if the payload structure for hierarchical segmentation is incorrect. For example, if you're using hierarchical mode, your payload must include both segmentation and subchunk_segmentation inside process_rule.rules, with parent_mode outside segmentation—otherwise, the API returns 200 OK but creates no segments, resulting in empty documents even for large files ([details and example payload](https://github.com/langgenius/dify/issues/23933)). Try the following: - Double-check your process_rule structure matches the working example for hierarchical segmentation. - Switch from "automatic" to "custom" segmentation/cleaning in your API payload and reduce cleaning aggressiveness (e.g., disable remove_urls_emails). - Test with a minimal, known-good hierarchical payload to rule out silent payload structure errors. - If possible, add debug logging to capture the cleaned text and split segments during indexing to see if content is being dropped. If you want, share your exact process_rule and segmentation settings, and I can help review them for subtle issues. <!-- 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/9807c69b-403b-48a6-92f2-cbb9a9709d34?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9807c69b-403b-48a6-92f2-cbb9a9709d34?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9807c69b-403b-48a6-92f2-cbb9a9709d34?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9807c69b-403b-48a6-92f2-cbb9a9709d34?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9807c69b-403b-48a6-92f2-cbb9a9709d34?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9807c69b-403b-48a6-92f2-cbb9a9709d34?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9807c69b-403b-48a6-92f2-cbb9a9709d34?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=Your%20storage%20and%20worker%20setup%20look%20correct%2C%20and%20the%20logs%20confirm%20the%20file%20is%20downloaded%20and%20processed%20without%20errors.%20At%20this%20point%2C%20the%20most%20likely%20cause%20is%20that%20the%20document%20content%20is%20being%20dropped%20during%20cleaning%20or%20segmentation%20due%20to%20the%20process_rule%20or%20segmentation%20settings.%0A%0ADify%27s%20indexing%20pipeline%20will%20silently%20skip%20all%20segments%20if%2C%20after%20cleaning%20and%20splitting%2C%20the%20content%20is%20empty%20or%20doesn%27t%20meet%20the%20segmentation%20criteria%20%28like%20chunk%20size%20or%20separator%29.%20This%20can%20happen%20if%20the%20process_rule%20is%20too%20aggressive%2C%20misconfigured%2C%20or%20if%20the%20payload%20structure%20for%20hierarchical%20segmentation%20is%20incorrect.%20For%20example%2C%20if%20you%27re%20using%20hierarchical%20mode%2C%20your%20payload%20must%20include%20both%20segmentation%20and%20subchunk_segmentation%20inside%20process_rule.rules%2C%20with%20parent_mode%20outside%20segmentation%E2%80%94otherwise%2C%20the%20API%20returns%20200%20OK%20but%20creates%20no%20segments%2C%20resulting%20in%20empty%20documents%20even%20for%20large%20files%20%28%5Bdetails%20and%20example%20payload%5D%28https%3A//github.com/langgenius/dify/issues/23933%29%29.%0A%0ATry%20the%20following%3A%0A-%20Double-check%20your%20process_rule%20structure%20matches%20the%20working%20example%20for%20hierarchical%20segmentation.%0A-%20Switch%20from%20%22automatic%22%20to%20%22custom%22%20segmentation/cleaning%20in%20your%20API%20payload%20and%20reduce%20cleaning%20aggressiveness%20%28e.g.%2C%20disable%20remove_urls_emails%29.%0A-%20Test%20with%20a%20minimal%2C%20known-good%20hierarchical%20payload%20to%20rule%20out%20silent%20payload%20structure%20errors.%0A-%20If%20possible%2C%20add%20debug%20logging%20to%20capture%20the%20cleaned%20text%20and%20split%20segments%20during%20indexing%20to%20see%20if%20content%20is%20being%20dropped.%0A%0AIf%20you%20want%2C%20share%20your%20exact%20process_rule%20and%20segmentation%20settings%2C%20and%20I%20can%20help%20review%20them%20for%20subtle%20issues.)&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/28763)
Author
Owner

@talenhon commented on GitHub (Dec 1, 2025):

@dosu
Thanks. Key is inside the process_rule...
Suggest can provide a structure documentation or message in api return if the process_rule is missing items.

process_rule:
  mode: hierarchical
  rules:
    pre_processing_rules:
      - id: remove_extra_spaces
        enabled: true
      - id: remove_urls_emails
        enabled: true
    segmentation:
      separator: '###'
      max_tokens: 1024
    parent_mode: full-doc
    subchunk_segmentation:
      separator: \n
      max_tokens: 512

Tried below rules. So far it works for me.

{
    "name": "{{$guid}}",
    "text": "We are all explorers. Our desire to discover, and then share that new-found knowledge, is part of what makes us human – indeed, this has played an important part in our success as a species. ",
    "indexing_technique": "high_quality",
    "process_rule": {
        "mode": "hierarchical",
        "rules": {
            "pre_processing_rules": [
                {
                    "id": "remove_extra_spaces",
                    "enabled": true
                },
                {
                    "id": "remove_urls_emails",
                    "enabled": true
                }
            ],
            "segmentation": {
                "separator": "###",
                "max_tokens": 1024
            },
            "parent_mode": "full-doc",
            "subchunk_segmentation": {
                "separator": "\n",
                "max_tokens": 512
            }
        }
    },
    "doc_form": "hierarchical_model",
    "doc_language": "English"
}
@talenhon commented on GitHub (Dec 1, 2025): @dosu Thanks. Key is inside the process_rule... Suggest can provide a structure documentation or message in api return if the process_rule is missing items. ``` process_rule: mode: hierarchical rules: pre_processing_rules: - id: remove_extra_spaces enabled: true - id: remove_urls_emails enabled: true segmentation: separator: '###' max_tokens: 1024 parent_mode: full-doc subchunk_segmentation: separator: \n max_tokens: 512 ``` Tried below rules. So far it works for me. ``` { "name": "{{$guid}}", "text": "We are all explorers. Our desire to discover, and then share that new-found knowledge, is part of what makes us human – indeed, this has played an important part in our success as a species. ", "indexing_technique": "high_quality", "process_rule": { "mode": "hierarchical", "rules": { "pre_processing_rules": [ { "id": "remove_extra_spaces", "enabled": true }, { "id": "remove_urls_emails", "enabled": true } ], "segmentation": { "separator": "###", "max_tokens": 1024 }, "parent_mode": "full-doc", "subchunk_segmentation": { "separator": "\n", "max_tokens": 512 } } }, "doc_form": "hierarchical_model", "doc_language": "English" } ```
Author
Owner

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

Great catch—having the correct process_rule structure is absolutely key for hierarchical segmentation. Your working example matches the recommended format: mode set to "hierarchical", with both segmentation and subchunk_segmentation inside rules, and parent_mode outside segmentation. This structure avoids the silent failures that happen when fields are missing or mis-nested see details and examples.

Your suggestion for better documentation and API error messages is spot on. The good news: recent updates (see PR #28810) have added comprehensive validation and error handling for process_rule in document uploads. Now, if required fields are missing or invalid, the API will return clear error messages instead of silently accepting the payload. This covers all modes (automatic, custom, hierarchical) and checks for things like missing segmentation, missing parent_mode, and invalid types.

For reference, here’s a minimal working example for hierarchical segmentation:

{
  "process_rule": {
    "mode": "hierarchical",
    "rules": {
      "pre_processing_rules": [
        { "id": "remove_extra_spaces", "enabled": true },
        { "id": "remove_urls_emails", "enabled": true }
      ],
      "segmentation": {
        "separator": "###",
        "max_tokens": 1024
      },
      "parent_mode": "full-doc",
      "subchunk_segmentation": {
        "separator": "\n",
        "max_tokens": 512
      }
    }
  },
  "doc_form": "hierarchical_model",
  "indexing_technique": "high_quality"
}

There are still some documentation gaps, like missing details for the chunk_overlap property in segmentation (see docs issue), but the validation improvements should make troubleshooting much easier. If you’re running an older version, updating to the latest Dify release will give you these new error messages and validation checks.

Thanks for sharing your feedback—this helps make the API more robust for everyone!

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 1, 2025): <!-- Answer --> Great catch—having the correct process_rule structure is absolutely key for hierarchical segmentation. Your working example matches the recommended format: mode set to "hierarchical", with both segmentation and subchunk_segmentation inside rules, and parent_mode outside segmentation. This structure avoids the silent failures that happen when fields are missing or mis-nested [see details and examples](https://github.com/langgenius/dify/issues/23933). Your suggestion for better documentation and API error messages is spot on. The good news: recent updates (see [PR #28810](https://github.com/langgenius/dify/pull/28810)) have added comprehensive validation and error handling for process_rule in document uploads. Now, if required fields are missing or invalid, the API will return clear error messages instead of silently accepting the payload. This covers all modes (automatic, custom, hierarchical) and checks for things like missing segmentation, missing parent_mode, and invalid types. For reference, here’s a minimal working example for hierarchical segmentation: ```json { "process_rule": { "mode": "hierarchical", "rules": { "pre_processing_rules": [ { "id": "remove_extra_spaces", "enabled": true }, { "id": "remove_urls_emails", "enabled": true } ], "segmentation": { "separator": "###", "max_tokens": 1024 }, "parent_mode": "full-doc", "subchunk_segmentation": { "separator": "\n", "max_tokens": 512 } } }, "doc_form": "hierarchical_model", "indexing_technique": "high_quality" } ``` There are still some documentation gaps, like missing details for the chunk_overlap property in segmentation ([see docs issue](https://github.com/langgenius/dify-docs/issues/514)), but the validation improvements should make troubleshooting much easier. If you’re running an older version, updating to the latest Dify release will give you these new error messages and validation checks. Thanks for sharing your feedback—this helps make the API more robust for everyone! <!-- 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/e2088aa7-39f3-4e30-b70d-2f238a14a9b5?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e2088aa7-39f3-4e30-b70d-2f238a14a9b5?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e2088aa7-39f3-4e30-b70d-2f238a14a9b5?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e2088aa7-39f3-4e30-b70d-2f238a14a9b5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e2088aa7-39f3-4e30-b70d-2f238a14a9b5?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e2088aa7-39f3-4e30-b70d-2f238a14a9b5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e2088aa7-39f3-4e30-b70d-2f238a14a9b5?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=Great%20catch%E2%80%94having%20the%20correct%20process_rule%20structure%20is%20absolutely%20key%20for%20hierarchical%20segmentation.%20Your%20working%20example%20matches%20the%20recommended%20format%3A%20mode%20set%20to%20%22hierarchical%22%2C%20with%20both%20segmentation%20and%20subchunk_segmentation%20inside%20rules%2C%20and%20parent_mode%20outside%20segmentation.%20This%20structure%20avoids%20the%20silent%20failures%20that%20happen%20when%20fields%20are%20missing%20or%20mis-nested%20%5Bsee%20details%20and%20examples%5D%28https%3A//github.com/langgenius/dify/issues/23933%29.%0A%0AYour%20suggestion%20for%20better%20documentation%20and%20API%20error%20messages%20is%20spot%20on.%20The%20good%20news%3A%20recent%20updates%20%28see%20%5BPR%20%2328810%5D%28https%3A//github.com/langgenius/dify/pull/28810%29%29%20have%20added%20comprehensive%20validation%20and%20error%20handling%20for%20process_rule%20in%20document%20uploads.%20Now%2C%20if%20required%20fields%20are%20missing%20or%20invalid%2C%20the%20API%20will%20return%20clear%20error%20messages%20instead%20of%20silently%20accepting%20the%20payload.%20This%20covers%20all%20modes%20%28automatic%2C%20custom%2C%20hierarchical%29%20and%20checks%20for%20things%20like%20missing%20segmentation%2C%20missing%20parent_mode%2C%20and%20invalid%20types.%0A%0AFor%20reference%2C%20here%E2%80%99s%20a%20minimal%20working%20example%20for%20hierarchical%20segmentation%3A%0A%0A%60%60%60json%0A%7B%0A%20%20%22process_rule%22%3A%20%7B%0A%20%20%20%20%22mode%22%3A%20%22hierarchical%22%2C%0A%20%20%20%20%22rules%22%3A%20%7B%0A%20%20%20%20%20%20%22pre_processing_rules%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%7B%20%22id%22%3A%20%22remove_extra_spaces%22%2C%20%22enabled%22%3A%20true%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20%22id%22%3A%20%22remove_urls_emails%22%2C%20%22enabled%22%3A%20true%20%7D%0A%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%22segmentation%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22separator%22%3A%20%22%23%23%23%22%2C%0A%20%20%20%20%20%20%20%20%22max_tokens%22%3A%201024%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%22parent_mode%22%3A%20%22full-doc%22%2C%0A%20%20%20%20%20%20%22subchunk_segmentation%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22separator%22%3A%20%22%5Cn%22%2C%0A%20%20%20%20%20%20%20%20%22max_tokens%22%3A%20512%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%20%20%22doc_form%22%3A%20%22hierarchical_model%22%2C%0A%20%20%22indexing_technique%22%3A%20%22high_quality%22%0A%7D%0A%60%60%60%0A%0AThere%20are%20still%20some%20documentation%20gaps%2C%20like%20missing%20details%20for%20the%20chunk_overlap%20property%20in%20segmentation%20%28%5Bsee%20docs%20issue%5D%28https%3A//github.com/langgenius/dify-docs/issues/514%29%29%2C%20but%20the%20validation%20improvements%20should%20make%20troubleshooting%20much%20easier.%20If%20you%E2%80%99re%20running%20an%20older%20version%2C%20updating%20to%20the%20latest%20Dify%20release%20will%20give%20you%20these%20new%20error%20messages%20and%20validation%20checks.%0A%0AThanks%20for%20sharing%20your%20feedback%E2%80%94this%20helps%20make%20the%20API%20more%20robust%20for%20everyone%21)&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/28763)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20598