iflytek/astron-agent · error · BusinessException
DATA_NOT_EXIST
DATA_NOT_EXIST
Error message
DATA_NOT_EXIST
What it means
getScopedArtifact throws DATA_NOT_EXIST when no WorkflowArtifact row matches the given ID under the current scope (deleted=FALSE plus the current space/uid filter). The artifact either never existed, was soft-deleted, or belongs to another space/user, but the error deliberately does not distinguish these cases to avoid leaking existence information.
Solutions
- Refresh the artifact list and use a current, valid artifact ID
- Verify you are operating in the correct space and account that owns the artifact
- If the artifact should exist, query the DB directly (including deleted rows) to check whether it was soft-deleted
- Remove or invalidate cached artifact references in the client after deletion
Example fix
// before: stale reference after delete await deleteArtifact(id); await downloadArtifact(id); // DATA_NOT_EXIST // after await deleteArtifact(id); const list = await listArtifacts(workflowId); const next = list.find(a => a.id !== id); if (next) await downloadArtifact(next.id);
Defensive patterns
Strategy: fallback
Validate before calling
// Check existence in a list call before a direct fetch
boolean exists = artifactApi.listArtifacts(workflowId).stream()
.anyMatch(a -> a.getId().equals(artifactId)); Try / catch
try {
return artifactApi.get(artifactId);
} catch (BusinessException e) {
if ("DATA_NOT_EXIST".equals(e.getCode())) {
log.info("Artifact {} not found under current scope; refreshing list", artifactId);
return Optional.empty(); // treat as absent, refresh client state
}
throw e;
} Prevention
- Invalidate cached artifact references after delete operations
- Always operate within the space that owns the artifact
- Handle stale-ID races by refreshing the list rather than retrying the direct fetch
When it happens
Trigger: Requesting an artifact ID that was already deleted (deleteArtifact sets deleted=TRUE); using an ID from a different space or user; stale ID cached in the frontend after deletion; querying before the upload transaction commits.
Common situations: UI keeping a stale artifact reference after a delete; copying an artifact ID/URL from another environment or space; race between delete and a concurrent download.
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/30a7e787b8a085da.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowArtifactService.java:373
"Failed to compensate workflow artifact upload, bucket={}, objectKey={}",
artifactProperties.getArtifactBucket(),
objectKey);
}
throw exception;
}
}
private WorkflowArtifact getScopedArtifact(Long artifactId) {
if (artifactId == null) {
throw new BusinessException(ResponseEnum.PARAM_ERROR);
}
LambdaQueryWrapper<WorkflowArtifact> wrapper = Wrappers.lambdaQuery(WorkflowArtifact.class)
.eq(WorkflowArtifact::getId, artifactId)
.eq(WorkflowArtifact::getDeleted, Boolean.FALSE);
applyCurrentArtifactScope(wrapper);
WorkflowArtifact artifact = getOne(wrapper, false);
if (artifact == null) {
throw new BusinessException(ResponseEnum.DATA_NOT_EXIST);
}
return artifact;
}
private LambdaQueryWrapper<WorkflowArtifact> scopeQuery(Long workflowId) {
LambdaQueryWrapper<WorkflowArtifact> wrapper = Wrappers.lambdaQuery(WorkflowArtifact.class)
.eq(WorkflowArtifact::getWorkflowId, workflowId)
.eq(WorkflowArtifact::getDeleted, Boolean.FALSE);
applyCurrentArtifactScope(wrapper);
return wrapper;
}
private void applyCurrentArtifactScope(LambdaQueryWrapper<WorkflowArtifact> wrapper) {
String currentUid = UserInfoManagerHandler.getUserId();
Long spaceId = SpaceInfoUtil.getSpaceId();
if (StringUtils.isBlank(currentUid)) {
throw new BusinessException(ResponseEnum.UNAUTHORIZED);
}View on GitHub (pinned to 5e758547a8)