{"record":{"id":"68b03833b88f2a1e","repo":"iflytek/astron-agent","slug":"no-flowid-found-for-botid","errorCode":null,"errorMessage":"No flowId found for botId={}","messagePattern":"No flowId found for botId=(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/BotPublishServiceImpl.java","lineNumber":194,"sourceCode":"            return maasAppId;\n        }\n    }\n\n\n    // ==================== Version Management ====================\n\n    @Override\n    public PageResponse<BotVersionVO> getBotVersions(Integer botId, Integer page, Integer size, String uid, Long spaceId) {\n        log.info(\"Query workflow version list: botId={}, page={}, size={}, uid={}, spaceId={}\",\n                botId, page, size, uid, spaceId);\n\n        // 1. Permission validation - ensure user has permission to access the bot\n        validateBotPermission(botId, uid, spaceId);\n\n        // 2. Get flowId from botId\n        String flowId = userLangChainDataService.findFlowIdByBotId(botId);\n        if (flowId == null || flowId.trim().isEmpty()) {\n            log.warn(\"No flowId found for botId={}\", botId);\n            return PageResponse.of(page, size, 0L, new ArrayList<>());\n        }\n\n        // 3. Pagination query version list - query workflow_version table using flowId\n        Page<WorkflowVersion> pageParam = new Page<>(page, size);\n        Page<WorkflowVersion> resultPage = workflowVersionMapper.selectPageByCondition(pageParam, flowId);\n\n        // 4. Use MapStruct batch conversion to VO\n        List<WorkflowVersion> versions = resultPage.getRecords();\n        List<BotVersionVO> versionList = workflowVersionConverter.toVersionVOList(versions);\n\n        log.info(\"Query workflow version list successful: botId={}, flowId={}, total={}\", botId, flowId, resultPage.getTotal());\n        return PageResponse.of(page, size, resultPage.getTotal(), versionList);\n    }\n\n    // ==================== Statistics Data ====================\n\n    @Override","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/BotPublishServiceImpl.java#L176-L212","documentation":"A warn log emitted when no workflow flowId can be resolved for the given botId in getBotVersions. The service cannot query the workflow_version table without a flowId, so it returns an empty page instead of throwing. It indicates the bot has no linked LangChain workflow record.","triggerScenarios":"Calling getBotVersions with a botId whose user_lang_chain_info record is missing, deleted, or has a null/blank flowId.","commonSituations":"Bot created without ever being associated with a workflow; workflow linkage deleted during cleanup; whitespace-only flowId stored in DB; querying versions before first publish.","solutions":["Verify the bot has a linked workflow: check user_lang_chain_info table for the botId and confirm flow_id is non-null and non-blank","If the mapping is missing, recreate or repair the bot-workflow association before querying versions","Confirm the botId parameter passed to getBotVersions is the correct one (no ID mix-ups between bot and flow IDs)"],"exampleFix":"// before\nString flowId = userLangChainDataService.findFlowIdByBotId(botId);\n// after\nString flowId = userLangChainDataService.findFlowIdByBotId(botId);\nif (flowId == null || flowId.trim().isEmpty()) {\n    throw new EntityNotFoundException(\"No workflow linked to botId=\" + botId); // or return empty page intentionally\n}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["database","workflow","empty-result"],"backgroundTag":"record-not-found","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}