iflytek/astron-agent · error · BusinessException
RESPONSE_FAILED
RESPONSE_FAILED
Error message
Fine-tuning model does not exist
What it means
LLMService's fine-tuning enable/update path keeps a cached map (catchModelMap, also persisted in Redis) of known fine-tuning model ids. If the requested modelId is not present in the cache, it throws BusinessException(RESPONSE_FAILED, "Fine-tuning model does not exist"): the model was never registered as a fine-tuning model (or the cache was lost/reset).
Solutions
- Verify the modelId actually refers to a fine-tuning model
- Check the Redis key holding the cached map; if missing, re-trigger the cache population (model list sync) before toggling
- Re-sync the fine-tuning model cache from the upstream source and retry
- Fix the misleading generic RESPONSE_FAILED enum by using a dedicated not-found enum
Example fix
// before
Boolean exists = catchModelMap.get(key);
if (exists == null) {
throw new BusinessException(ResponseEnum.RESPONSE_FAILED, "Fine-tuning model does not exist");
}
// after
Boolean exists = catchModelMap.get(key);
if (exists == null) {
refreshFineTuningModelCache(); // re-populate from source before failing
exists = catchModelMap.get(key);
}
if (exists == null) {
throw new BusinessException(ResponseEnum.MODEL_NOT_EXIST, "Fine-tuning model does not exist: " + key);
} Defensive patterns
Strategy: fallback
Validate before calling
// check cache membership before toggling Boolean known = redisTemplate.opsForValue().get(fineTuningCacheKey) != null; if (!known) refreshFineTuningModelCache();
Try / catch
try {
llmService.setFineTuningModelEnabled(modelId, enable);
} catch (BusinessException e) {
if (e.getMessage() != null && e.getMessage().contains("Fine-tuning model does not exist")) {
refreshFineTuningModelCache(); // then retry once
}
} Prevention
- Persist and rehydrate the fine-tuning model cache on startup
- Avoid Redis flushes in shared environments or re-populate after
- Only pass model ids sourced from the fine-tuning model list
- Use a dedicated not-found enum instead of RESPONSE_FAILED + message
When it happens
Trigger: Toggling/enabling a fine-tuning model by id when catchModelMap has no entry for that id — e.g. after a Redis flush, service restart with empty local cache, or passing a regular (non fine-tuning) model id.
Common situations: Redis flushed or evicted the cached map key; environment switch (cache populated in dev, request in prod); caller passing a non-fine-tuning model id; cache population step failed earlier and was ignored.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- LONG_CONTENT_FILE_NUM_OUT_LIMIT
- WECHAT_VERIFY_TICKET_MISSING
- OPEN_AI_API_ERROR
- NOT_CUSTOM_MODEL
- MODEL_NOT_EXIST
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/f17f6646588bcea1.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/model/LLMService.java:588
return ApiResult.success(configs);
}
/**
* Whether to enable fine-tuning model
*
* @param modelId
* @param enable
*/
public void switchFinetuneModel(Long modelId, Boolean enable) {
final String enabledKey = MODEL_ENABLE_KEY.concat(UserInfoManagerHandler.getUserId());
Map<String, Boolean> catchModelMap = getCatchModelMap(enabledKey);
if (catchModelMap == null) {
catchModelMap = new HashMap<>();
}
final String key = String.valueOf(modelId);
Boolean exists = catchModelMap.get(key);
if (exists == null) {
throw new BusinessException(ResponseEnum.RESPONSE_FAILED, "Fine-tuning model does not exist");
} else {
catchModelMap.put(modelId.toString(), enable);
redisTemplate.opsForValue().set(enabledKey, JSON.toJSONString(catchModelMap));
}
}
}
View on GitHub (pinned to 5e758547a8)