alibaba/nacos · warning · NacosApiException

10000

10000

Error message

required parameter 'namespaceName' is missing

What it means

CreateNamespaceForm.validate() requires namespaceName (the human-readable display name) be non-null when creating a namespace, throwing NacosApiException HTTP 400 / ErrorCode.PARAMETER_MISSING (10000). Note customNamespaceId is OPTIONAL — if blank, the server auto-generates a UUID — so only the display name is mandatory.

Source

Thrown at core/src/main/java/com/alibaba/nacos/core/namespace/model/form/CreateNamespaceForm.java:48

 */
public class CreateNamespaceForm extends NamespaceForm {
    
    private static final long serialVersionUID = 1069121416033814056L;
    
    private String customNamespaceId;
    
    public String getCustomNamespaceId() {
        return customNamespaceId;
    }
    
    public void setCustomNamespaceId(String customNamespaceId) {
        this.customNamespaceId = customNamespaceId;
    }
    
    @Override
    public void validate() throws NacosApiException {
        if (null == super.getNamespaceName()) {
            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,
                "required parameter 'namespaceName' is missing");
        }
        if (StringUtils.isBlank(customNamespaceId)) {
            customNamespaceId = UUID.randomUUID().toString();
        } else {
            customNamespaceId = customNamespaceId.trim();
        }
    }
}

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Always send namespaceName (the display name).
  2. Remember customNamespaceId is optional and auto-generated when blank.
  3. Validate namespaceName != null before calling.

Example fix

// before
POST .../namespace  {"customNamespaceId":"dev"}
// after
POST .../namespace  {"customNamespaceId":"dev","namespaceName":"Development"}
Defensive patterns

Strategy: validation

Validate before calling

if (namespaceName == null || namespaceName.isBlank()) {
    throw new IllegalArgumentException("namespaceName (display name) is required; customNamespaceId is optional");
}
// customNamespaceId may be null/blank -> server generates a UUID

Try / catch

try {
    namespaceService.createNamespace(customId, namespaceName, desc);
} catch (NacosApiException e) {
    if (e.getErrCode() == 10000 && e.getMessage().contains("namespaceName")) {
        // display name missing -> prompt user and retry
    } else { throw e; }
}

Prevention

When it happens

Trigger: POST to the namespace creation API (ConsoleNamespaceController.createNamespace) with the namespaceName parameter omitted/null.

Common situations: Confusing namespaceId (optional custom ID) with namespaceName (required label); a form that only sends customNamespaceId; frontend field not bound.

Related errors


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