iflytek/astron-agent · error · BusinessException

RESPONSE_FAILED

RESPONSE_FAILED

Error message

Failed to get model file list: ${message}

What it means

getLocalModelList() calls a local model-service HTTP endpoint, parses the JSON response, and expects code == 0. When the remote service answers with a non-zero code, it throws BusinessException(ResponseEnum.RESPONSE_FAILED, "Failed to get model file list: <remote message>"). The thrown message embeds the upstream service's own error message, so the remote cause is visible to the caller.

Solutions

  1. Read the embedded message after the colon — it is the upstream service's error — and fix that root cause first.
  2. Verify the model files/directory actually exist on the target host and the service has read permissions.
  3. Check the local model service's own logs and health endpoint; restart it if degraded.
  4. Confirm the model service API version matches what LocalModelHandler sends (endpoint path and params).
Defensive patterns

Strategy: retry

Validate before calling

const health = await fetch(modelServiceBase + '/health');
if (!health.ok) throw new Error('Local model service unhealthy before listing files');

Try / catch

try {
  const files = await getLocalModelList();
} catch (e) {
  // message embeds upstream error after 'Failed to get model file list: '
  log.error('Model file list failed, upstream said:', e.getMessage());
}

Prevention

When it happens

Trigger: The local model file-list HTTP endpoint returns {code: !=0, message: ...} — e.g. model directory not found on the host, the model service is degraded, or the requested path is invalid.

Common situations: Model files not mounted/present on the inference host; the local model service restarted or misconfigured (wrong MODEL_DIR); disk or permission problems on the host serving the file list; version mismatch between the toolkit's request and the model service API.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/7c5289895cd7fd21. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/handler/LocalModelHandler.java:45

    private ApiUrl apiUrl;

    /**
     * Get local model file list
     *
     * @return
     */
    public List<ModelFileVo> getLocalModelList() {
        try {
            String url = apiUrl.getLocalModel() + MODEL_FILE_LIST;
            log.info("getLocalModelList request url:{}", url);
            String resp = OkHttpUtil.get(url);
            log.info("getLocalModelList response data:{}", resp);
            JSONObject respObj = JSONObject.parseObject(resp);
            if (respObj.getInteger("code") == 0) {
                JSONArray data = respObj.getJSONArray("data");
                return JSON.parseArray(data.toJSONString(), ModelFileVo.class);
            } else {
                throw new BusinessException(ResponseEnum.RESPONSE_FAILED, "Failed to get model file list: " + respObj.getString("message"));
            }
        } catch (Exception e) {
            log.error("getLocalModelList post fail", e);
            throw new BusinessException(ResponseEnum.RESPONSE_FAILED, "Failed to get model file list");
        }
    }

    /**
     * Publish/deploy model service
     *
     * @param deployVo
     * @return
     */
    public String deployModel(ModelDeployVo deployVo) {
        try {
            String url = apiUrl.getLocalModel() + MODEL_DEPLOY;
            log.info("deployModel request url={} ,body = {}", url, JSON.toJSONString(deployVo));
            String resp = OkHttpUtil.post(url, JSON.toJSONString(deployVo));

View on GitHub (pinned to 5e758547a8)