iflytek/astron-agent · error · BusinessException
8104
8104
Error message
workflow.version.get.max.failed
What it means
VersionService.getMaxVersion wraps any non-BusinessException failure of the max-version query into BusinessException(ResponseEnum.WORKFLOW_VERSION_GET_MAX_FAILED, code 8104). It is a catch-all indicating the latest-version lookup itself failed unexpectedly (as opposed to WORKFLOW_NOT_EXIST, which is rethrown unchanged).
Solutions
- Inspect the server log line 'Query workflow maximum version number exception' for the root cause.
- Send a numeric botId (e.g. "42", not "abc" or "").
- Ensure the request carries valid space context so SpaceInfoUtil.getSpaceId() resolves.
- Check DB health (connection pool, slow queries) if logs show SQL exceptions, then retry.
Example fix
// before
getMaxVersion(request.getParameter("botId")); // may be non-numeric -> 8104
// after
String botId = request.getParameter("botId");
if (botId == null || !botId.matches("\\d+")) {
throw new BusinessException(ResponseEnum.PARAM_ERROR);
}
getMaxVersion(botId); Defensive patterns
Strategy: try-catch
Validate before calling
if (botId == null || !botId.matches("\\d+")) throw new BusinessException(ResponseEnum.PARAM_ERROR); Try / catch
try {
getMaxVersion(botId);
} catch (BusinessException e) {
if (e.getCode() == 8104) {
log.error("max-version lookup failed for bot {}", botId, e); // inspect root cause, retry or degrade
}
} Prevention
- Always pass numeric botIds as strings of digits.
- Ensure requests include the space context header so SpaceInfoUtil.getSpaceId() works.
- Monitor DB pool health; the underlying SQL failure surfaces as 8104.
When it happens
Trigger: Integer.valueOf(botId) throws NumberFormatException for a non-numeric botId; a MyBatis-Plus/SQL exception while selecting the latest WorkflowVersion; SpaceInfoUtil.getSpaceId() failing (no space context); permission-check tool throwing a non-Business runtime exception.
Common situations: Frontend sends a string or empty botId; database connection pool exhausted; space ID missing from the request context (direct API call without the space header); schema drift between botId types.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/3957ea5548be4e83.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/VersionService.java:776
.eq(WorkflowVersion::getFlowId, flowId)
.eq(WorkflowVersion::getDeleted, false)
.in(WorkflowVersion::getPublishResult,
WorkflowConst.PublishResult.SUCCESS,
WorkflowConst.PublishResult.LEGACY_SUCCESS,
WorkflowConst.PublishResult.LEGACY_SUCCESS_UPPER)
.orderByDesc(WorkflowVersion::getCreatedTime)
.last("LIMIT 1"));
// Return result: if version exists return version name, if no version return "Draft Version"
String versionDisplay = (latestVersion != null) ? latestVersion.getName() : "Draft Version";
JSONObject workflowMaxVersion = new JSONObject().fluentPut("workflowMaxVersion", versionDisplay)
.fluentPut("versionNum", (latestVersion != null) ? latestVersion.getVersionNum() : "0");
return ApiResult.success(workflowMaxVersion);
} catch (BusinessException e) {
throw e;
} catch (Exception e) {
log.error("Query workflow maximum version number exception, botId: {}", botId, e);
throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_GET_MAX_FAILED);
}
}
}
View on GitHub (pinned to 5e758547a8)