Knowledge Base stuck in “Queueing” state for days, documents remain in waiting status #22065

Open
opened 2026-02-21 20:15:36 -05:00 by yindo · 1 comment
Owner

Originally created by @bigcandy95 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

1.7.1

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

Hosting environment: Microsoft Azure
Services deployed as containers:

  • API service
  • Worker (background task processor)
  • Redis (message queue)
  • PostgreSQL (database)

When creating a Knowledge Base in Dify, the process remains stuck in the “queueing” state for an extended period of time (more than 2 days) and is never processed.

Although the file upload is completed successfully, the Knowledge Base initialization does not progress and no background processing seems to be triggered.

Steps to Reproduce

Step 1: Upload one or more files (e.g. PDF / DOCX / TXT).
Step 2: Create a Knowledge Base using the uploaded files.

✔️ Expected Behavior

  • Uploaded documents should be parsed and embedded successfully.
  • The Knowledge Base status should move from queueing to completed.

Actual Behavior

  • The Knowledge Base remains in the queueing state indefinitely (over 2 days).
  • No processing progress or error is shown in the UI.
  • Checking the database table public.documentations shows:
    • Uploaded documents remain in the waiting status.
    • The status never changes to processing or completed.
Image
Originally created by @bigcandy95 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 1.7.1 ### Cloud or Self Hosted Cloud, Self Hosted (Docker) ### Steps to reproduce Hosting environment: Microsoft Azure Services deployed as containers: - API service - Worker (background task processor) - Redis (message queue) - PostgreSQL (database) When creating a Knowledge Base in Dify, the process remains stuck in the “queueing” state for an extended period of time (more than 2 days) and is never processed. Although the file upload is completed successfully, the Knowledge Base initialization does not progress and no background processing seems to be triggered. Steps to Reproduce Step 1: Upload one or more files (e.g. PDF / DOCX / TXT). Step 2: Create a Knowledge Base using the uploaded files. ### ✔️ Expected Behavior - Uploaded documents should be parsed and embedded successfully. - The Knowledge Base status should move from queueing to completed. ### ❌ Actual Behavior - The Knowledge Base remains in the queueing state indefinitely (over 2 days). - No processing progress or error is shown in the UI. - Checking the database table public.documentations shows: - Uploaded documents remain in the waiting status. - The status never changes to processing or completed. <img width="1842" height="178" alt="Image" src="https://github.com/user-attachments/assets/71d09b47-8663-4f37-b3c6-acd0fd9e56b3" />
yindo added the 🐞 bug label 2026-02-21 20:15:36 -05:00
Author
Owner

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

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

The most common cause for documents stuck in the "queueing" state in Dify v1.7.1 Docker deployments is that the Celery worker is either not running, not connected to Redis, or not listening to the correct queues (like dataset, pipeline, and priority_pipeline). This prevents background tasks from being picked up and processed, leaving documents in the "waiting" status indefinitely. Here’s a focused checklist to help you resolve this:

  1. Check all containers: Make sure your API, worker, Redis, and PostgreSQL containers are running and healthy. Use docker compose ps to verify their status.
  2. Worker queue configuration: The worker must be started with the correct queue list. For v1.7.1, the queues should include at least dataset, pipeline, and priority_pipeline. In Docker Compose or your Azure setup, check that the worker service command or environment variables (CELERY_QUEUES or CELERY_WORKER_QUEUES) include these queues.
  3. Inspect worker logs: Use docker logs <worker-container-id> to check for errors or warnings about unconsumed queues or Redis connectivity issues. If you see messages about unrecognized queues or connection errors, adjust your configuration accordingly.
  4. Restart the worker: Sometimes, simply restarting the worker container (docker compose restart worker) will allow it to pick up and process stuck tasks.
  5. Database and Redis checks: If the above steps don’t resolve the issue, inspect the relevant database tables (dataset_documents, dataset_document_segments, dataset_document_queues, dataset_document_logs) for clues. If you previously deleted a knowledge base while documents were still being processed, orphaned tasks may be blocking the queue. Advanced users can clear Redis keys like tenant_self_document_indexing_task_queue:<tenant_id> and tenant_document_indexing_task:<tenant_id>, but do this with caution and backups, as it will flush all pending document indexing tasks for that tenant [1] [2].

If you continue to experience this issue, consider upgrading to a newer Dify version, as several reliability fixes for queue and indexing have been made since v1.7.1 [3] [4].

For more technical details, see the worker entrypoint script and Celery/Redis configuration.

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 @bigcandy95! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The most common cause for documents stuck in the "queueing" state in Dify v1.7.1 Docker deployments is that the Celery worker is either not running, not connected to Redis, or not listening to the correct queues (like `dataset`, `pipeline`, and `priority_pipeline`). This prevents background tasks from being picked up and processed, leaving documents in the "waiting" status indefinitely. Here’s a focused checklist to help you resolve this: 1. **Check all containers**: Make sure your API, worker, Redis, and PostgreSQL containers are running and healthy. Use `docker compose ps` to verify their status. 2. **Worker queue configuration**: The worker must be started with the correct queue list. For v1.7.1, the queues should include at least `dataset`, `pipeline`, and `priority_pipeline`. In Docker Compose or your Azure setup, check that the worker service command or environment variables (`CELERY_QUEUES` or `CELERY_WORKER_QUEUES`) include these queues. 3. **Inspect worker logs**: Use `docker logs <worker-container-id>` to check for errors or warnings about unconsumed queues or Redis connectivity issues. If you see messages about unrecognized queues or connection errors, adjust your configuration accordingly. 4. **Restart the worker**: Sometimes, simply restarting the worker container (`docker compose restart worker`) will allow it to pick up and process stuck tasks. 5. **Database and Redis checks**: If the above steps don’t resolve the issue, inspect the relevant database tables (`dataset_documents`, `dataset_document_segments`, `dataset_document_queues`, `dataset_document_logs`) for clues. If you previously deleted a knowledge base while documents were still being processed, orphaned tasks may be blocking the queue. Advanced users can clear Redis keys like `tenant_self_document_indexing_task_queue:<tenant_id>` and `tenant_document_indexing_task:<tenant_id>`, but do this with caution and backups, as it will flush all pending document indexing tasks for that tenant [[1]](https://github.com/langgenius/dify/issues/28468) [[2]](https://github.com/langgenius/dify/discussions/31267). If you continue to experience this issue, consider upgrading to a newer Dify version, as several reliability fixes for queue and indexing have been made since v1.7.1 [[3]](https://github.com/langgenius/dify/issues/26374) [[4]](https://github.com/langgenius/dify/issues/28468). For more technical details, see the [worker entrypoint script](https://github.com/langgenius/dify/blob/5f69470ebf966a781b43520c66980d092cf5c66b/api/docker/entrypoint.sh#L21-L69) and [Celery/Redis configuration](https://github.com/langgenius/dify/blob/5f69470ebf966a781b43520c66980d092cf5c66b/api/extensions/ext_celery.py#L6-L189). <!-- 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/ca9be3b7-f94f-4549-87ae-68a3143243b3?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ca9be3b7-f94f-4549-87ae-68a3143243b3?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ca9be3b7-f94f-4549-87ae-68a3143243b3?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ca9be3b7-f94f-4549-87ae-68a3143243b3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ca9be3b7-f94f-4549-87ae-68a3143243b3?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ca9be3b7-f94f-4549-87ae-68a3143243b3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ca9be3b7-f94f-4549-87ae-68a3143243b3?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%20most%20common%20cause%20for%20documents%20stuck%20in%20the%20%22queueing%22%20state%20in%20Dify%20v1.7.1%20Docker%20deployments%20is%20that%20the%20Celery%20worker%20is%20either%20not%20running%2C%20not%20connected%20to%20Redis%2C%20or%20not%20listening%20to%20the%20correct%20queues%20%28like%20%60dataset%60%2C%20%60pipeline%60%2C%20and%20%60priority_pipeline%60%29.%20This%20prevents%20background%20tasks%20from%20being%20picked%20up%20and%20processed%2C%20leaving%20documents%20in%20the%20%22waiting%22%20status%20indefinitely.%20Here%E2%80%99s%20a%20focused%20checklist%20to%20help%20you%20resolve%20this%3A%0A%0A1.%20%2A%2ACheck%20all%20containers%2A%2A%3A%20Make%20sure%20your%20API%2C%20worker%2C%20Redis%2C%20and%20PostgreSQL%20containers%20are%20running%20and%20healthy.%20Use%20%60docker%20compose%20ps%60%20to%20verify%20their%20status.%20%20%0A2.%20%2A%2AWorker%20queue%20configuration%2A%2A%3A%20The%20worker%20must%20be%20started%20with%20the%20correct%20queue%20list.%20For%20v1.7.1%2C%20the%20queues%20should%20include%20at%20least%20%60dataset%60%2C%20%60pipeline%60%2C%20and%20%60priority_pipeline%60.%20In%20Docker%20Compose%20or%20your%20Azure%20setup%2C%20check%20that%20the%20worker%20service%20command%20or%20environment%20variables%20%28%60CELERY_QUEUES%60%20or%20%60CELERY_WORKER_QUEUES%60%29%20include%20these%20queues.%20%20%0A3.%20%2A%2AInspect%20worker%20logs%2A%2A%3A%20Use%20%60docker%20logs%20%3Cworker-container-id%3E%60%20to%20check%20for%20errors%20or%20warnings%20about%20unconsumed%20queues%20or%20Redis%20connectivity%20issues.%20If%20you%20see%20messages%20about%20unrecognized%20queues%20or%20connection%20errors%2C%20adjust%20your%20configuration%20accordingly.%20%20%0A4.%20%2A%2ARestart%20the%20worker%2A%2A%3A%20Sometimes%2C%20simply%20restarting%20the%20worker%20container%20%28%60docker%20compose%20restart%20worker%60%29%20will%20allow%20it%20to%20pick%20up%20and%20process%20stuck%20tasks.%20%20%0A5.%20%2A%2ADatabase%20and%20Redis%20checks%2A%2A%3A%20If%20the%20above%20steps%20don%E2%80%99t%20resolve%20the%20issue%2C%20inspect%20the%20relevant%20database%20tables%20%28%60dataset_documents%60%2C%20%60dataset_document_segments%60%2C%20%60dataset_document_queues%60%2C%20%60dataset_document_logs%60%29%20for%20clues.%20If%20you%20previously%20deleted%20a%20knowledge%20base%20while%20documents%20were%20still%20being%20processed%2C%20orphaned%20tasks%20may%20be%20blocking%20the%20queue.%20Advanced%20users%20can%20clear%20Redis%20keys%20like%20%60tenant_self_document_indexing_task_queue%3A%3Ctenant_id%3E%60%20and%20%60tenant_document_indexing_task%3A%3Ctenant_id%3E%60%2C%20but%20do%20this%20with%20caution%20and%20backups%2C%20as%20it%20will%20flush%20all%20pending%20document%20indexing%20tasks%20for%20that%20tenant%20%5B%5B1%5D%5D%28https%3A//github.com/langgenius/dify/issues/28468%29%20%5B%5B2%5D%5D%28https%3A//github.com/langgenius/dify/discussions/31267%29.%0A%0AIf%20you%20continue%20to%20experience%20this%20issue%2C%20consider%20upgrading%20to%20a%20newer%20Dify%20version%2C%20as%20several%20reliability%20fixes%20for%20queue%20and%20indexing%20have%20been%20made%20since%20v1.7.1%20%5B%5B3%5D%5D%28https%3A//github.com/langgenius/dify/issues/26374%29%20%5B%5B4%5D%5D%28https%3A//github.com/langgenius/dify/issues/28468%29.%0A%0AFor%20more%20technical%20details%2C%20see%20the%20%5Bworker%20entrypoint%20script%5D%28https%3A//github.com/langgenius/dify/blob/5f69470ebf966a781b43520c66980d092cf5c66b/api/docker/entrypoint.sh%23L21-L69%29%20and%20%5BCelery/Redis%20configuration%5D%28https%3A//github.com/langgenius/dify/blob/5f69470ebf966a781b43520c66980d092cf5c66b/api/extensions/ext_celery.py%23L6-L189%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/31932)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#22065