iflytek/astron-agent · error · CustomException
KNOWLEDGE_REQUEST_ERROR
KNOWLEDGE_REQUEST_ERROR
Error message
err code {background_json.get('code')}, reason {background_json.get('message')}, sid {background_json.get('sid')} What it means
knowledge_client.top_k raises when the knowledge-service background query responds with a non-success code; the message embeds the upstream code, message and sid. It is a passthrough guard: the workflow node's retrieval call failed server-side and the error carries the backend's own diagnostic fields.
Solutions
- Use the embedded sid and code to look up the knowledge-service logs
- Check knowledge backend health and auth (trace headers)
- Retry retrieval with backoff for transient upstream failures
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at core/workflow/engine/nodes/knowledge/knowledge_client.py:116 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/c99147f8bc8e0708.
Report an issue: GitHub.
Appendix: source
Thrown at core/workflow/engine/nodes/knowledge/knowledge_client.py:116
{
"url": url,
"req_headers": self.trace_headers(request_headers),
"req_body": payload,
}
)
session = HttpClient.get_session()
async with session.post(
url, headers=request_headers, json=json.loads(payload)
) as resp:
background_json = json.loads(await resp.text())
# background_json = requests.request("POST", url, headers=self.headers, data=payload).json()
if background_json.get("code") != 0:
msg = (
f"err code {background_json.get('code')}, "
f"reason {background_json.get('message')}, sid {background_json.get('sid')}"
)
request_span.add_error_event(msg)
raise CustomException(
err_code=CodeEnum.KNOWLEDGE_REQUEST_ERROR,
err_msg=f"{msg}",
cause_error=f"{msg}",
)
await request_span.add_info_events_async(
{"response": json.dumps(background_json, ensure_ascii=False)}
)
recall_contents = background_json.get("data", {})
recalls = json.dumps(recall_contents, ensure_ascii=False)
return recalls
except Exception as e:
err = str(e)
request_span.add_error_event(err)
raise CustomException(
err_code=CodeEnum.KNOWLEDGE_REQUEST_ERROR,
err_msg=f"Knowledge base POST request error: {err}",
cause_error=f"Knowledge base POST request error: {err}",
) from eView on GitHub (pinned to 5e758547a8)