{"record":{"id":"83668d5d03ee5236","repo":"alibaba/nacos","slug":"invalid-param-83668d","errorCode":"INVALID_PARAM","errorMessage":"Required parameter `skillName` not present","messagePattern":"Required parameter `skillName` not present","errorType":"validation","errorClass":"NacosException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/com/alibaba/nacos/client/ai/cache/NacosSkillCacheHolder.java","lineNumber":94,"sourceCode":"            AiConstants.DEFAULT_AI_CACHE_UPDATE_INTERVAL);\n    }\n    \n    /**\n     * Subscribe skill and start polling for skill changes.\n     *\n     * <p>Performs the initial download synchronously and primes the MD5 cache; subsequent polls\n     * piggy-back the cached MD5 to short-circuit unchanged content.\n     *\n     * @param skillName skill name\n     * @param version   skill version, optional\n     * @param label     skill label, optional\n     * @return current skill ZIP bytes, never null when the server has the skill\n     * @throws NacosException if error occurs\n     */\n    public byte[] subscribeSkill(String skillName, String version, String label)\n        throws NacosException {\n        if (StringUtils.isBlank(skillName)) {\n            throw new NacosException(NacosException.INVALID_PARAM,\n                \"Required parameter `skillName` not present\");\n        }\n        String cacheKey = CacheKeyUtils.buildSkillKey(skillName, version, label);\n        \n        byte[] zipBytes = null;\n        try {\n            SkillQueryResponse response = aiClientProxy.querySkill(skillName, version, label, null);\n            zipBytes = response.getZipBytes();\n            // Only update cache during initial subscribe; do NOT publish event here.\n            // The caller (NacosAiService) handles the first listener notification to avoid\n            // duplicate callbacks racing with the async NotifyCenter dispatch.\n            String newMd5 = response.getMd5();\n            if (StringUtils.isNotBlank(newMd5)) {\n                skillMd5Cache.put(cacheKey, newMd5);\n            }\n        } catch (NacosException e) {\n            if (e.getErrCode() != NacosException.NOT_FOUND) {\n                throw e;","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/client/src/main/java/com/alibaba/nacos/client/ai/cache/NacosSkillCacheHolder.java#L76-L112","documentation":"Thrown by NacosSkillCacheHolder.subscribeSkill when skillName is blank. subscribeSkill downloads a skill ZIP synchronously, primes an MD5 cache, then re-polls for changes. version and label are optional, but the skill name is required to identify the resource; a blank name is rejected as INVALID_PARAM before any download.","triggerScenarios":"Calling subscribeSkill(null, ...) or subscribeSkill(\"\", ...) with a whitespace-only or unset skill name; passing an uninitialized field.","commonSituations":"Skill name sourced from config that was not populated; name extracted from a manifest field that is empty; subscription triggered for a skill record with no name.","solutions":["Validate skillName is non-blank before calling subscribeSkill.","Treat the skill name as a required attribute when building subscription requests.","Skip or log when the skill record lacks a name instead of subscribing."],"exampleFix":"// before\ncache.subscribeSkill(skillName, version, label);\n// after\nif (StringUtils.isBlank(skillName)) {\n    throw new IllegalArgumentException(\"skillName is required\");\n}\ncache.subscribeSkill(skillName, version, label);","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(skillName)) {\n    throw new IllegalArgumentException(\"skillName is required\");\n}\ncache.subscribeSkill(skillName, version, label);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require a non-blank skill name before subscribing.","Validate skill records for a non-empty name before building subscription requests.","Skip/log records lacking a name rather than subscribing."],"tags":["ai","skill","subscription","validation","invalid-param"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}