iflytek/astron-agent · warning
Query current publish channel failed: botId=
Error message
Query current publish channel failed: botId={}, uid={}, spaceId={} What it means
A warn log when querying the current publish channels for a bot fails or the market record can't be fetched; the method returns null so callers treat it as 'no channels'. Any exception from chatBotMarketMapper.selectBotDetail is caught here.
Solutions
- Confirm a chat_bot_market record exists for the botId/uid/spaceId combination before updating channels
- Verify the uid has access to the bot in the given spaceId
- Check DB connectivity/exception stack trace in the log for underlying errors
Example fix
// before
return queryResult != null ? queryResult.getPublishChannels() : null;
// after
if (queryResult == null) {
log.warn("No market record for botId={}, uid={}, spaceId={}", botId, uid, spaceId);
return ""; // or throw RecordNotFoundException
}
return queryResult.getPublishChannels(); Defensive patterns
Strategy: fallback
When it happens
Trigger: Calling updatePublishChannel (via currentChannels) where selectBotDetail throws (DB error) or returns null because the market row doesn't exist yet for botId/uid/spaceId.
Common situations: Bot never published to market so no chat_bot_market row; wrong spaceId passed; DB connectivity issue; permission filtering hides the row from the user.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/4f05e37115445b57.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/BotPublishServiceImpl.java:316
* Validate bot permission
*/
private void validateBotPermission(Integer botId, String uid, Long spaceId) {
Integer count = chatBotBaseMapper.checkBotPermission(botId, uid, spaceId);
if (count == null || count == 0) {
throw new BusinessException(ResponseEnum.BOT_NOT_EXISTS);
}
}
/**
* Get current publish channel
*/
private String getCurrentPublishChannels(Integer botId, String uid, Long spaceId) {
try {
var queryResult = chatBotMarketMapper.selectBotDetail(botId, uid, spaceId);
return queryResult != null ? queryResult.getPublishChannels() : null;
} catch (Exception e) {
log.warn("Query current publish channel failed: botId={}, uid={}, spaceId={}", botId, uid, spaceId, e);
return null;
}
}
/**
* Create market record (for publish channel) Note: This method now delegates to event-driven
* architecture
*/
private void createMarketRecordForChannel(Integer botId, String uid, Long spaceId, String channels) {
// Publish event to create market record - handled by InstructionalBotPublishListener
eventPublisher.publishEvent(new BotPublishStatusChangedEvent(
this, botId, uid, spaceId, "PUBLISH",
null, ShelfStatusEnum.OFF_SHELF.getCode(), channels));
log.info("Create market record event published: botId={}, uid={}, spaceId={}, channels={}",
botId, uid, spaceId, channels);
}
/**View on GitHub (pinned to 5e758547a8)