iflytek/astron-agent · error · BusinessException
8100
8100
Error message
workflow.version.add.failed
What it means
Generic wrapper error thrown when an unexpected exception occurs inside VersionService.createVersion while persisting a new workflow version. BusinessExceptions are re-thrown unchanged; anything else (DB errors, NPEs, sanitizer failures) is masked as WORKFLOW_VERSION_ADD_FAILED (code 8100). The real cause is only visible in server logs.
Solutions
- Check server logs at the ERROR level around the request time for the wrapped root cause (BusinessException is passed through, so anything hitting 8100 came from an unexpected exception)
- Verify the database is reachable and workflow/workflow_version tables exist with the expected schema (flyway/migration state)
- Validate that createDto (name, flowId, data) is non-null and non-empty before calling the API
- Retry the version creation after fixing the underlying condition; if reproducible, add temporary logging or wrap the block to surface the original exception
Example fix
// before
} catch (Exception e) {
throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_ADD_FAILED);
}
// after
} catch (Exception e) {
log.error("createVersion failed for flowId={}", createDto.getFlowId(), e);
throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_ADD_FAILED);
} Defensive patterns
Strategy: try-catch
Validate before calling
if (dto == null || StrUtil.isBlank(dto.getName()) || StrUtil.isBlank(dto.getFlowId())) {
throw new IllegalArgumentException("name and flowId are required to create a workflow version");
} Try / catch
try {
ApiResult r = versionService.createVersion(dto);
if (r.getCode() == 8100) { /* check server logs / retry after validation */ }
} catch (BusinessException e) {
log.error("version add failed: {}", e.getMessage());
} Prevention
- Validate DTO fields (name, flowId, data) non-null before calling
- Monitor DB connectivity and migration state in the environment
- Re-throw with the cause logged server-side for diagnosability
- Keep workflow protocol JSON schema-valid before persisting
When it happens
Trigger: createForSpace or createForBoundBotPublish calls createVersion and any non-BusinessException is thrown during version row insertion, JSON protocol processing, or the version-name computation within the try block.
Common situations: Database connection failure or lock timeout on workflow_version insert; null data/name in the DTO causing NPE; JSON serialization errors on workflow protocol data; unique constraint violations; missing transaction state.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/d4a634360a5dab46.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/VersionService.java:279
latestConfig.setConfig(workflowConfig.getConfig());
workflowConfigMapper.updateById(workflowConfig);
} else {
workflowConfig.setVersionNum(versionNum);
workflowConfig.setId(null);
workflowConfig.setName(createDto.getName());
workflowConfigMapper.insert(workflowConfig);
}
}
workflowVersionMapper.insert(workflowVersion);
return ApiResult.success(new JSONObject()
.fluentPut("workflowVersionId", workflowVersion.getId())
.fluentPut("workflowVersionName", createDto.getName()));
} catch (BusinessException e) {
throw e;
} catch (Exception e) {
throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_ADD_FAILED);
}
//
}
private Workflow requireWorkflow(String flowId) {
Workflow workflow = workflowMapper.selectOne(Wrappers.lambdaQuery(Workflow.class)
.eq(Workflow::getFlowId, flowId)
.eq(Workflow::getDeleted, false));
if (workflow == null || Boolean.TRUE.equals(workflow.getDeleted())) {
throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST);
}
return workflow;
}
/**
* Update isVersion flag for all versions of a specific flowId. Sets all versions' isVersion to 2
* (inactive) for the given flowId.
*View on GitHub (pinned to 5e758547a8)