{"record":{"id":"7c5289895cd7fd21","repo":"iflytek/astron-agent","slug":"response-failed-to-get-model-file-list-message","errorCode":"RESPONSE_FAILED","errorMessage":"Failed to get model file list: ${message}","messagePattern":"Failed to get model file list: (.+?)","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/handler/LocalModelHandler.java","lineNumber":45,"sourceCode":"    private ApiUrl apiUrl;\n\n    /**\n     * Get local model file list\n     *\n     * @return\n     */\n    public List<ModelFileVo> getLocalModelList() {\n        try {\n            String url = apiUrl.getLocalModel() + MODEL_FILE_LIST;\n            log.info(\"getLocalModelList request url:{}\", url);\n            String resp = OkHttpUtil.get(url);\n            log.info(\"getLocalModelList response data:{}\", resp);\n            JSONObject respObj = JSONObject.parseObject(resp);\n            if (respObj.getInteger(\"code\") == 0) {\n                JSONArray data = respObj.getJSONArray(\"data\");\n                return JSON.parseArray(data.toJSONString(), ModelFileVo.class);\n            } else {\n                throw new BusinessException(ResponseEnum.RESPONSE_FAILED, \"Failed to get model file list: \" + respObj.getString(\"message\"));\n            }\n        } catch (Exception e) {\n            log.error(\"getLocalModelList post fail\", e);\n            throw new BusinessException(ResponseEnum.RESPONSE_FAILED, \"Failed to get model file list\");\n        }\n    }\n\n    /**\n     * Publish/deploy model service\n     *\n     * @param deployVo\n     * @return\n     */\n    public String deployModel(ModelDeployVo deployVo) {\n        try {\n            String url = apiUrl.getLocalModel() + MODEL_DEPLOY;\n            log.info(\"deployModel request url={} ,body = {}\", url, JSON.toJSONString(deployVo));\n            String resp = OkHttpUtil.post(url, JSON.toJSONString(deployVo));","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/handler/LocalModelHandler.java#L27-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the embedded message after the colon — it is the upstream service's error — and fix that root cause first.","Verify the model files/directory actually exist on the target host and the service has read permissions.","Check the local model service's own logs and health endpoint; restart it if degraded.","Confirm the model service API version matches what LocalModelHandler sends (endpoint path and params)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const health = await fetch(modelServiceBase + '/health');\nif (!health.ok) throw new Error('Local model service unhealthy before listing files');","typeGuard":null,"tryCatchPattern":"try {\n  const files = await getLocalModelList();\n} catch (e) {\n  // message embeds upstream error after 'Failed to get model file list: '\n  log.error('Model file list failed, upstream said:', e.getMessage());\n}","preventionTips":["Monitor the local model service health and alert before users hit the list endpoint.","Ensure model directories exist and are readable on the serving host.","Parse the embedded upstream message after the colon — it names the actual remote problem."],"tags":["local-model","upstream","api-error","http","java"],"backgroundTag":"upstream-api-error","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}