alibaba/nacos · warning · NacosApiException

PARAMETER_VALIDATE_ERROR

PARAMETER_VALIDATE_ERROR

Error message

skillCard name must match skillName parameter

What it means

SkillDraftCreateForm.parseInitialSkillOrNull() (called by prepareCreateDraftRequest) parses the skillCard JSON and, if the request also carries a top-level `skillName`, requires that the two names be exactly equal. Mismatched names are rejected with PARAMETER_VALIDATE_ERROR to prevent ambiguity about which skill a draft belongs to. The comparison is exact (case-sensitive) using String.equals.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillDraftCreateForm.java:125

    public void setTargetVersion(String targetVersion) {
        this.targetVersion = targetVersion;
    }
    
    public String getCommitMsg() {
        return commitMsg;
    }
    
    public void setCommitMsg(String commitMsg) {
        this.commitMsg = commitMsg;
    }
    
    private Skill parseInitialSkillOrNull() throws NacosApiException {
        if (StringUtils.isBlank(getSkillCard())) {
            return null;
        }
        Skill skill = SkillRequestUtil.parseSkill(this);
        if (StringUtils.isNotBlank(getSkillName()) && !getSkillName().equals(skill.getName())) {
            throw new NacosApiException(NacosException.INVALID_PARAM,
                ErrorCode.PARAMETER_VALIDATE_ERROR,
                "skillCard name must match skillName parameter");
        }
        return skill;
    }
    
    private String requireResolvedSkillName(Skill initialOrNull) throws NacosApiException {
        String skillName = StringUtils.isNotBlank(getSkillName()) ? getSkillName()
            : (initialOrNull != null ? initialOrNull.getName() : null);
        if (StringUtils.isBlank(skillName)) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "skillName or skillCard with name is required");
        }
        return skillName;
    }
}

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Make skillName and skillCard.name exactly identical (same case) before sending.
  2. Omit the top-level skillName entirely and let the server read the name from the card.
  3. Re-derive skillName from the edited card object right before serialization.

Example fix

// before
{"skillName":"my-skill","skillCard":"{\"name\":\"my-skill-v2\",...}"}
// after
{"skillName":"my-skill-v2","skillCard":"{\"name\":\"my-skill-v2\",...}"}
Defensive patterns

Strategy: validation

Validate before calling

// Ensure skillName and card name agree before sending
Skill parsed = SkillRequestUtil.parseSkill(form);
if (form.getSkillName() != null && !form.getSkillName().isBlank()
    && !form.getSkillName().equals(parsed.getName())) {
    throw new IllegalArgumentException("skillName must equal skillCard.name");
}

Type guard

// TypeScript
const namesAgree = (skillName: string, card: string): boolean => {
  try { return JSON.parse(card).name === skillName; } catch { return false; }
};

Try / catch

try {
    form.prepareCreateDraftRequest(); // runs parseInitialSkillOrNull
} catch (NacosApiException e) {
    // names mismatch — sync skillName from the card editor
}

Prevention

When it happens

Trigger: Sending create-draft with BOTH a `skillName` parameter AND a `skillCard` whose inner `name` field differs — e.g. skillName="my-skill" but skillCard.name="my-skill-v2". Only triggered when both are present and non-blank.

Common situations: Frontend pre-filling skillName from an old value while the user edited the name inside the card editor; copy-pasting a skillCard from another skill without updating the top-level skillName; case differences ("MySkill" vs "myskill") since the check is case-sensitive.

Related errors


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