500 INTERNAL SERVER ERROR #12036

Closed
opened 2026-02-21 19:05:25 -05:00 by yindo · 3 comments
Owner

Originally created by @GradientColor on GitHub (Mar 24, 2025).

Image

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

Version 1.1.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

#15104 When I want to add a knowledge base, after I select the data source, when I click Save in Text Segmentation and Cleaning, an error message 500INTERNAL SERVER ERROR is displayed. The console will report an error message type: 'cors', url: 'http://localhost:5001/console/api/datasets/init', redirected: false, status: 500, ok: false, But if I start it with docker, there is no such problem. How can I solve it?

✔️ Expected Behavior

Successfully added knowledge base

Actual Behavior

report 500 INTERNAL SERVER ERROR,Response type: 'cors', url: 'http://localhost:5001/console/api/datasets/init'

Originally created by @GradientColor on GitHub (Mar 24, 2025). ![Image](https://github.com/user-attachments/assets/6e6629a5-6a24-414e-838f-4b068e18168c) ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version Version 1.1.1 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce #15104 When I want to add a knowledge base, after I select the data source, when I click Save in Text Segmentation and Cleaning, an error message 500INTERNAL SERVER ERROR is displayed. The console will report an error message type: 'cors', url: 'http://localhost:5001/console/api/datasets/init', redirected: false, status: 500, ok: false, **But** if I start it with docker, there is no such problem. How can I solve it? ### ✔️ Expected Behavior Successfully added knowledge base ### ❌ Actual Behavior report 500 INTERNAL SERVER ERROR,Response type: 'cors', url: 'http://localhost:5001/console/api/datasets/init'
yindo added the 🐞 bug label 2026-02-21 19:05:25 -05:00
yindo closed this issue 2026-02-21 19:05:25 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 24, 2025):

Hello @GradientColor! I'm here to assist you with bug fixes, questions, and becoming a contributor. Let's tackle this issue together!

A similar issue was reported and closed in the Dify repository, where an "Internal Server Error" occurred when trying to re-save existing knowledge. This issue was resolved by a pull request that fixed the problem with updating document segment settings [1].

For your specific issue with the 500 INTERNAL SERVER ERROR when adding a knowledge base in a self-hosted setup, common causes include issues with Docker volumes. A recommended solution is to delete all Docker volumes and start fresh with a clean installation. Additionally, ensure that your API requests are correctly formatted, particularly the Authorization header, which should follow the 'Bearer ' format, as incorrect formatting can also lead to server errors [2].

Since you mentioned that the issue does not occur when using Docker, it might be related to differences in configuration between the self-hosted source setup and the Docker setup. Unfortunately, I couldn't find specific details on the CORS configuration differences between these setups, but ensuring that your CORS settings are correctly configured in your self-hosted environment might help resolve the issue.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 24, 2025): <!-- Greeting --> Hello @GradientColor! I'm here to assist you with bug fixes, questions, and becoming a contributor. Let's tackle this issue together! <!-- Answer --> A similar issue was reported and closed in the Dify repository, where an "Internal Server Error" occurred when trying to re-save existing knowledge. This issue was resolved by a pull request that fixed the problem with updating document segment settings <sup>[[1]](https://github.com/langgenius/dify/issues/10103)</sup>. For your specific issue with the 500 INTERNAL SERVER ERROR when adding a knowledge base in a self-hosted setup, common causes include issues with Docker volumes. A recommended solution is to delete all Docker volumes and start fresh with a clean installation. Additionally, ensure that your API requests are correctly formatted, particularly the Authorization header, which should follow the 'Bearer <api-key>' format, as incorrect formatting can also lead to server errors <sup>[[2]](https://github.com/langgenius/dify/issues/14641)</sup>. Since you mentioned that the issue does not occur when using Docker, it might be related to differences in configuration between the self-hosted source setup and the Docker setup. Unfortunately, I couldn't find specific details on the CORS configuration differences between these setups, but ensuring that your CORS settings are correctly configured in your self-hosted environment might help resolve the issue. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/7ededbc6-3977-4cf1-985f-ccd6f15d1f77?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/7ededbc6-3977-4cf1-985f-ccd6f15d1f77?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/7ededbc6-3977-4cf1-985f-ccd6f15d1f77?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/7ededbc6-3977-4cf1-985f-ccd6f15d1f77?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7ededbc6-3977-4cf1-985f-ccd6f15d1f77?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/7ededbc6-3977-4cf1-985f-ccd6f15d1f77?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7ededbc6-3977-4cf1-985f-ccd6f15d1f77?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Mar 24, 2025):

We do not provide technical support for starting from the source. Thank you for your understanding. We assume you have the necessary expertise to set it up independently. If you require technical support, please obtain our business license by contacting us at business@dify.ai.

For backend errors, please provide the logs as much as you can from the container. Including:

  • api
  • worker
  • plugin_daemon

Without the logs, we do not know how to fix it as well.

@crazywoola commented on GitHub (Mar 24, 2025): We do not provide technical support for starting from the source. Thank you for your understanding. We assume you have the necessary expertise to set it up independently. If you require technical support, please obtain our business license by contacting us at business@dify.ai. For backend errors, please provide the logs as much as you can from the container. Including: - api - worker - plugin_daemon Without the logs, we do not know how to fix it as well.
Author
Owner

@GradientColor commented on GitHub (Mar 24, 2025):

Image
I did not use docker to deploy work and api, but followed the documentation.
cd docker cp middleware.env.example middleware.env docker compose -f docker-compose.middleware.yaml up -d
Just started plugin_daemon, and there is an error as shown in the picture @crazywoola

@GradientColor commented on GitHub (Mar 24, 2025): ![Image](https://github.com/user-attachments/assets/b89d0d2c-e375-4e46-9c1c-051e954209c5) I did not use docker to deploy work and api, but followed the documentation. `cd docker cp middleware.env.example middleware.env docker compose -f docker-compose.middleware.yaml up -d` Just started plugin_daemon, and there is an error as shown in the picture @crazywoola
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12036