iflytek/astron-agent · error · BusinessException
8005
8005
Error message
param.error
What it means
PARAM_ERROR (code 8005) thrown by SkillFileController.resolvePaths when neither the direct paths parameter nor pathsJson is supplied. resolvePaths first prefers the parsed paths list; if that is absent/null/empty it requires a non-blank pathsJson string. Called by uploadDirectory, so the upload-directory endpoint rejects the request before any file work begins.
Solutions
- Send pathsJson as a valid JSON array of strings, e.g. pathsJson="[\"src/\",\"docs/readme.md\"]".
- Or supply the structured paths field with at least one entry.
- Update the client to fall back to uploading all files (or the root) when no explicit selection exists.
- On the server, consider treating an empty paths array plus missing pathsJson as 'upload everything' instead of failing, if that matches product intent.
Example fix
// before
form.append("file", file); // no pathsJson part
// after
form.append("file", file);
form.append("pathsJson", JSON.stringify(["src/utils/"])); Defensive patterns
Strategy: validation
Validate before calling
function validateUploadParams(paths, pathsJson) {
if (Array.isArray(paths) && paths.length > 0) return true;
if (typeof pathsJson === 'string' && pathsJson.trim().length > 0) {
try { return Array.isArray(JSON.parse(pathsJson)); } catch { return false; }
}
return false;
} Type guard
const hasPaths = (p) => Array.isArray(p) && p.length > 0;
Try / catch
try {
await api.uploadDirectory(form);
} catch (e) {
if (e.code === 8005 && !form.get('pathsJson')) {
form.append('pathsJson', JSON.stringify(['./']));
await api.uploadDirectory(form);
} else throw e;
} Prevention
- Always send pathsJson, defaulting to the directory root when nothing is selected.
- Validate JSON.parse(pathsJson) before appending to the form.
- Include pathsJson in the multipart request builder helper so it cannot be forgotten.
When it happens
Trigger: Calling the uploadDirectory endpoint without a paths list and without pathsJson (null or whitespace-only), e.g. multipart upload where only the files were attached and no path selection was passed.
Common situations: Client omits the optional-looking form field entirely; frontend sends empty array instead of a JSON list; API consumers constructing multipart requests by hand forget the pathsJson part; both fields sent but paths is an empty list and pathsJson is blank.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- PERSONALITY_AI_GENERATE_PARAM_EMPTY
- PARAMS_ERROR
- DATABASE_ID_CANNOT_EMPTY
- RESPONSE_FAILED
- RESPONSE_FAILED
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/d3c4cc688eaba430.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/controller/skill/SkillFileController.java:112
@DeleteMapping
public ApiResult<Void> delete(@RequestParam("id") Long id) {
skillFileService.delete(id);
return ApiResult.success();
}
@GetMapping("/importable")
public ApiResult<List<SkillImportDto>> importable(
@RequestParam(value = "keyword", required = false) String keyword) {
return ApiResult.success(skillFileService.listImportableSkills(keyword));
}
private List<String> resolvePaths(List<String> paths, String pathsJson) {
if (paths != null && !paths.isEmpty()) {
return paths;
}
if (pathsJson == null || pathsJson.isBlank()) {
throw new BusinessException(ResponseEnum.PARAM_ERROR);
}
try {
return OBJECT_MAPPER.readValue(pathsJson, new TypeReference<List<String>>() {});
} catch (JsonProcessingException ex) {
throw new BusinessException(ResponseEnum.PARAM_ERROR);
}
}
}
View on GitHub (pinned to 5e758547a8)