iflytek/astron-agent · error · BusinessException

UPDATE_BOT_FAILED

UPDATE_BOT_FAILED

Error message

UPDATE_BOT_FAILED

What it means

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.

Solutions

  1. Inspect server logs for 'uid update bot error' to identify which inner step failed.
  2. If workflow sync is the cause, check core/workflow service health and the bot's flowId validity.
  3. Confirm the bot still exists and retry the update.
  4. Check DB connectivity and any constraint violations reported alongside the log entry.

Example fix

// before: update while workflow service is down
await updateBot(botId, form); // fails inside synchronizeWorkflowIfNeeded
// after: check flow health first
if (await isWorkflowServiceHealthy()) await updateBot(botId, form);
else throw new Error('Workflow service unavailable; retry update later');
Defensive patterns

Strategy: retry

Validate before calling

// ensure the bot exists and workflow service is reachable before updating
const bot = await getBot(botId);
if (!bot) throw new Error('Bot not found');
await assertWorkflowServiceHealthy();

Try / catch

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; }

Prevention

When it happens

Trigger: 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).

Common situations: Workflow service (core/workflow) unreachable or returning errors during synchronizeWorkflowIfNeeded; DB lock contention; bot deleted by another session mid-update; market table constraint violations.

Related errors


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

Appendix: source

Thrown at console/backend/commons/src/main/java/com/iflytek/astron/console/commons/service/bot/impl/BotServiceImpl.java:556

                    .supportSystem(bot.getSupportSystem())
                    .promptType(bot.getPromptType())
                    .model(bot.getModel())
                    .isSentence(bot.getIsSentence())
                    .openedTool(bot.getOpenedTool())
                    .mcpServerUrls(serializeMcpServerUrls(bot.getMcpServerUrls()))
                    .clientType(bot.getClientType())
                    .inputExample(bot.getInputExample() != null && bot.getInputExample().size() > 0 ? String.join(BOT_INPUT_EXAMPLE_SPLIT, bot.getInputExample()) : null)
                    .modelId(bot.getModelId())
                    .build();

            chatBotDataService.updateBot(botBase);
            chatListDataService.updateChatBotList(botBase);
            chatBotMarketService.updateBotMarketStatus(uid, botId);

            synchronizeWorkflowIfNeeded(botId, bot, request, spaceId);
        } catch (Exception e) {
            log.error("uid update bot error, uid: {}", uid, e);
            throw new BusinessException(ResponseEnum.UPDATE_BOT_FAILED);
        }
    }

    private void synchronizeWorkflowIfNeeded(Integer botId, BotCreateForm bot, HttpServletRequest request, Long spaceId) {
        UserLangChainInfo userLangChainInfo = userLangChainDataService.findOneByBotId(botId);
        if (Objects.nonNull(userLangChainInfo)) {
            maasUtil.synchronizeWorkFlow(userLangChainInfo, bot, request, spaceId, BotVersionEnum.WORKFLOW.getVersion(), null);
        }
    }

    private void updateBasicBotInternal(String uid, BotCreateForm bot) {
        try {
            ChatBotBase botBase = createUpdateBotBase(uid, bot);
            setEnglishInputExamplesIfPresent(botBase, bot.getInputExampleEn());

            chatBotDataService.updateBot(botBase);
            chatListDataService.updateChatBotList(botBase);
            chatBotDataService.updateChatBotMarket(botBase);

View on GitHub (pinned to 5e758547a8)