Repository navigation
fix: raise gunicorn request line limit to keep tags API working with hundreds of knowledge bases - #7232
Closed
Jackkp0t wants to merge 1 commit into
Closed
fix: raise gunicorn request line limit to keep tags API working with hundreds of knowledge bases#7232Jackkp0t wants to merge 1 commit into
Jackkp0t wants to merge 1 commit into
Conversation
Member
|
It can't solve the problem, it only delays it. |
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.
What
Set gunicorn
--limit-request-lineto 8190 bytes (the maximum it accepts) inapps/common/management/commands/services/services/gunicorn.py, instead of relying on the 4094-byte default.Why
The search-document workflow node fetches its tag options on page load via
(
ui/src/workflow/nodes/search-document-node/index.vuewatchesknowledge_id_listand callsgetAllTagswith the node's full list; axios serializes the array as repeatedknowledge_ids[]=params, which the backend reads viarequest.query_params.getlist('knowledge_ids[]').)With hundreds of associated knowledge bases each
knowledge_ids[]=<uuid>param adds ~58 bytes, so the request line reaches ~5,766 bytes at 100 ids. Production runs gunicorn (docker entrypointpython main.py start→GunicornService), whose defaultlimit_request_lineis 4094 bytes; over-limit request lines are answered with HTTP 400 (workers/base.py: handle_errormapsLimitRequestLinetostatus_int = 400). The tag dropdown therefore shows 无数据 exactly as reported in #7199. Dev mode uses Djangorunserver, which has no such limit — which is why it doesn't reproduce locally.8190 bytes covers ~140 knowledge base ids and also protects other legitimate long-GET endpoints.
How verified
gunicorn/http/message.py+errors.py): with the default 4094, a 100-id request line (5,766 bytes) raisesLimitRequestLine→ HTTP 400 (Request Line is too large (5766 > 4094)); with 8190 the same request parses and yields all 100 params. Also verified at 140 ids / 8,046 bytes.python -m py_compilepasses;ruff check/ruff format --checkfindings on this file are byte-identical to the upstream baseline (pre-existing star-import F403/F405 and formatting), i.e. zero new findings from this change.Closes #7199