iflytek/astron-agent · error · BusinessException

BOT_STATUS_INVALID

BOT_STATUS_INVALID

Error message

BOT_STATUS_INVALID

What it means

BOT_STATUS_INVALID is thrown by ShareServiceImpl.getBotStatus when no bot detail can be found for the given relatedId. Since the status cannot be determined for a non-existent bot, the service raises this business error instead of returning a default status.

Solutions

  1. Verify the relatedId refers to an existing, non-deleted bot
  2. Re-fetch the correct bot ID from the sharing source and retry
  3. Check chatBotDataService/DB to confirm the bot detail row exists

Example fix

// before
int status = shareService.getBotStatus(deletedBotId);
// after
if (chatBotDataService.getBotDetail(botId) != null) {
    int status = shareService.getBotStatus(botId);
}
Defensive patterns

Strategy: type-guard

Validate before calling

BotDetail detail = chatBotDataService.getBotDetail(relatedId); if (detail == null) { /* abort: bot does not exist */ }

Type guard

boolean botExists(Long relatedId) { return relatedId != null && chatBotDataService.getBotDetail(relatedId) != null; }

Try / catch

try { int status = shareService.getBotStatus(relatedId); } catch (BusinessException e) { /* treat as bot-not-found: show 'agent unavailable' page */ }

Prevention

When it happens

Trigger: Calling getBotStatus with a relatedId that does not correspond to any existing bot detail record (deleted bot, wrong ID, or record from another space).

Common situations: Sharing a link to an agent that has since been deleted; stale share URLs embedding old bot IDs; cross-space ID collisions; typos in bot identifiers.

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/d3fcc0530b090e04. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/share/impl/ShareServiceImpl.java:42

    @Autowired
    private ChatBotDataService chatBotDataService;

    @Autowired
    private ShareDataService shareDataService;


    /**
     * Get bot status
     *
     * @param relatedId Related ID
     * @return Bot status
     * @throws BusinessException If unable to get bot status
     */
    @Override
    public int getBotStatus(Long relatedId) {
        BotDetail detail = chatBotDataService.getBotDetail(relatedId);
        if (Objects.isNull(detail)) {
            throw new BusinessException(ResponseEnum.BOT_STATUS_INVALID);
        }
        return detail.getBotStatus();
    }

    /**
     * Generate a share key for the agent
     *
     * @param uid uid
     * @param relatedType type
     * @param relatedId id
     * @return string
     */
    @Override
    public String getShareKey(String uid, int relatedType, Long relatedId) {
        AgentShareRecord record = shareDataService.findActiveShareRecord(uid, relatedType, relatedId);
        if (Objects.isNull(record)) {
            // Generate a new key and save it to the table
            String key = Md5Util.encryption(relatedId + "_salt_" + uid + System.currentTimeMillis() / 1000);

View on GitHub (pinned to 5e758547a8)