alibaba/nacos · error · NacosApiException

10000

10000

Error message

Request parameter `agentSpecName` should not be blank.

What it means

Thrown by AgentSpecSubmitForm.validate() (which overrides the base AgentSpecForm.validate()) when agentSpecName is blank. This guards the submit-for-review endpoint in the AgentSpec version-governance lifecycle. Note this form calls fillDefaultNamespaceId() but does NOT call super.validate(), so it does its own agentSpecName blank check here. Maps to code 10000 (PARAMETER_MISSING), HTTP 400.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecSubmitForm.java:42

import java.io.Serial;

/**
 * AgentSpec submit form.
 *
 * @author nacos
 */
public class AgentSpecSubmitForm extends AgentSpecForm {
    
    @Serial
    private static final long serialVersionUID = 1L;
    
    private String version;
    
    @Override
    public void validate() throws NacosApiException {
        fillDefaultNamespaceId();
        if (StringUtils.isBlank(getAgentSpecName())) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Request parameter `agentSpecName` should not be blank.");
        }
    }
    
    @Override
    public String getVersion() {
        return version;
    }
    
    @Override
    public void setVersion(String version) {
        this.version = version;
    }
}

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Provide a non-blank agentSpecName in the form-encoded request body.
  2. Ensure Content-Type is application/x-www-form-urlencoded so Spring binds agentSpecName.
  3. Validate the name client-side before enabling the submit action.

Example fix

// before
curl -X POST 'http://host/v3/admin/ai/agentspecs/submit' -d 'version=1.0.0'
// after
curl -X POST 'http://host/v3/admin/ai/agentspecs/submit' -d 'agentSpecName=mySpec&version=1.0.0'
Defensive patterns

Strategy: validation

Validate before calling

if (agentSpecName == null || agentSpecName.trim().isEmpty()) {
    throw new IllegalArgumentException("agentSpecName required");
}

Type guard

static boolean hasAgentSpecName(AgentSpecSubmitForm f) {
    return f.getAgentSpecName() != null && !f.getAgentSpecName().trim().isEmpty();
}

Try / catch

catch (NacosApiException e) {
    if (e.getErrCode() == 10000 && e.getMessage().contains("agentSpecName")) { /* fix name */ }
}

Prevention

When it happens

Trigger: Calling POST /v3/admin/ai/agentspecs/submit with namespaceId set but agentSpecName omitted or empty. The form fields are namespaceId, agentSpecName, version.

Common situations: Submit button enabled before the name field is filled; a batch tool iterates a list and one entry has a null name; request serialized as JSON so the form param is unbound.

Related errors


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