fix(dify): add GET method support to /dify/retrieval for health check#13837
Open
Lntanohuang wants to merge 1 commit intoinfiniflow:mainfrom
Open
fix(dify): add GET method support to /dify/retrieval for health check#13837Lntanohuang wants to merge 1 commit intoinfiniflow:mainfrom
Lntanohuang wants to merge 1 commit intoinfiniflow:mainfrom
Conversation
Dify external knowledge base sends GET requests for connectivity verification. The endpoint only accepted POST, causing werkzeug to return 405 Method Not Allowed. Add a GET handler that returns a simple success response. Closes infiniflow#13788 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/v1/dify/retrievalendpoint for Dify external knowledge base connectivity verificationProblem
When Dify integrates with RAGFlow as an external knowledge base, it sends periodic GET requests to the retrieval endpoint for health/connectivity checks. The endpoint only accepted POST, causing werkzeug to return
405 Method Not Allowed. After several successful POST retrievals, the failing GET health checks trigger Dify's circuit breaker, causing all subsequent requests to fail.Traceback from the issue:
Changes
api/apps/sdk/dify_retrieval.py: Added a separate GET route handler (retrieval_health_check) that returnsget_json_result(data=True)Test plan
GET /api/v1/dify/retrievalreturns{"code": 0, "message": "success", "data": true}POST /api/v1/dify/retrievalwith valid API key and body still works as beforeCloses #13788
🤖 Generated with Claude Code