alibaba/nacos · error · NacosApiException

PARAMETER_MISSING

PARAMETER_MISSING

Error message

Required parameter 'version' type String is not present

What it means

PromptVersionPublishForm.validate() requires `version` for version-scoped publish operations. After super.validate() validates base prompt fields, this check fails fast with PARAMETER_MISSING if version is blank. The form also carries a deprecated `updateLatestLabel` flag (since 3.3.0 the server manages 'latest'), but that flag is ignored — version is still mandatory.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/prompt/PromptVersionPublishForm.java:51

    @Serial
    private static final long serialVersionUID = 1L;
    
    private String version;
    
    /**
     * Legacy latest label update flag.
     *
     * @deprecated since 3.3.0, the latest label is managed by the server. This
     * parameter is ignored and retained only for compatibility with legacy clients.
     */
    @Deprecated(since = "3.3.0")
    private Boolean updateLatestLabel;
    
    @Override
    public void validate() throws NacosApiException {
        super.validate();
        if (StringUtils.isBlank(version)) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Required parameter 'version' type String is not present");
        }
    }
    
    public String getVersion() {
        return version;
    }
    
    public void setVersion(String version) {
        this.version = version;
    }
    
    /**
     * Get update latest label flag.
     *
     * @return ignored update latest label flag
     * @deprecated since 3.3.0, the latest label is managed by the server. This
     * parameter is ignored and retained only for compatibility with legacy clients.

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Send an explicit `version` in `major.minor.patch` form.
  2. Stop relying on `updateLatestLabel` — it is deprecated and ignored since 3.3.0; the server assigns 'latest' itself.
  3. Resolve the target version from your release pipeline before publishing.

Example fix

// before
{"promptKey":"hello","updateLatestLabel":true}
// after
{"promptKey":"hello","version":"1.0.0"}
Defensive patterns

Strategy: validation

Validate before calling

// Before calling prompt version publish
if (version == null || version.isBlank()) {
    throw new IllegalArgumentException("version is required for version publish");
}

Type guard

// TypeScript
const hasVersion = (v?: string | null): boolean =>
  v != null && v.trim().length > 0;

Try / catch

try {
    form.validate();
} catch (NacosApiException e) {
    // version missing — prompt user
}

Prevention

When it happens

Trigger: Calling the prompt version publish API without a `version`, or relying on the legacy `updateLatestLabel` parameter expecting the server to infer a version. The legacy flag does not substitute for an explicit version.

Common situations: Migrating from a pre-3.3.0 client that sent `updateLatestLabel=true` without version; assuming 'latest' handling implies version auto-assignment; frontend not updated after the 3.3.0 deprecation.

Related errors


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