iflytek/astron-agent · error · BusinessException

DATA_NOT_FOUND

DATA_NOT_FOUND

Error message

DATA_NOT_FOUND

What it means

BusinessException(ResponseEnum.DATA_NOT_FOUND) thrown by maasCopySynchronize when userLangChainDataService.selectByMaasId(originId) returns null. It means the MaaS sync task references an origin workflow ID that has no matching UserLangChainInfo record in the database, so the copy/synchronize flow cannot proceed. This is a lookup failure on internal workflow mapping data, not a client-input problem.

Solutions

  1. Verify the originId exists: SELECT * FROM user_lang_chain WHERE maas_id = <originId>; re-seed or restore the mapping row if missing.
  2. Confirm the sync task is targeting the correct datasource/space (spaceId) — the record may exist in another environment.
  3. If the source workflow was legitimately deleted, cancel/skip the stale synchronization task instead of retrying it.
  4. Re-trigger the synchronization after the workflow mapping has been recreated so selectByMaasId returns a valid record.

Example fix

// before: blindly syncing with a possibly stale id
workflowService.maasCopySynchronize(synchronize);
// after: pre-check existence and skip stale tasks
UserLangChainInfo info = userLangChainDataService.selectByMaasId(originId);
if (info == null) { log.warn("skip sync, no workflow for originId={}", originId); return; }
workflowService.maasCopySynchronize(synchronize);
Defensive patterns

Strategy: try-catch

Validate before calling

UserLangChainInfo info = userLangChainDataService.selectByMaasId(originId);
if (info == null) { /* skip or re-seed before calling maasCopySynchronize */ }

Try / catch

try { workflowService.maasCopySynchronize(synchronize); }
catch (BusinessException e) {
    if (ResponseEnum.DATA_NOT_FOUND.equals(e.getResponseEnum())) {
        log.warn("stale sync task, no workflow for originId={}", synchronize.getOriginId()); // cancel/skip
    } else { throw e; }
}

Prevention

When it happens

Trigger: Calling maasCopySynchronize with a synchronize DTO whose originId maps to no row in the user_lang_chain table (record deleted, wrong originId, or cross-space data never created). The check is Objects.isNull(info) right after the selectByMaasId call.

Common situations: Stale MaaS synchronization jobs running after the source workflow was deleted; environments where the sync data was seeded in one DB but the job runs against another; race between workflow deletion and queued sync tasks; manually crafted sync requests with an incorrect originId.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/48631a04a37279ba. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/commons/src/main/java/com/iflytek/astron/console/commons/service/workflow/impl/WorkflowServiceImpl.java:44

    private UserLangChainDataService userLangChainDataService;

    @Autowired
    private RedissonClient redissonClient;

    @Autowired
    private ChatBotDataService chatBotDataService;

    @Override
    public Integer maasCopySynchronize(CloneSynchronize synchronize) {
        String uid = synchronize.getUid();
        Long originId = synchronize.getOriginId();
        Long maasId = synchronize.getCurrentId();
        String flowId = synchronize.getFlowId();
        Long spaceId = synchronize.getSpaceId();
        UserLangChainInfo info = userLangChainDataService.selectByMaasId(originId);
        if (Objects.isNull(info)) {
            log.error("----- unable to find workflow: {}", JSONObject.toJSONString(synchronize));
            throw new BusinessException(ResponseEnum.DATA_NOT_FOUND);
        }
        Integer botId = info.getBotId();
        // If maasId already exists, end directly
        if (redissonClient.getBucket(MaasUtil.generatePrefix(uid, botId)).isExists()) {
            log.info("----- Xinghuo has obtained this workflow, ending task: {}", JSONObject.toJSONString(synchronize));
            redissonClient.getBucket(MaasUtil.generatePrefix(uid, botId)).delete();
            return botId;
        }
        ChatBotBase base = chatBotDataService.copyBot(uid, botId, spaceId);
        Long currentBotId = Long.valueOf(base.getId());
        UserLangChainInfo userLangChainInfo = UserLangChainInfo.builder()
                .id(currentBotId)
                .botId(Math.toIntExact(currentBotId))
                .maasId(maasId)
                .flowId(flowId)
                .uid(uid)
                .updateTime(LocalDateTime.now())
                .build();

View on GitHub (pinned to 5e758547a8)