iflytek/astron-agent · error · BusinessException
BOT_NOT_EXIST
BOT_NOT_EXIST
Error message
BOT_NOT_EXIST
What it means
Thrown by WorkflowService.hasQaNode when no UserLangChainInfo record (the assistant protocol binding) exists for the given botId. The service requires a bot-to-flow association before it can look up the workflow and check for QA nodes. BOT_NOT_EXIST signals the botId does not map to any assistant protocol row.
Solutions
- Verify the botId exists by querying user_lang_chain_info for that botId before calling hasQaNode.
- Confirm you are using the botId (not flowId or bot market id) and are in the correct tenant/space.
- Recreate the assistant protocol binding for the bot, or use a botId of an existing bot.
Example fix
// before
Boolean flag = workflowService.hasQaNode(unknownBotId);
// after
UserLangChainInfo info = userLangChainInfoDao.selectOne(
new LambdaQueryWrapper<UserLangChainInfo>().eq(UserLangChainInfo::getBotId, botId));
if (info == null) {
throw new BusinessException(ResponseEnum.BOT_NOT_EXIST); // fail fast with same signal
}
Boolean flag = workflowService.hasQaNode(botId); Defensive patterns
Strategy: validation
Validate before calling
boolean botExists = userLangChainInfoDao.selectCount(
new LambdaQueryWrapper<UserLangChainInfo>().eq(UserLangChainInfo::getBotId, botId)) > 0;
if (!botExists) throw new BusinessException(ResponseEnum.BOT_NOT_EXIST); Type guard
if (botId == null || botId <= 0) { return false; } Try / catch
try {
Object result = workflowService.hasQaNode(botId);
} catch (BusinessException e) {
if ("BOT_NOT_EXIST".equals(e.getCode())) {
// show 'bot not found', prompt user to reselect
} else { throw e; }
} Prevention
- Always resolve botId from a fresh API list call, never from cached/bookmarked values.
- Confirm the bot belongs to the current space/tenant before querying.
- Log the botId with the request so stale references surface quickly.
When it happens
Trigger: Calling the hasQaNode API with a botId that has no row in the user_lang_chain_info table — e.g. a bot never created through this system, a typo'd/stale botId, or a bot whose protocol record was deleted.
Common situations: Client caches a botId from an old environment or another tenant's space; the bot was deleted but a bookmarked URL or scheduled job still references it; passing an internal workflow flowId instead of a botId.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/e1864d0b0bf0a508.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java:5085
workflow.setData(workflow.getData().replace(oldAppId, appId));
}
if (StringUtils.isNotBlank(workflow.getPublishedData())) {
workflow.setPublishedData(workflow.getPublishedData().replace(oldAppId, appId));
}
}
workflow.setAppId(appId);
workflow.setUpdateTime(new Date());
if (workflowMapper.updateById(workflow) != 1) {
throw new BusinessException(ResponseEnum.INTERNAL_SERVER_ERROR);
}
}
public Object hasQaNode(Integer botId) {
UserLangChainInfo userLangChainInfo = userLangChainInfoDao.selectOne(new LambdaQueryWrapper<UserLangChainInfo>().eq(UserLangChainInfo::getBotId, botId));
if (Objects.isNull(userLangChainInfo)) {
log.error("----- Assistant protocol not found, botId: {}", botId);
throw new BusinessException(ResponseEnum.BOT_NOT_EXIST);
}
String flowId = userLangChainInfo.getFlowId();
Workflow workflow = workflowMapper.selectOne(Wrappers.lambdaQuery(Workflow.class)
.eq(Workflow::getFlowId, flowId)
.eq(Workflow::getDeleted, false)
.last("limit 1"));
if (workflow == null) {
throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST);
}
dataPermissionCheckTool.checkWorkflowVisible(workflow, SpaceInfoUtil.getSpaceId());
Boolean flag = checkFlowHasQaNode(workflow);
return ApiResult.success(flag);
}
private static @NotNull Boolean checkFlowHasQaNode(Workflow workflow) {
BizWorkflowData bizWorkflowData = JSON.parseObject(workflow.getData(), BizWorkflowData.class);
if (bizWorkflowData == null) {
return false;View on GitHub (pinned to 5e758547a8)