iflytek/astron-agent · error · BusinessException
LOGIN_INFO_ERROR
LOGIN_INFO_ERROR
Error message
LOGIN_INFO_ERROR
What it means
LOGIN_INFO_ERROR is thrown by ChatMessageController.clear when RequestContextUtil.getUID() returns null, meaning the request lacks valid login/session info from which a uid can be resolved. The endpoint cannot attribute or authorize the history clear without an authenticated user.
Solutions
- Re-authenticate to obtain a fresh token and retry
- Ensure the Authorization/session header is present on the request
- Verify the auth filter/interceptor covers the /clear route and populates the UID
- Clear stale client credentials and log in again
Example fix
// before curl "http://host/v1/clear?botId=1&chatId=2" // 401-ish LOGIN_INFO_ERROR // after curl -H "Authorization: Bearer $TOKEN" "http://host/v1/clear?botId=1&chatId=2"
Defensive patterns
Strategy: try-catch
Validate before calling
if (!authToken) throw new Error('login required before clearing chat history'); Type guard
const isAuthenticated = (ctx) => Boolean(ctx && ctx.uid);
Try / catch
try { await clearHistory(botId, chatId); } catch (e) { if (e.code === 'LOGIN_INFO_ERROR') { redirectToLogin(); } else throw e; } Prevention
- Attach the Authorization header via a shared HTTP client interceptor
- Handle token expiry globally with a refresh/re-login flow
- Never call authenticated endpoints from unauthenticated contexts
- Add a 401/login interceptor that maps to LOGIN_INFO_ERROR handling
When it happens
Trigger: GET /clear without authentication credentials or with an expired/invalid token so the auth filter never populated the request context; calling the endpoint from a non-authenticated context (internal job, curl without token).
Common situations: JWT/session expired mid-use; missing Authorization header; token format changed after an auth upgrade; direct API testing without going through the login flow.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/8ed31bcc2687e1a7.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/controller/chat/ChatMessageController.java:456
new ChatContext(uid, 0L, debugRequest.getBotId() == null ? 0 : debugRequest.getBotId()));
botChatService.debugChatMessageBot(debugChatReqDto, sseEmitter, sseId);
return sseEmitter;
} catch (Exception e) {
log.error("Bot debug error, sseId: {}", sseId, e);
SseEmitterUtil.completeWithError(sseEmitter, "Chat service exception: " + e.getMessage());
return sseEmitter;
}
}
/**
* Clear chat history
*/
@GetMapping(path = "/clear")
@Operation(summary = "Clear chat history")
public ApiResult<ChatListCreateResponse> clear(Integer botId, Long chatId) {
String uid = RequestContextUtil.getUID();
if (uid == null) {
throw new BusinessException(ResponseEnum.LOGIN_INFO_ERROR);
}
if (chatId == null) {
throw new BusinessException(ResponseEnum.PARAMS_ERROR);
}
ChatBotBase botBase = chatBotDataService.findById(botId).orElse(null);
if (botBase == null) {
throw new BusinessException(ResponseEnum.PARAMS_ERROR);
}
return ApiResult.success(botChatService.clear(chatId, uid, botId, botBase));
}
}
View on GitHub (pinned to 5e758547a8)