when Create session with agent there is an error #9261
Replies: 1 comment
-
The error happens because the backend expects each parameter from canvas.get_preset_param() to be a dictionary with a 'key' field, but your logged parameters only have fields like 'name', 'optional', and 'type', and are structured as a dictionary keyed by parameter name instead of a list of dicts with 'key' fields. This mismatch causes the KeyError when the backend tries to access ele['key'] see code. Recent frontend changes require every parameter object to include a 'key' property, and the parameter dialog UI now explicitly sets this field see PR #9129. If the frontend doesn't set 'key' correctly, or if the parameter structure is not a list of dicts with 'key', the backend will fail. Check that the frontend sends parameters as a list of dicts, each with a 'key' field (not just 'name'), before calling the backend. If you are not handling the frontend, coordinate with the frontend team to ensure this structure matches what the backend expects. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Iwhen i Create session with agent there is an error :
2025-08-05 21:38:57,265 ERROR 17 'key'
Traceback (most recent call last):
File "/ragflow/.venv/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
File "/ragflow/.venv/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "/ragflow/api/utils/api_utils.py", line 304, in decorated_function
return func(*args, **kwargs)
File "/ragflow/api/apps/sdk/session.py", line 101, in create_agent_session
if req is None or not req.get(ele["key"]):
KeyError: 'key'
And I try to log the ssesion.py, I got this :
query = canvas.get_preset_param()
import logging
logging.error(f"Query parameters: {query}")
2025-08-05 21:38:57,265 ERROR 17 Query parameters: {'channelcodes': {'name': 'channelcodes', 'optional': False, 'options': [], 'type': 'line', 'value': None}}
there is not 'key'!!!!
Beta Was this translation helpful? Give feedback.
All reactions