{"record":{"id":"1514530474dcd0ee","repo":"iflytek/astron-agent","slug":"update-bot-failed","errorCode":"UPDATE_BOT_FAILED","errorMessage":"UPDATE_BOT_FAILED","messagePattern":"UPDATE_BOT_FAILED","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/commons/src/main/java/com/iflytek/astron/console/commons/service/bot/impl/BotServiceImpl.java","lineNumber":556,"sourceCode":"                    .supportSystem(bot.getSupportSystem())\n                    .promptType(bot.getPromptType())\n                    .model(bot.getModel())\n                    .isSentence(bot.getIsSentence())\n                    .openedTool(bot.getOpenedTool())\n                    .mcpServerUrls(serializeMcpServerUrls(bot.getMcpServerUrls()))\n                    .clientType(bot.getClientType())\n                    .inputExample(bot.getInputExample() != null && bot.getInputExample().size() > 0 ? String.join(BOT_INPUT_EXAMPLE_SPLIT, bot.getInputExample()) : null)\n                    .modelId(bot.getModelId())\n                    .build();\n\n            chatBotDataService.updateBot(botBase);\n            chatListDataService.updateChatBotList(botBase);\n            chatBotMarketService.updateBotMarketStatus(uid, botId);\n\n            synchronizeWorkflowIfNeeded(botId, bot, request, spaceId);\n        } catch (Exception e) {\n            log.error(\"uid update bot error, uid: {}\", uid, e);\n            throw new BusinessException(ResponseEnum.UPDATE_BOT_FAILED);\n        }\n    }\n\n    private void synchronizeWorkflowIfNeeded(Integer botId, BotCreateForm bot, HttpServletRequest request, Long spaceId) {\n        UserLangChainInfo userLangChainInfo = userLangChainDataService.findOneByBotId(botId);\n        if (Objects.nonNull(userLangChainInfo)) {\n            maasUtil.synchronizeWorkFlow(userLangChainInfo, bot, request, spaceId, BotVersionEnum.WORKFLOW.getVersion(), null);\n        }\n    }\n\n    private void updateBasicBotInternal(String uid, BotCreateForm bot) {\n        try {\n            ChatBotBase botBase = createUpdateBotBase(uid, bot);\n            setEnglishInputExamplesIfPresent(botBase, bot.getInputExampleEn());\n\n            chatBotDataService.updateBot(botBase);\n            chatListDataService.updateChatBotList(botBase);\n            chatBotDataService.updateChatBotMarket(botBase);","sourceCodeStart":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/commons/src/main/java/com/iflytek/astron/console/commons/service/bot/impl/BotServiceImpl.java#L538-L574","documentation":"BusinessException with code UPDATE_BOT_FAILED thrown by updateWorkflowBotInternal when any step of the workflow-bot update fails — bot base update, list update, market-status refresh, or workflow synchronization (synchronizeWorkflowIfNeeded). The root cause is logged with the uid and masked behind this generic error.","triggerScenarios":"Calling updateWorkflowBot while an inner operation throws: DB update failure on chatBotDataService/chatListDataService, chatBotMarketService.updateBotMarketStatus error, or a failure synchronizing the bound workflow (userLangChainInfo lookup / flow sync).","commonSituations":"Workflow service (core/workflow) unreachable or returning errors during synchronizeWorkflowIfNeeded; DB lock contention; bot deleted by another session mid-update; market table constraint violations.","solutions":["Inspect server logs for 'uid update bot error' to identify which inner step failed.","If workflow sync is the cause, check core/workflow service health and the bot's flowId validity.","Confirm the bot still exists and retry the update.","Check DB connectivity and any constraint violations reported alongside the log entry."],"exampleFix":"// before: update while workflow service is down\nawait updateBot(botId, form); // fails inside synchronizeWorkflowIfNeeded\n// after: check flow health first\nif (await isWorkflowServiceHealthy()) await updateBot(botId, form);\nelse throw new Error('Workflow service unavailable; retry update later');","handlingStrategy":"retry","validationCode":"// ensure the bot exists and workflow service is reachable before updating\nconst bot = await getBot(botId);\nif (!bot) throw new Error('Bot not found');\nawait assertWorkflowServiceHealthy();","typeGuard":null,"tryCatchPattern":"try { await updateBot(botId, form); } catch (e) { if (e.code === 'UPDATE_BOT_FAILED') { const cause = await fetchServerLogHint(); if (cause?.includes('workflow')) await waitForWorkflowHealth(); return retry(); } throw e; }","preventionTips":["Check core/workflow health before bot updates that trigger sync","Confirm the bot's flowId binding is valid","Retry transient DB failures with backoff","Avoid concurrent updates to the same bot from multiple tabs"],"tags":["database","update","workflow","java"],"backgroundTag":"database-write-failed","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"}