alibaba/nacos · error · NacosApiException

PARAMETER_MISSING

PARAMETER_MISSING

Error message

Required parameter 'scope' type String is not present

What it means

SkillScopeForm.validate() runs super.validate() (which requires skillName — see error 50) then requires a non-blank `scope`. Scope controls visibility (PUBLIC vs PRIVATE), so it must be explicitly set. A blank scope is rejected with PARAMETER_MISSING before the value check (error 58) runs.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillScopeForm.java:43

import java.io.Serial;

/**
 * Form for updating skill visibility scope.
 *
 * @author nacos
 */
public class SkillScopeForm extends SkillForm {
    
    @Serial
    private static final long serialVersionUID = 1L;
    
    private String scope;
    
    @Override
    public void validate() throws NacosApiException {
        super.validate();
        if (StringUtils.isBlank(scope)) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Required parameter 'scope' type String is not present");
        }
        if (!VisibilityConstants.SCOPE_PUBLIC.equalsIgnoreCase(scope)
            && !VisibilityConstants.SCOPE_PRIVATE.equalsIgnoreCase(scope)) {
            throw new NacosApiException(NacosException.INVALID_PARAM,
                ErrorCode.PARAMETER_VALIDATE_ERROR,
                "Parameter 'scope' must be PUBLIC or PRIVATE");
        }
    }
    
    public String getScope() {
        return scope;
    }
    
    public void setScope(String scope) {
        this.scope = scope;
    }
}

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Send `scope` as either `PUBLIC` or `PRIVATE` (case-insensitive).
  2. Ensure skillName is also present (super.validate enforces it).
  3. If your UI has a default, populate scope explicitly before submit.

Example fix

// before
{"skillName":"my-skill"}
// after
{"skillName":"my-skill","scope":"PUBLIC"}
Defensive patterns

Strategy: validation

Validate before calling

// Before calling skill scope change
if (scope == null || scope.isBlank()) {
    throw new IllegalArgumentException("scope is required");
}

Type guard

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

Try / catch

try {
    form.validate();
} catch (NacosApiException e) {
    // scope missing — default to a value and retry
}

Prevention

When it happens

Trigger: Calling the skill scope-change API without `scope`, or with scope empty/whitespace. Requires skillName AND scope together.

Common situations: Assuming a default scope; frontend sending only skillName; field omitted because the UI used a checkbox that didn't bind.

Related errors


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