KNOWLEDGE api retrieve can not use and api document error #6592

Closed
opened 2026-02-21 18:16:28 -05:00 by yindo · 2 comments
Owner

Originally created by @hope12122 on GitHub (Nov 6, 2024).

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

0.11.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

api
This method can not get answers

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @hope12122 on GitHub (Nov 6, 2024). ### 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 0.11.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![api](https://github.com/user-attachments/assets/daa8b8ae-067d-42ab-908f-0ced7dd9b81d) This method can not get answers ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug📚 documentation🤔 cant-reproduce labels 2026-02-21 18:16:28 -05:00
yindo closed this issue 2026-02-21 18:16:28 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 6, 2024):

@hope12122 Hello there! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve this issue.

I found some similar discussions that might be relevant to your issue:

  1. DIY API interface call, unable to parse context - This discussion is unsolved and was last updated on October 30, 2024.
  2. Connection error: request error, status_code: 503 - This discussion is unsolved and was last updated on October 25, 2024.
  3. The answer in the knowledge base API corresponds to which feature in the platform? - This discussion is unsolved and was last updated on October 14, 2024.

Additionally, there was a closed issue titled knowledge base does not work, where the solution involved ensuring that vector index data in Weaviate files was not missing due to incorrect deletion of embedded records in the database.

For your specific issue with the Knowledge API in a self-hosted Docker environment, ensure that:

  1. The API-Key is included in the Authorization HTTP Header in the correct format: Authorization: Bearer {API_KEY}.
  2. The request body includes the required fields: knowledge_id, query, and retrival_setting with top_k and score_threshold values.
  3. Check for any CORS configuration issues in your docker-compose.yml file, as these can cause access problems.
  4. Verify that the server URL and endpoint configurations are correct.

If you encounter specific error messages or codes, such as "Invalid Authorization header format" or "The knowledge does not exist," refer to the error handling guidelines to resolve these issues [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 6, 2024): <!-- Greeting --> @hope12122 Hello there! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve this issue. <!-- Answer --> I found some similar discussions that might be relevant to your issue: 1. [DIY API interface call, unable to parse context](https://github.com/langgenius/dify/discussions/10044) - This discussion is unsolved and was last updated on October 30, 2024. 2. [Connection error: request error, status_code: 503](https://github.com/langgenius/dify/discussions/6181) - This discussion is unsolved and was last updated on October 25, 2024. 3. [The answer in the knowledge base API corresponds to which feature in the platform?](https://github.com/langgenius/dify/discussions/9303) - This discussion is unsolved and was last updated on October 14, 2024. Additionally, there was a closed issue titled [knowledge base does not work](https://github.com/langgenius/dify/issues/1654), where the solution involved ensuring that vector index data in Weaviate files was not missing due to incorrect deletion of embedded records in the database. For your specific issue with the Knowledge API in a self-hosted Docker environment, ensure that: 1. The API-Key is included in the Authorization HTTP Header in the correct format: `Authorization: Bearer {API_KEY}`. 2. The request body includes the required fields: `knowledge_id`, `query`, and `retrival_setting` with `top_k` and `score_threshold` values. 3. Check for any CORS configuration issues in your `docker-compose.yml` file, as these can cause access problems. 4. Verify that the server URL and endpoint configurations are correct. If you encounter specific error messages or codes, such as "Invalid Authorization header format" or "The knowledge does not exist," refer to the error handling guidelines to resolve these issues <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/.gitbook/assets/Dify-test.openapi.json)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/guides/knowledge-base/external-knowledge-api-documentation.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Nov 6, 2024):

What did you get? Please provide more information other than an image.

@crazywoola commented on GitHub (Nov 6, 2024): What did you get? Please provide more information other than an image.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6592