iflytek/astron-agent · error · BusinessException
REPO_NOT_FOUND
REPO_NOT_FOUND
Error message
REPO_NOT_FOUND
What it means
In the tag==null/empty branch of queryFileList, the service loads the Repo by id; if repoService.getById(repoId) returns null it throws BusinessException(REPO_NOT_FOUND). The repo referenced by repoId does not exist in the database (or is soft-deleted), so no listing can be produced and permission checks (checkRepoBelong/checkRepoVisible) never run.
Solutions
- Verify the repoId exists (SELECT from repo table / list repos via API) and use a valid id.
- Refresh or clear stale client state/bookmarks pointing at the deleted repo.
- Confirm you are hitting the correct environment's database; align client config with the target environment.
Example fix
// before
long repoId = 123L; // hardcoded, no longer exists
fileService.queryFileList(repoId, 0L, 1, 20, "", request, 1);
// after
Long repoId = fetchValidRepoIdFromApi();
if (repoId != null) {
fileService.queryFileList(repoId, 0L, 1, 20, "", request, 1);
} Defensive patterns
Strategy: try-catch
Validate before calling
Repo repo = repoService.getById(repoId);
if (repo == null) {
// fail fast client-side: redirect to repo selection UI
return;
} Try / catch
try {
Object page = fileInfoV2Service.queryFileList(repoId, parentId, pageNo, pageSize, "", request, 1);
} catch (BusinessException e) {
if ("REPO_NOT_FOUND".equals(e.getCode())) {
// clear stale repo id, notify user, offer repo picker
}
} Prevention
- Check repo existence when hydrating bookmarks/deep links.
- Keep client repo caches invalidated on delete events.
- Confirm environment (dev/staging/prod) before reusing hardcoded repo ids.
When it happens
Trigger: Calling queryFileList with a tagless request whose repoId has no matching row in the repo table: deleted repo, wrong repoId typed/hardcoded, repo from another environment/db, or an id from a stale client cache.
Common situations: User opens a bookmarked link to a repo deleted meanwhile; test/staging repoId used against production DB; data cleanup jobs removed the repo but UI shortcuts remain; cross-space id confusion.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/03be8f076c06d427.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/repo/FileInfoV2Service.java:1840
fileDirectoryTreeDto.setIsFile(1);
fileDirectoryTreeDto.setAppId(repoId.toString());
fileDirectoryTreeDto.setFileId(relatedDocDto.getId());
fileDirectoryTreeDto.setCreateTime(relatedDocDto.getCreateTime());
FileInfoV2 fileInfoV2 = new FileInfoV2();
fileInfoV2.setId(relatedDocDto.getId());
fileInfoV2.setName(relatedDocDto.getName());
fileInfoV2.setCharCount(relatedDocDto.getCharCount().longValue());
fileInfoV2.setStatus(relatedDocDto.getStatus());
fileInfoV2.setEnabled(1);
fileInfoV2.setUuid(relatedDocDto.getDatasetIndex());
fileDirectoryTreeDto.setFileInfoV2(fileInfoV2);
}
}
} else {
Repo repo = repoService.getById(repoId);
if (repo == null) {
throw new BusinessException(ResponseEnum.REPO_NOT_FOUND);
}
dataPermissionCheckTool.checkRepoBelong(repo);
dataPermissionCheckTool.checkRepoVisible(repo);
List<FileDirectoryTree> modelListLinkFileInfoV2 = fileDirectoryTreeMapper.getModelListLinkFileInfoV2(MapUtil.builder()
.put("appId", repoId.toString())
.put("parentId", parentId)
.put("isRepoPage", isRepoPage)
.put("start", (pageNo - 1) * 10)
.put("limit", pageSize)
.put("safeOrderBy", "create_time desc")
.build());
if (!CollectionUtils.isEmpty(modelListLinkFileInfoV2)) {
for (FileDirectoryTree fileDirectoryTree : modelListLinkFileInfoV2) {
FileDirectoryTreeDto fileDirectoryTreeDto = new FileDirectoryTreeDto();
fileDirectoryTreeDtoList.add(fileDirectoryTreeDto);
BeanUtils.copyProperties(fileDirectoryTree, fileDirectoryTreeDto);
// if (fileDirectoryTree.getIsFile()==1) {
// FileInfoV2 fileInfoV2 = this.getById(fileDirectoryTree.getFileId());View on GitHub (pinned to 5e758547a8)