alibaba/nacos · error · NacosApiException

10000

10000

Error message

Required parameter 'name' type String is not present

What it means

Thrown by AgentValidationUtils.validateLabel when a version label is null, longer than 64 chars, or fails [A-Za-z0-9][A-Za-z0-9._-]{0,63}. A label must start alphanumeric then contain alphanumerics, dots, underscores, or dashes (1-64 chars). Note 'latest' itself passes this check but is rejected separately by validateNonLatestLabel.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/a2a/admin/AgentForm.java:52

 **/
public class AgentForm implements NacosForm {
    
    @Serial
    private static final long serialVersionUID = -73912927386186928L;
    
    private String namespaceId;
    
    private String agentName;
    
    private String version;
    
    private String registrationType;
    
    @Override
    public void validate() throws NacosApiException {
        fillDefaultNamespaceId();
        if (StringUtils.isEmpty(agentName)) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Required parameter 'name' type String is not present");
        }
    }
    
    protected void fillDefaultNamespaceId() {
        if (StringUtils.isEmpty(namespaceId)) {
            namespaceId = A2A_DEFAULT_NAMESPACE;
        }
    }
    
    public String getNamespaceId() {
        return namespaceId;
    }
    
    public void setNamespaceId(String namespaceId) {
        this.namespaceId = namespaceId;
    }
    

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Use labels like '1.0.0', 'stable', 'rc.1' (start alphanumeric, only [A-Za-z0-9._-] afterwards, <=64).
  2. Strip leading non-alphanumeric characters and slashes before assigning a label.
  3. Generate labels from a controlled vocabulary, not free-form user text.

Example fix

// before
reference.setLabel("feature/x");
// after
reference.setLabel("feature-x");
Defensive patterns

Strategy: validation

Validate before calling

if (label == null || label.length() > 64
        || !label.matches("^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$")) {
    throw new IllegalArgumentException("Invalid label");
}

Type guard

static boolean isValidLabel(String s) {
    return s != null && s.length() <= 64
        && s.matches("^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$");
}

Try / catch

try {
    AgentValidationUtils.validateLabel(label);
} catch (IllegalArgumentException e) {
    // return 400, field 'label'
}

Prevention

When it happens

Trigger: Creating/moving a version label (RadModelValidator.validateLabelReference line 209, AgentVersionCatalogBuilder line 136, AgentPersistenceService.validateLabelTargets line 907) with an empty label, a leading dot/dash/underscore, a space, or >64 chars.

Common situations: Using a git-style ref with a leading slash or slash inside; labels derived from branch names containing '/'; uppercase vs lowercase confusion (uppercase is allowed but teams often standardize); over-long descriptive labels.

Related errors


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