iflytek/astron-agent · error · BusinessException

REPO_SOME_IDS_MUST_INPUT

REPO_SOME_IDS_MUST_INPUT

Error message

REPO_SOME_IDS_MUST_INPUT

What it means

FileInfoV2Service.queryFileList throws BusinessException(REPO_SOME_IDS_MUST_INPUT) when querying a repository file listing without identifying parameters. The query needs either a repoId+parentId pair (browse inside a repo) or a tag (tag-based search). If repoId or parentId is null AND the tag string is empty, no query scope can be built, so the service rejects the request up front.

Solutions

  1. Ensure the caller supplies both repoId and parentId (use 0 or the repo root id for root-level listings) or a non-empty tag.
  2. Fix the frontend/router so repoId and parentId are read from state/URL before invoking the file-list API.
  3. Add client-side validation that rejects the request (with a clear UI message) when repoId/parentId are absent and tag is blank.

Example fix

// before
fileService.queryFileList(repoId, null, pageNo, pageSize, "", request, 1);
// after
fileService.queryFileList(repoId, ROOT_PARENT_ID /* e.g. 0L */, pageNo, pageSize, "", request, 1);
Defensive patterns

Strategy: validation

Validate before calling

if ((repoId == null || parentId == null) && (tag == null || tag.isEmpty())) {
    throw new IllegalArgumentException("repoId+parentId or a non-empty tag is required");
}

Try / catch

try {
    Object page = fileInfoV2Service.queryFileList(repoId, parentId, pageNo, pageSize, tag, request, isRepoPage);
} catch (BusinessException e) {
    if ("REPO_SOME_IDS_MUST_INPUT".equals(e.getCode())) {
        // return 400 to caller with hint about required params
    }
}

Prevention

When it happens

Trigger: Calling queryFileList with repoId==null or parentId==null while passing tag="" (or null-derived empty). E.g. GET /repo file-list endpoint without query params, or a frontend building the request from empty route state (repoId undefined serialized as absent).

Common situations: Frontend navigates to the repo file page before a repo is selected; a saved bookmark lost its query string; a client integration passes null parentId for a root listing without setting a tag; API consumers omitting required query parameters.

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


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

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/repo/FileInfoV2Service.java:1790

        return fileSummary;
    }

    /**
     * Query file list with pagination support
     *
     * @param repoId repository ID
     * @param parentId parent directory ID
     * @param pageNo page number for pagination
     * @param pageSize number of items per page
     * @param tag file source tag (Spark RAG or others)
     * @param request HTTP servlet request for authentication
     * @param isRepoPage flag indicating if this is a repository page query
     * @return PageData containing file directory tree list
     * @throws BusinessException if required parameters are missing or repository access is denied
     */
    public Object queryFileList(Long repoId, Long parentId, Integer pageNo, Integer pageSize, String tag, HttpServletRequest request, Integer isRepoPage) {
        if ((repoId == null || parentId == null) && tag.isEmpty()) {
            throw new BusinessException(ResponseEnum.REPO_SOME_IDS_MUST_INPUT);
        }

        PageData<FileDirectoryTreeDto> pageData = new PageData<>();
        List<FileDirectoryTreeDto> fileDirectoryTreeDtoList = new ArrayList<>();
        List<RelatedDocDto> sparkCbgResponse = new ArrayList<RelatedDocDto>();
        Long modelListCount = (long) 0;
        if (ProjectContent.isSparkRagCompatible(tag)) {
            String url = apiUrl.getDatasetFileUrl() + "?datasetId=".concat(repoId.toString());
            log.info("sparkDeskRepoFileGet request url:{}", url);
            Map<String, String> header = new HashMap<>();
            String authorization = request.getHeader("Authorization");
            if (StringUtils.isNotBlank(authorization)) {
                header.put("Authorization", authorization);
            }
            String resp = OkHttpUtil.get(url, header);
            JSONObject respObject = JSON.parseObject(resp);
            log.info("sparkDeskRepoFileGet response data: {}", resp);

View on GitHub (pinned to 5e758547a8)