{"record":{"id":"2f6f36aba4f455c2","repo":"alibaba/nacos","slug":"10000-2f6f36","errorCode":"10000","errorMessage":"required parameter 'namespaceId' is missing","messagePattern":"required parameter 'namespaceId' is missing","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"warning","filePath":"core/src/main/java/com/alibaba/nacos/core/namespace/model/form/NamespaceForm.java","lineNumber":76,"sourceCode":"        return namespaceName;\n    }\n    \n    public void setNamespaceName(String namespaceName) {\n        this.namespaceName = namespaceName;\n    }\n    \n    public String getNamespaceDesc() {\n        return namespaceDesc;\n    }\n    \n    public void setNamespaceDesc(String namespaceDesc) {\n        this.namespaceDesc = namespaceDesc;\n    }\n    \n    @Override\n    public void validate() throws NacosApiException {\n        if (null == namespaceId) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"required parameter 'namespaceId' is missing\");\n        }\n        if (null == namespaceName) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"required parameter 'namespaceName' is missing\");\n        }\n    }\n}\n","sourceCodeStart":58,"sourceCodeEnd":85,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/namespace/model/form/NamespaceForm.java#L58-L85","documentation":"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.","triggerScenarios":"PUT to the namespace update API (ConsoleNamespaceController.updateNamespace / NamespaceControllerV3) without the namespaceId parameter.","commonSituations":"Reusing the create-form payload (where id is optional) for an update; frontend dropping the id field; passing only the new name/desc.","solutions":["Send the existing namespaceId on every update.","Send namespaceName too (it is also required, see 1068).","Fetch the current namespace id from the list API before updating."],"exampleFix":"// before\nPUT .../namespace  {\"namespaceName\":\"Dev\",\"namespaceDesc\":\"...\"}\n// after\nPUT .../namespace  {\"namespaceId\":\"dev\",\"namespaceName\":\"Dev\",\"namespaceDesc\":\"...\"}","handlingStrategy":"validation","validationCode":"if (namespaceId == null || namespaceId.isBlank()) {\n    throw new IllegalArgumentException(\"namespaceId is required for update\");\n}\nif (namespaceName == null || namespaceName.isBlank()) {\n    throw new IllegalArgumentException(\"namespaceName is required for update\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    namespaceService.updateNamespace(namespaceId, namespaceName, desc);\n} catch (NacosApiException e) {\n    if (e.getErrCode() == 10000 && e.getMessage().contains(\"namespaceId\")) {\n        // id missing -> fetch from list API and retry\n    } else { throw e; }\n}","preventionTips":["Update is a full replace: always resend namespaceId and namespaceName.","Fetch the current namespace id before editing.","Do not reuse the create-form payload (id optional) for updates."],"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"}