iflytek/astron-agent · critical · BusinessException
SYSTEM_ERROR
SYSTEM_ERROR
Error message
SYSTEM_ERROR
What it means
SYSTEM_ERROR is thrown by publishMcp when the MCP data insert (mcpDataMapper.insert) returns 0 rows affected, i.e. MyBatis-Plus inserted nothing. This is a generic persistence failure signal during step 8 of the MCP publish flow and rolls back the whole transaction.
Solutions
- Check service logs and DB connectivity; retry the publish after confirming MySQL is healthy.
- Inspect mcp_data schema against the McpData entity for missing/oversized columns; align column lengths with request field limits.
- Validate request payload sizes (content/description/icon) before publishing; truncate or enforce limits upstream.
- Re-run the publish; the @Transactional(rollbackFor=Exception.class) ensures earlier steps (registration, release) roll back so a retry is safe.
Example fix
// before
int result = mcpDataMapper.insert(mcpData);
if (result == 0) { throw new BusinessException(ResponseEnum.SYSTEM_ERROR); }
// after
try {
int result = mcpDataMapper.insert(mcpData);
if (result == 0) {
log.error("MCP insert affected 0 rows: botId={}, versionName={}", botId, versionName);
throw new BusinessException(ResponseEnum.SYSTEM_ERROR);
}
} catch (DataIntegrityViolationException e) {
log.error("MCP insert constraint violation: botId={}", botId, e);
throw new BusinessException(ResponseEnum.PARAM_ERROR); // clearer client signal
} Defensive patterns
Strategy: try-catch
Try / catch
try { mcpService.publishMcp(request, uid, spaceId); }
catch (BusinessException e) { if (e.getCode() == ResponseEnum.SYSTEM_ERROR) { alertOpsAndOfferRetry(); } else throw e; } Prevention
- Keep mcp_data schema in sync with the McpData entity across migrations.
- Enforce column-size limits on serverName/description/content/icon at input time.
- Monitor DB health; make publish retries idempotent (transaction rolls back on failure).
When it happens
Trigger: mcp_data insert affects 0 rows — typically DB connection failure, schema mismatch (e.g. missing columns like server_url/args), oversized field values (content/icon exceeding column limits), or a constraint violation surfaced as 0 affected rows.
Common situations: content or description longer than the column size; DB schema drifted after an upgrade (new not-null column not populated by the entity); database temporarily unreachable; bad serverUrl from registration making insert fail downstream of step 6.
Related errors
- BOT_NOT_EXISTS
- BOT_CHAIN_SUBMIT_ERROR
- BOT_UPDATE_FAILED
- Conversation statistics record failed: chatId=
- CREATE_BOT_FAILED
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/2dcc28a9a4c7d7f3.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/McpServiceImpl.java:105
.uid(currentUid)
.spaceId(spaceId)
.serverName(request.getServerName())
.description(request.getDescription())
.content(request.getContent())
.icon(request.getIcon())
.serverUrl(serverUrl) // Use server URL from MCP registration
.args(request.getArgs())
.versionName(versionName)
.released(1)
.isDelete(0)
.createTime(LocalDateTime.now())
.updateTime(LocalDateTime.now())
.build();
// 8. Save MCP data
int result = mcpDataMapper.insert(mcpData);
if (result == 0) {
throw new BusinessException(ResponseEnum.SYSTEM_ERROR);
}
// 9. Record the release (corresponds to releaseManageClientService.releaseMCP in original project)
recordMcpRelease(botId, versionName, currentUid, spaceId);
// 10. Update publish channel
botPublishService.updatePublishChannel(botId, currentUid, spaceId, PublishChannelEnum.MCP, true);
log.info("MCP published successfully: botId={}, mcpId={}, versionName={}",
botId, mcpData.getId(), versionName);
}
/**
* Get version name for MCP publishing (corresponds to
* releaseManageClientService.getVersionNameByBotId)
*/
private String getVersionName(Integer botId, String currentUid, Long spaceId) {
try {View on GitHub (pinned to 5e758547a8)