iflytek/astron-agent · warning
Version ID is null, skipping audit result update
Error message
Version ID is null, skipping audit result update
What it means
updateAuditResult is the callback that writes an audit/review outcome onto a workflow version row. If versionId is null it cannot target a row, so it logs a warning and returns false instead of throwing. The publish flow continues without the audit result being recorded.
Solutions
- Fix the version creation path so publishWorkflow always has a non-null versionId before audit update (ensure useGeneratedKeys/id backfill)
- Guard publishWorkflow: abort or queue the audit update when versionId is null rather than calling with null
- Return false is current behavior — make callers check the boolean and alert when audit result was not persisted
- Log botId/publish context alongside the warning for traceability
Example fix
// before
if (versionId == null) {
log.warn("Version ID is null, skipping audit result update");
return false;
}
// after
if (versionId == null) {
log.error("Version ID is null for flowId={}, audit result not persisted", flowId);
throw new IllegalStateException("Cannot update audit result: versionId is null");
} Defensive patterns
Strategy: type-guard
Validate before calling
// before updating audit result
if (version == null || version.getId() == null) {
throw new IllegalStateException("Publish failed: no persisted version id for flowId " + flowId);
} Type guard
boolean canUpdateAudit(WorkflowVersion v) { return v != null && v.getId() != null; } Try / catch
boolean updated = service.updateAuditResult(versionId, flowId, result, uid, spaceId);
if (!updated) {
log.error("Audit result not persisted for flowId={} (versionId={})", flowId, versionId);
auditRetryQueue.add(new AuditUpdate(versionId, flowId, result));
} Prevention
- Configure MyBatis-Plus id auto-generation (KeyGenerator/useGeneratedKeys) so inserted entities carry their id
- Always create-and-persist the version row before scheduling audit callbacks
- Check the boolean return of updateAuditResult and alert/retry on false
- Include botId and flowId in the warn log for faster triage
When it happens
Trigger: publishWorkflow completes and invokes the audit-result update while versionId is null — i.e. the version row was never created or its generated ID was not propagated back to the caller (insert failed silently, ID backfill disabled, or publish path skipped version creation).
Common situations: Publish where version creation was skipped or failed earlier; MyBatis-Plus insert without useGeneratedKeys so the entity id stays null; manual/mock invocation of the update with a null id; async audit callback racing ahead of version persistence.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/37643f1568074cac.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/workflow/impl/WorkflowReleaseServiceImpl.java:296
}
log.warn("SysData is empty for version: botId={}, versionName={}", botId, versionName);
return null;
} catch (Exception e) {
log.error("Exception occurred while getting version system data: botId={}, versionName={}",
botId, versionName, e);
return null;
}
}
/**
* Update audit result
*/
private boolean updateAuditResult(
Long versionId, String flowId, String auditResult, String executionUid, Long executionSpaceId) {
if (versionId == null) {
log.warn("Version ID is null, skipping audit result update");
return false;
}
try {
log.info("Updating audit result: versionId={}, auditResult={}", versionId, auditResult);
WorkflowVersion update = new WorkflowVersion();
update.setId(versionId);
update.setFlowId(flowId);
update.setPublishResult(auditResult);
var response = versionService.updateChannelResultForBoundBotPublish(
update, executionUid, executionSpaceId);
if (response != null && response.code() == 0) {
log.info("Successfully updated audit result: versionId={}, auditResult={}", versionId, auditResult);
return true;
}
log.error("Failed to update audit result: versionId={}, auditResult={}", versionId, auditResult);
return false;View on GitHub (pinned to 5e758547a8)