{"record":{"id":"bb99f3aeb5c7800a","repo":"iflytek/astron-agent","slug":"repo-some-ids-must-input","errorCode":"REPO_SOME_IDS_MUST_INPUT","errorMessage":"REPO_SOME_IDS_MUST_INPUT","messagePattern":"REPO_SOME_IDS_MUST_INPUT","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/repo/FileInfoV2Service.java","lineNumber":1790,"sourceCode":"        return fileSummary;\n    }\n\n    /**\n     * Query file list with pagination support\n     *\n     * @param repoId repository ID\n     * @param parentId parent directory ID\n     * @param pageNo page number for pagination\n     * @param pageSize number of items per page\n     * @param tag file source tag (Spark RAG or others)\n     * @param request HTTP servlet request for authentication\n     * @param isRepoPage flag indicating if this is a repository page query\n     * @return PageData containing file directory tree list\n     * @throws BusinessException if required parameters are missing or repository access is denied\n     */\n    public Object queryFileList(Long repoId, Long parentId, Integer pageNo, Integer pageSize, String tag, HttpServletRequest request, Integer isRepoPage) {\n        if ((repoId == null || parentId == null) && tag.isEmpty()) {\n            throw new BusinessException(ResponseEnum.REPO_SOME_IDS_MUST_INPUT);\n        }\n\n        PageData<FileDirectoryTreeDto> pageData = new PageData<>();\n        List<FileDirectoryTreeDto> fileDirectoryTreeDtoList = new ArrayList<>();\n        List<RelatedDocDto> sparkCbgResponse = new ArrayList<RelatedDocDto>();\n        Long modelListCount = (long) 0;\n        if (ProjectContent.isSparkRagCompatible(tag)) {\n            String url = apiUrl.getDatasetFileUrl() + \"?datasetId=\".concat(repoId.toString());\n            log.info(\"sparkDeskRepoFileGet request url:{}\", url);\n            Map<String, String> header = new HashMap<>();\n            String authorization = request.getHeader(\"Authorization\");\n            if (StringUtils.isNotBlank(authorization)) {\n                header.put(\"Authorization\", authorization);\n            }\n            String resp = OkHttpUtil.get(url, header);\n            JSONObject respObject = JSON.parseObject(resp);\n            log.info(\"sparkDeskRepoFileGet response data: {}\", resp);\n","sourceCodeStart":1772,"sourceCodeEnd":1808,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/repo/FileInfoV2Service.java#L1772-L1808","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Ensure the caller supplies both repoId and parentId (use 0 or the repo root id for root-level listings) or a non-empty tag.","Fix the frontend/router so repoId and parentId are read from state/URL before invoking the file-list API.","Add client-side validation that rejects the request (with a clear UI message) when repoId/parentId are absent and tag is blank."],"exampleFix":"// before\nfileService.queryFileList(repoId, null, pageNo, pageSize, \"\", request, 1);\n// after\nfileService.queryFileList(repoId, ROOT_PARENT_ID /* e.g. 0L */, pageNo, pageSize, \"\", request, 1);","handlingStrategy":"validation","validationCode":"if ((repoId == null || parentId == null) && (tag == null || tag.isEmpty())) {\n    throw new IllegalArgumentException(\"repoId+parentId or a non-empty tag is required\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Object page = fileInfoV2Service.queryFileList(repoId, parentId, pageNo, pageSize, tag, request, isRepoPage);\n} catch (BusinessException e) {\n    if (\"REPO_SOME_IDS_MUST_INPUT\".equals(e.getCode())) {\n        // return 400 to caller with hint about required params\n    }\n}","preventionTips":["Always resolve repoId/parentId from route state before the file-list call.","Default parentId to the repo root id for root listings instead of passing null.","Validate query parameters at the controller/edge before reaching the service."],"tags":["missing-required-argument","validation","http-api"],"backgroundTag":"missing-required-argument","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}