alibaba/nacos · error · NacosException

INVALID_PARAM

INVALID_PARAM

Error message

Required parameter `skillName` not present

What it means

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.

Source

Thrown at client/src/main/java/com/alibaba/nacos/client/ai/cache/NacosSkillCacheHolder.java:94

            AiConstants.DEFAULT_AI_CACHE_UPDATE_INTERVAL);
    }
    
    /**
     * Subscribe skill and start polling for skill changes.
     *
     * <p>Performs the initial download synchronously and primes the MD5 cache; subsequent polls
     * piggy-back the cached MD5 to short-circuit unchanged content.
     *
     * @param skillName skill name
     * @param version   skill version, optional
     * @param label     skill label, optional
     * @return current skill ZIP bytes, never null when the server has the skill
     * @throws NacosException if error occurs
     */
    public byte[] subscribeSkill(String skillName, String version, String label)
        throws NacosException {
        if (StringUtils.isBlank(skillName)) {
            throw new NacosException(NacosException.INVALID_PARAM,
                "Required parameter `skillName` not present");
        }
        String cacheKey = CacheKeyUtils.buildSkillKey(skillName, version, label);
        
        byte[] zipBytes = null;
        try {
            SkillQueryResponse response = aiClientProxy.querySkill(skillName, version, label, null);
            zipBytes = response.getZipBytes();
            // Only update cache during initial subscribe; do NOT publish event here.
            // The caller (NacosAiService) handles the first listener notification to avoid
            // duplicate callbacks racing with the async NotifyCenter dispatch.
            String newMd5 = response.getMd5();
            if (StringUtils.isNotBlank(newMd5)) {
                skillMd5Cache.put(cacheKey, newMd5);
            }
        } catch (NacosException e) {
            if (e.getErrCode() != NacosException.NOT_FOUND) {
                throw e;

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Validate skillName is non-blank before calling subscribeSkill.
  2. Treat the skill name as a required attribute when building subscription requests.
  3. Skip or log when the skill record lacks a name instead of subscribing.

Example fix

// before
cache.subscribeSkill(skillName, version, label);
// after
if (StringUtils.isBlank(skillName)) {
    throw new IllegalArgumentException("skillName is required");
}
cache.subscribeSkill(skillName, version, label);
Defensive patterns

Strategy: validation

Validate before calling

if (StringUtils.isBlank(skillName)) {
    throw new IllegalArgumentException("skillName is required");
}
cache.subscribeSkill(skillName, version, label);

Prevention

When it happens

Trigger: Calling subscribeSkill(null, ...) or subscribeSkill("", ...) with a whitespace-only or unset skill name; passing an uninitialized field.

Common situations: 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.

Related errors


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/83668d5d03ee5236. Report an issue: GitHub.