{"record":{"id":"dc578c5b97a3dde7","repo":"alibaba/nacos","slug":"10000-dc578c","errorCode":"10000","errorMessage":"Version is required for skill version detail","messagePattern":"Version is required for skill version detail","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java","lineNumber":1007,"sourceCode":"        detail.setDownloadCount(meta.getDownloadCount());\n        detail.setWritable(VisibilityHelper.canWriteResource(meta));\n        return detail;\n    }\n    \n    /**\n     * Get the full content of a specific skill version by reading its files from storage.\n     */\n    @Override\n    public Skill getSkillVersionDetail(String namespaceId, String skillName, String version)\n        throws NacosException {\n        AiResource meta = resourceManager.findMeta(namespaceId, skillName, RESOURCE_TYPE_SKILL);\n        if (meta == null) {\n            throw new NacosApiException(NacosException.NOT_FOUND, ErrorCode.RESOURCE_NOT_FOUND,\n                \"Skill not found: \" + skillName);\n        }\n        resourceManager.ensureReadableOrNotFound(meta, \"Skill not found: \" + skillName);\n        if (StringUtils.isBlank(version)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Version is required for skill version detail\");\n        }\n        AiResourceVersion versionRow = resourceManager.findVersion(namespaceId, skillName,\n            RESOURCE_TYPE_SKILL, version);\n        if (versionRow == null) {\n            throw new NacosApiException(NacosException.NOT_FOUND, ErrorCode.RESOURCE_NOT_FOUND,\n                \"Skill version not found: \" + skillName + \"@\" + version);\n        }\n        return loadSkillFromStorage(namespaceId, skillName, version, versionRow.getStorage());\n    }\n    \n    /**\n     * Download a specific skill version (same as getVersionDetail but also publishes a download event for metrics).\n     */\n    @Override\n    public Skill downloadSkillVersion(String namespaceId, String skillName, String version)\n        throws NacosException {\n        Skill skill = getSkillVersionDetail(namespaceId, skillName, version);","sourceCodeStart":989,"sourceCodeEnd":1025,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java#L989-L1025","documentation":"Thrown by getSkillVersionDetail when the version parameter is blank (StringUtils.isBlank) AFTER the skill meta is confirmed to exist. It is a client PARAMETER_MISSING error (code 10000, HTTP 400). The endpoint requires an explicit version string to disambiguate which version's content to load — there is no implicit 'latest' fallback in this admin path.","triggerScenarios":"Calling getSkillVersionDetail with version = null, empty string, or whitespace-only; omitting the version query parameter in the HTTP request; passing 'latest' here (only querySkill resolves labels, not this method).","commonSituations":"Client SDK call forgetting to set the version field; UI submitting the form before the version dropdown is selected; assuming 'latest' works on the version-detail endpoint (it does not).","solutions":["Supply a concrete version string (e.g. '1.0.0' or 'v2') returned by a prior list/detail call.","If you wanted 'latest', use querySkill with label='latest' instead of getSkillVersionDetail.","Validate the version field is non-blank client-side before invoking the API."],"exampleFix":"// before\nskillService.getSkillVersionDetail(ns, name, null)\n\n// after\nString v = skillService.getSkillDetail(ns, name).getVersions().get(0).getVersion();\nskillService.getSkillVersionDetail(ns, name, v);","handlingStrategy":"validation","validationCode":"if (version == null || version.isBlank()) {\n    throw new IllegalArgumentException(\"version is required for getSkillVersionDetail\");\n}","typeGuard":"static boolean hasVersion(String v) { return v != null && !v.isBlank(); }","tryCatchPattern":null,"preventionTips":["Treat version as a mandatory field on the version-detail endpoint.","Use querySkill with label='latest' if you want implicit resolution.","Add form validation in the UI to block submit when version is unset."],"tags":["skill","validation","parameter-missing","ai-registry","version"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}