alibaba/nacos · warning · NacosApiException
PARAMETER_VALIDATE_ERROR
PARAMETER_VALIDATE_ERROR
Error message
Parameter 'version' must be in format 'major.minor.patch' (e.g., '1.0.0')
What it means
PromptPublishForm.validate() enforces that the `version` field match the semantic version regex `^\d+\.\d+\.\d+$` via PromptVersionUtils.isValidVersion. Versions are stored and compared as dotted triples, so a non-conforming string would break version ordering and storage paths; the server rejects it with PARAMETER_VALIDATE_ERROR after the presence check (error 42) passes.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/prompt/PromptPublishForm.java:79
/**
* Variable definitions with default values (JSON array string, optional).
*
* <p>Example: [{"name":"question","defaultValue":"Hello","description":"User question"}]</p>
*/
private String variables;
@Override
public void validate() throws NacosApiException {
super.validate();
if (StringUtils.isEmpty(version)) {
throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
"Required parameter 'version' type String is not present");
}
if (!PromptVersionUtils.isValidVersion(version)) {
throw new NacosApiException(NacosException.INVALID_PARAM,
ErrorCode.PARAMETER_VALIDATE_ERROR,
"Parameter 'version' must be in format 'major.minor.patch' (e.g., '1.0.0')");
}
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getTemplate() {
return template;
}
public void setTemplate(String template) {View on GitHub (pinned to 9b989acdf1)
Solutions
- Format the version as exactly three dot-separated non-negative integers, e.g. `2.1.3`.
- Strip any leading `v` or `V` before sending.
- Drop pre-release/build suffixes (`-beta`, `+build`) — the API does not support them.
- If you have a two-part version like `1.0`, expand to `1.0.0`.
Example fix
// before
{"version":"v1.2.0-beta"}
// after
{"version":"1.2.0"} Defensive patterns
Strategy: validation
Validate before calling
// Reuse the server's own validator client-side
boolean ok = version != null && version.matches("^\\d+\\.\\d+\\.\\d+$");
if (!ok) {
throw new IllegalArgumentException("version must be major.minor.patch, e.g. 1.0.0");
} Type guard
// TypeScript const isSemverTriplet = (v: string): boolean => /^\d+\.\d+\.\d+$/.test(v);
Try / catch
try {
form.validate();
} catch (NacosApiException e) {
// PARAMETER_VALIDATE_ERROR — fix version format and retry
} Prevention
- Strip a leading 'v' from version strings before sending.
- Reject pre-release/build suffixes client-side; the API does not support them.
- Use a version-input component that enforces three numeric segments.
When it happens
Trigger: Calling prompt publish with a version like `1.0`, `v1.0.0`, `1.0.0-beta`, `1.0.0.0`, `latest`, or `1.2`. Only plain `MAJOR.MINOR.PATCH` with non-negative integers is accepted.
Common situations: Using CalVer or git tags as version; adding a `v` prefix (common in git tags); including pre-release/build suffixes (semver) which this regex rejects; using `1.0` thinking it implies `1.0.0`; truncating from a UI that shows two-part versions.
Related errors
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/c0851bdd82ed889d.
Report an issue: GitHub.