iflytek/astron-agent · error · BusinessException
REPO_FOLDER_NAME_ILLEGAL
REPO_FOLDER_NAME_ILLEGAL
Error message
REPO_FOLDER_NAME_ILLEGAL
What it means
createFolder also checks the folder name against the regex [\\/:*?"<>|]; if any of these characters is present it throws BusinessException(REPO_FOLDER_NAME_ILLEGAL). These are filesystem-reserved characters, so names containing them are rejected to keep the directory tree safe and portable.
Solutions
- Remove or replace the reserved characters (\ / : * ? " < > |) from the folder name.
- Sanitize/normalize the name client-side (e.g. replace illegal chars with '-') before submitting.
- Show the allowed-character rule in the UI next to the input field to prevent bad submissions.
Example fix
// before
vo.setName("2026/09/report"); // contains '/'
// after
vo.setName("2026-09-report"); Defensive patterns
Strategy: validation
Validate before calling
Pattern ILLEGAL = Pattern.compile("[\\\\/:*?\"<>|]");
if (name != null && ILLEGAL.matcher(name).find()) {
// reject or auto-sanitize before calling createFolder
name = ILLEGAL.matcher(name).replaceAll("-");
} Try / catch
try {
fileInfoV2Service.createFolder(vo);
} catch (BusinessException e) {
if ("REPO_FOLDER_NAME_ILLEGAL".equals(e.getCode())) {
// show allowed-characters hint next to the input
}
} Prevention
- Mirror the server's illegal-character regex in the client input filter.
- Sanitize pasted paths/timestamps automatically (replace reserved chars with '-').
- Document the naming rule where users create folders.
When it happens
Trigger: Calling createFolder with a name containing any of \ / : * ? " < > | — e.g. "a/b", "doc:v2", "report?final" — usually from paste-in content or filename-like input.
Common situations: User pastes a Windows file path or timestamped string ("2026/09/12") into the folder name field; bulk-import scripts derive names from file paths; locale input containing ':' as a separator.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/400feccbdde160e6.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/repo/FileInfoV2Service.java:1891
return pageData;
}
/**
* Create a new folder in the repository
*
* @param folderVO folder creation parameters containing name, repository ID, and parent ID
* @throws BusinessException if folder name is empty, contains illegal characters, or repository
* access is denied
*/
public void createFolder(CreateFolderVO folderVO) {
String name = folderVO.getName();
Pattern pattern = Pattern.compile("[\\\\/:*?\"<>|]");
if (ObjectIsNull.check(name)) {
throw new BusinessException(ResponseEnum.REPO_FILE_NAME_CANNOT_EMPTY);
} else {
boolean flag = pattern.matcher(name).find();
if (flag) {
throw new BusinessException(ResponseEnum.REPO_FOLDER_NAME_ILLEGAL);
}
}
Long parentId = folderVO.getParentId();
Repo repo = repoService.getById(folderVO.getRepoId());
if (repo != null) {
dataPermissionCheckTool.checkRepoBelong(repo);
}
FileDirectoryTree fileDirectoryTree;
// Non-empty means a folder with the same name exists in the same directory, user creation is not
// allowed
/*
* if (!ObjectIsNull.check(fileDirectoryTree)) { throw new
* CustomException("Folders with the same name are not allowed in the current directory"); }
*/
fileDirectoryTree = new FileDirectoryTree();
fileDirectoryTree.setIsFile(0);View on GitHub (pinned to 5e758547a8)