{"record":{"id":"897a1a2df8b41b68","repo":"iflytek/astron-agent","slug":"8303-toolbox-not-exist","errorCode":"8303","errorMessage":"toolbox.not.exist","messagePattern":"toolbox\\.not\\.exist","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/tool/ToolBoxService.java","lineNumber":2130,"sourceCode":"        }\n        schema.setProperties(propertyMap);\n        schema.setType(OpenApiConst.SCHEMA_TYPE_OBJECT);\n        mediaType.setSchema(schema);\n\n        Map<String, MediaType> content = new HashMap<>();\n        content.put(org.springframework.http.MediaType.APPLICATION_JSON_VALUE, mediaType);\n        return content;\n    }\n\n    public List<ToolBoxVo> getToolVersion(String toolId) {\n        List<ToolBox> toolBoxes = toolBoxMapper.selectList(\n                Wrappers.<ToolBox>lambdaQuery()\n                        .eq(ToolBox::getToolId, toolId)\n                        .eq(ToolBox::getDeleted, false)\n                        .orderByDesc(ToolBox::getCreateTime));\n        if (CollectionUtils.isEmpty(toolBoxes)) {\n            log.error(\"tool not exist, toolId={}\", toolId);\n            throw new BusinessException(ResponseEnum.TOOLBOX_NOT_EXIST);\n        }\n        ToolBox toolBox = toolBoxes.get(0);\n        boolean flag = toolBox.getIsPublic() || bizConfig.getAdminUid().toString().equals(toolBox.getUserId());\n        if (flag) {\n            // Official tools\n            return toolBoxes.stream().map(toolBoxItem -> {\n                ToolBoxVo toolBoxVo = new ToolBoxVo();\n                BeanUtils.copyProperties(toolBoxItem, toolBoxVo);\n                toolBoxVo.setWebSchema(filterDisPlaySchema(toolBoxItem.getWebSchema()));\n                toolBoxVo.setSchema(StringUtils.EMPTY);\n                toolBoxVo.setAuthInfo(StringUtils.EMPTY);\n                toolBoxVo.setAddress(s3UtilClient.getS3Prefix());\n                return toolBoxVo;\n            }).collect(Collectors.toList());\n        } else {\n            Long spaceId = SpaceInfoUtil.getSpaceId();\n            if (spaceId != null) {\n                if (spaceId.equals(toolBox.getSpaceId())) {","sourceCodeStart":2112,"sourceCodeEnd":2148,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/tool/ToolBoxService.java#L2112-L2148","documentation":"TOOLBOX_NOT_EXIST (code 8303) is thrown when a query by toolId finds no non-deleted ToolBox rows. The service logs the toolId and aborts because subsequent permission checks and mapping need at least one record. Soft-deleted tools (deleted=true) also count as non-existent.","triggerScenarios":"Calling a ToolBoxService API (get/export/update) with a toolId that has no row, was soft-deleted, or belongs to a different tenant and thus is invisible.","commonSituations":"Stale toolId cached in the frontend after the tool was deleted; typos or wrong-environment IDs (test vs prod database); using a tool ID from another space/user.","solutions":["Verify the toolId exists and is not soft-deleted (deleted=false) in the tool_box table","Refresh the client's tool list and use a currently valid toolId","Check you are pointed at the correct environment/database for that toolId"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// precondition check\nToolBox t = toolBoxApi.findById(toolId); if (t == null || t.isDeleted()) { /* abort before calling */ }","typeGuard":null,"tryCatchPattern":"try { toolBoxApi.get(toolId); } catch (BusinessException e) { if (e.getCode() == 8303) { /* refresh tool list / show 'tool no longer exists' */ } else throw e; }","preventionTips":["Refresh cached tool IDs after delete operations","Confirm toolId against the environment you are calling","Handle soft-delete semantics (deleted=false) in client-side lookups"],"tags":["java","spring-boot","toolbox","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}