when Create session with agent there is an error #9261
Replies: 2 comments
|
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. Share context across your team and agents. Try Dosu. |
|
@bensonleunglcy The traceback is quite helpful here: if req is None or not req.get(ele["key"]):
KeyError: 'key'combined with your debug output: {
'channelcodes': {
'name': 'channelcodes',
'optional': False,
'options': [],
'type': 'line',
'value': None
}
}suggests that the backend is expecting each Begin parameter to contain a According to the current RAGFlow API documentation, Begin component parameters are defined with a From what I can tell, there is a mismatch between:
A few questions that would help narrow it down:
If the exported DSL only contains If this solves your problem, feel free to mark it as the accepted answer so others can find it easily. |
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'!!!!
All reactions