[Bug][1.16.1] External knowledge base API endpoint validation accepts wrong RAGFlow endpoint and rejects the correct one
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 24.6k
- Avg merge
- 22h 9m
- Merged PRs (30d)
- 610
Description
### 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.16.1
### Cloud or Self Hosted
Self Hosted (Docker)
### Steps to reproduce
**Description**:
When adding an external knowledge base in Dify (version 1.16.1) with RAGFlow as the provider, the endpoint validation behaves incorrectly.
- Entering `http://[RAGFlow-address:port]/api/v1` passes validation and lets me add the knowledge base, but this endpoint does **not** actually work (no service can be retrieved).
- Entering the **correct** endpoint `http://[RAGFlow-address:port]/api/v1/dify` fails validation, preventing me from adding it, even though this endpoint is confirmed to be functional and is the documented one for RAGFlow’s Dify integration.
**Steps to Reproduce the bug**:
1. In Dify, navigate to the external knowledge base settings and choose **Create**.
2. Choose **Connect to an External Knowledge Base**.
3. Click **External Knowledge API** and select **Create a new Knowledge API**.
4. Enter the API endpoint as `http://[RAGFlow-address:port]/api/v1` (use your actual RAGFlow address and port).
5. Notice that validation passes and you can add the knowledge base.
6. Attempt to use the knowledge base – queries fail or no response is received.
7. Now, go back and change the endpoint to `http://[RAGFlow-address:port]/api/v1/dify`.
8. Notice that validation fails with an error, and you cannot add the knowledge base.
**Environment**:
- Dify version: 1.16.1
- RAGFlow version: 0.26.4
- OS: Ubuntu 22.04
- Deployment method: Docker
### ✔️ Expected Behavior
- The validation should accept the **correct** endpoint (`/api/v1/dify`) that actually works, and reject the incorrect one (`/api/v1`) that does not.
### ❌ Actual Behavior
- Validation accepts the incorrect endpoint (`/api/v1`) and rejects the correct one (`/api/v1/dify`).
Contributor guide
Research direction
No source file or test is named. Reproduce the external knowledge base creation flow with the two documented endpoints, then trace the endpoint validation entry point and add or update coverage so /api/v1/dify is accepted while /api/v1 is rejected for RAGFlow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100