alibaba/nacos · warning · NacosApiException

10000

10000

Error message

required parameter 'namespaceId' is missing

What it means

NamespaceForm.validate() (used by the update namespace flow) requires namespaceId be non-null, throwing NacosApiException HTTP 400 / ErrorCode.PARAMETER_MISSING (10000). Unlike create, the update form needs the target tenant ID to know which namespace to change.

Source

Thrown at core/src/main/java/com/alibaba/nacos/core/namespace/model/form/NamespaceForm.java:76

        return namespaceName;
    }
    
    public void setNamespaceName(String namespaceName) {
        this.namespaceName = namespaceName;
    }
    
    public String getNamespaceDesc() {
        return namespaceDesc;
    }
    
    public void setNamespaceDesc(String namespaceDesc) {
        this.namespaceDesc = namespaceDesc;
    }
    
    @Override
    public void validate() throws NacosApiException {
        if (null == namespaceId) {
            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,
                "required parameter 'namespaceId' is missing");
        }
        if (null == namespaceName) {
            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,
                "required parameter 'namespaceName' is missing");
        }
    }
}

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Send the existing namespaceId on every update.
  2. Send namespaceName too (it is also required, see 1068).
  3. Fetch the current namespace id from the list API before updating.

Example fix

// before
PUT .../namespace  {"namespaceName":"Dev","namespaceDesc":"..."}
// after
PUT .../namespace  {"namespaceId":"dev","namespaceName":"Dev","namespaceDesc":"..."}
Defensive patterns

Strategy: validation

Validate before calling

if (namespaceId == null || namespaceId.isBlank()) {
    throw new IllegalArgumentException("namespaceId is required for update");
}
if (namespaceName == null || namespaceName.isBlank()) {
    throw new IllegalArgumentException("namespaceName is required for update");
}

Try / catch

try {
    namespaceService.updateNamespace(namespaceId, namespaceName, desc);
} catch (NacosApiException e) {
    if (e.getErrCode() == 10000 && e.getMessage().contains("namespaceId")) {
        // id missing -> fetch from list API and retry
    } else { throw e; }
}

Prevention

When it happens

Trigger: PUT to the namespace update API (ConsoleNamespaceController.updateNamespace / NamespaceControllerV3) without the namespaceId parameter.

Common situations: Reusing the create-form payload (where id is optional) for an update; frontend dropping the id field; passing only the new name/desc.

Related errors


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