alibaba/nacos · warning · NacosApiException
PARAMETER_VALIDATE_ERROR
PARAMETER_VALIDATE_ERROR
Error message
Parameter 'scope' must be PUBLIC or PRIVATE
What it means
SkillScopeForm.validate() enforces that `scope` be one of the two allowed visibility values: PUBLIC or PRIVATE (VisibilityConstants, compared case-insensitively). Anything else is an undefined visibility level and is rejected with PARAMETER_VALIDATE_ERROR after the presence check (error 57) passes.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillScopeForm.java:48
* @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
- Set `scope=PUBLIC` (visible to other namespaces/tenants) or `scope=PRIVATE` (owner only). Case-insensitive.
- Map your internal terminology to one of these two values before sending.
- Do not invent intermediate visibility levels — the API has exactly two.
Example fix
// before
{"skillName":"my-skill","scope":"internal"}
// after
{"skillName":"my-skill","scope":"PRIVATE"} Defensive patterns
Strategy: validation
Validate before calling
// Before calling skill scope change
if (!"PUBLIC".equalsIgnoreCase(scope) && !"PRIVATE".equalsIgnoreCase(scope)) {
throw new IllegalArgumentException("scope must be PUBLIC or PRIVATE");
} Type guard
// TypeScript type SkillScope = 'PUBLIC' | 'PRIVATE'; const isSkillScope = (s: string): s is SkillScope => ['PUBLIC','PRIVATE'].includes(s.toUpperCase());
Try / catch
try {
form.validate();
} catch (NacosApiException e) {
// invalid scope — coerce to PUBLIC/PRIVATE and retry
} Prevention
- Restrict the scope UI to a two-option toggle (PUBLIC/PRIVATE).
- Do not invent intermediate visibility levels.
- Map internal labels (e.g. 'internal') to PRIVATE before sending.
When it happens
Trigger: Calling the skill scope API with scope set to a value other than PUBLIC/PRIVATE — e.g. `scope=public_only`, `scope=shared`, `scope=organization`, `scope=internal`. Case does not matter (PUBLIC, public, Public all accepted).
Common situations: Using organizational terminology like "internal"/"shared"; lowercase variants are fine but invented values are not; confusion with other systems' visibility enums.
Related errors
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/6385fdd5daa17ec7.
Report an issue: GitHub.