{"record":{"id":"cbfa02a8feb0c321","repo":"alibaba/nacos","slug":"10000-cbfa02","errorCode":"10000","errorMessage":"required parameter 'namespaceName' is missing","messagePattern":"required parameter 'namespaceName' is missing","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"warning","filePath":"core/src/main/java/com/alibaba/nacos/core/namespace/model/form/CreateNamespaceForm.java","lineNumber":48,"sourceCode":" */\npublic class CreateNamespaceForm extends NamespaceForm {\n    \n    private static final long serialVersionUID = 1069121416033814056L;\n    \n    private String customNamespaceId;\n    \n    public String getCustomNamespaceId() {\n        return customNamespaceId;\n    }\n    \n    public void setCustomNamespaceId(String customNamespaceId) {\n        this.customNamespaceId = customNamespaceId;\n    }\n    \n    @Override\n    public void validate() throws NacosApiException {\n        if (null == super.getNamespaceName()) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"required parameter 'namespaceName' is missing\");\n        }\n        if (StringUtils.isBlank(customNamespaceId)) {\n            customNamespaceId = UUID.randomUUID().toString();\n        } else {\n            customNamespaceId = customNamespaceId.trim();\n        }\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":58,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/namespace/model/form/CreateNamespaceForm.java#L30-L58","documentation":"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.","triggerScenarios":"POST to the namespace creation API (ConsoleNamespaceController.createNamespace) with the namespaceName parameter omitted/null.","commonSituations":"Confusing namespaceId (optional custom ID) with namespaceName (required label); a form that only sends customNamespaceId; frontend field not bound.","solutions":["Always send namespaceName (the display name).","Remember customNamespaceId is optional and auto-generated when blank.","Validate namespaceName != null before calling."],"exampleFix":"// before\nPOST .../namespace  {\"customNamespaceId\":\"dev\"}\n// after\nPOST .../namespace  {\"customNamespaceId\":\"dev\",\"namespaceName\":\"Development\"}","handlingStrategy":"validation","validationCode":"if (namespaceName == null || namespaceName.isBlank()) {\n    throw new IllegalArgumentException(\"namespaceName (display name) is required; customNamespaceId is optional\");\n}\n// customNamespaceId may be null/blank -> server generates a UUID","typeGuard":null,"tryCatchPattern":"try {\n    namespaceService.createNamespace(customId, namespaceName, desc);\n} catch (NacosApiException e) {\n    if (e.getErrCode() == 10000 && e.getMessage().contains(\"namespaceName\")) {\n        // display name missing -> prompt user and retry\n    } else { throw e; }\n}","preventionTips":["Distinguish namespaceName (required label) from customNamespaceId (optional id).","Make namespaceName a required field in the UI form.","Let customNamespaceId auto-generate when blank."],"tags":["namespace","validation","admin-api"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}