{"record":{"id":"c542e52e1a05c1d0","repo":"iflytek/astron-agent","slug":"update-market-record-publish-channel-failed-record-not-found","errorCode":null,"errorMessage":"Update market record publish channel failed, record not found: botId={}, uid={}, spaceId={}","messagePattern":"Update market record publish channel failed, record not found: botId=(.+?), uid=(.+?), spaceId=(.+?)","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":343,"sourceCode":"    private void createMarketRecordForChannel(Integer botId, String uid, Long spaceId, String channels) {\n        // Publish event to create market record - handled by InstructionalBotPublishListener\n        eventPublisher.publishEvent(new BotPublishStatusChangedEvent(\n                this, botId, uid, spaceId, \"PUBLISH\",\n                null, ShelfStatusEnum.OFF_SHELF.getCode(), channels));\n        log.info(\"Create market record event published: botId={}, uid={}, spaceId={}, channels={}\",\n                botId, uid, spaceId, channels);\n    }\n\n    /**\n     * Update market record publish channel\n     */\n    private void updateMarketRecordChannels(Integer botId, String uid, Long spaceId, String channels) {\n        try {\n            int updateCount = chatBotMarketMapper.updatePublishStatus(botId, uid, spaceId, null, channels);\n            if (updateCount > 0) {\n                log.info(\"Update market record publish channel successfully: botId={}, channels={}\", botId, channels);\n            } else {\n                log.warn(\"Update market record publish channel failed, record not found: botId={}, uid={}, spaceId={}\",\n                        botId, uid, spaceId);\n            }\n        } catch (Exception e) {\n            log.error(\"Update market record publish channel exception: botId={}, uid={}, spaceId={}, channels={}\",\n                    botId, uid, spaceId, channels, e);\n        }\n    }\n\n    /**\n     * Convert time series data items\n     */\n    private List<BotTimeSeriesResponseDto.TimeSeriesItem> convertToTimeSeriesItems(\n            List<BotTimeSeriesStatsVO> timeSeriesStats, String type) {\n        return timeSeriesStats.stream()\n                .map(stats -> {\n                    Integer count = switch (type) {\n                        case \"user\" -> stats.getUserCount();\n                        case \"token\" -> stats.getTokenCount();","sourceCodeStart":325,"sourceCodeEnd":361,"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#L325-L361","documentation":"A warn log when updating the market record's publish channels matches 0 rows, meaning no market record exists for that botId/uid/spaceId. The update is silently skipped; exceptions are also swallowed.","triggerScenarios":"updatePublishChannel calls updateMarketRecordChannels before any market row was created (bot never published), or uid/spaceId don't match the stored row.","commonSituations":"Adding a publish channel for a bot that was never published to the market; space mismatch after bot moved between spaces; stale uid after account changes.","solutions":["Ensure the bot has a market record (publish once) before updating channels","Insert a market record if missing instead of only updating","Verify botId/uid/spaceId values match the existing chat_bot_market row"],"exampleFix":"// before\nint updateCount = chatBotMarketMapper.updatePublishStatus(botId, uid, spaceId, null, channels);\n// after\nint updateCount = chatBotMarketMapper.updatePublishStatus(botId, uid, spaceId, null, channels);\nif (updateCount == 0) {\n    chatBotMarketMapper.insertMarketRecord(botId, uid, spaceId, channels); // create-if-missing\n}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["database","update","record-not-found"],"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-19T12:17:13.211Z"}