alibaba/nacos · warning · NacosApiException
PARAMETER_VALIDATE_ERROR
PARAMETER_VALIDATE_ERROR
Error message
Unsupported uploadAction: {uploadAction} What it means
An INVALID_PARAM (HTTP 400, ErrorCode PARAMETER_VALIDATE_ERROR/20002) from doUploadSingleSkill: the uploadAction field is non-blank but not one of the recognized constants (CREATE_DRAFT, OVERWRITE_DRAFT, DELETE_DRAFT_AND_CREATE). A blank uploadAction is valid and routes via the overwrite boolean, so only an unrecognized non-blank value triggers this.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java:407
if (StringUtils.isBlank(uploadAction)) {
if (overwrite) {
return overwriteUploadedSkill(namespaceId, skill, targetVersion, meta, false,
commitMsg);
}
return createUploadedSkillDraft(namespaceId, skill, targetVersion, meta, commitMsg);
}
if (SkillUploadPrecheckResult.ACTION_CREATE_DRAFT.equals(uploadAction)) {
return createUploadedSkillDraft(namespaceId, skill, targetVersion, meta, commitMsg);
}
if (SkillUploadPrecheckResult.ACTION_OVERWRITE_DRAFT.equals(uploadAction)) {
return overwriteUploadedSkill(namespaceId, skill, targetVersion, meta, true,
commitMsg);
}
if (SkillUploadPrecheckResult.ACTION_DELETE_DRAFT_AND_CREATE.equals(uploadAction)) {
return overwriteUploadedSkill(namespaceId, skill, targetVersion, meta, true,
commitMsg);
}
throw new NacosApiException(NacosException.INVALID_PARAM,
ErrorCode.PARAMETER_VALIDATE_ERROR, "Unsupported uploadAction: " + uploadAction);
}
private void checkWritableUploadResource(AiResource meta) throws NacosException {
try {
VisibilityHelper.checkWritableResource(meta);
} catch (NacosException e) {
if (e.getErrCode() != NacosException.NO_RIGHT || StringUtils.isBlank(meta.getOwner())) {
throw e;
}
throw new NacosApiException(NacosException.NO_RIGHT, ErrorCode.ACCESS_DENIED,
e.getErrMsg() + ", owner: " + meta.getOwner());
}
}
/**
* Bootstrap a built-in skill from a ZIP archive (delegates to the overload with null source).
*/View on GitHub (pinned to 9b989acdf1)
Solutions
- Use exactly one of CREATE_DRAFT, OVERWRITE_DRAFT, or DELETE_DRAFT_AND_CREATE.
- Or omit uploadAction (send blank) and drive behavior with the overwrite boolean instead.
- Re-run precheck and pass back the action string the server itself returned to avoid drift.
Example fix
// before
request.setUploadAction("replace"); // throws 328
// after — pick a recognized constant
request.setUploadAction(SkillUploadPrecheckResult.ACTION_OVERWRITE_DRAFT);
// or leave blank and use overwrite flag
request.setUploadAction("");
request.setOverwrite(true); Defensive patterns
Strategy: validation
Validate before calling
private static final Set<String> VALID_ACTIONS = Set.of(
SkillUploadPrecheckResult.ACTION_CREATE_DRAFT,
SkillUploadPrecheckResult.ACTION_OVERWRITE_DRAFT,
SkillUploadPrecheckResult.ACTION_DELETE_DRAFT_AND_CREATE);
String action = request.getUploadAction();
if (StringUtils.isNotBlank(action) && !VALID_ACTIONS.contains(action)) {
// reject early; or set blank and rely on the overwrite boolean
request.setUploadAction("");
} Type guard
// narrows an action string to a known constant or empty
static String normalizeUploadAction(String raw) {
if (StringUtils.isBlank(raw)) return "";
return switch (raw) {
case SkillUploadPrecheckResult.ACTION_CREATE_DRAFT,
SkillUploadPrecheckResult.ACTION_OVERWRITE_DRAFT,
SkillUploadPrecheckResult.ACTION_DELETE_DRAFT_AND_CREATE -> raw;
default -> ""; // let overwrite boolean drive behavior
};
} Prevention
- Use the SkillUploadPrecheckResult.ACTION_* constants verbatim, never hand-typed strings.
- Keep client and server versions in sync so action names match.
- Prefer passing the action string the server returned from precheck.
When it happens
Trigger: Sending an upload request with an uploadAction like 'replace', 'overwrite', 'CREATE', or any string not exactly matching a SkillUploadPrecheckResult.ACTION_* constant.
Common situations: Client SDK version mismatch (action names renamed across versions); hand-crafted API call with a guessed action string; copy/paste from outdated docs.
Related errors
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/837fb5a109339aaa.
Report an issue: GitHub.