{"record":{"id":"199d658ef4485672","repo":"apache/shenyu","slug":"namespaceid-is-not-exist","errorCode":null,"errorMessage":"namespaceId is not exist","messagePattern":"namespaceId is not exist","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuClientHttpRegistryController.java","lineNumber":149,"sourceCode":"     * Offline result string.\n     *\n     * @param offlineDTO the offline dto\n     * @return the string\n     */\n    @PostMapping(\"/offline\")\n    @ResponseBody\n    public String offline(@RequestBody final URIRegisterDTO offlineDTO) {\n        if (Objects.isNull(offlineDTO.getNamespaceId())) {\n            offlineDTO.setNamespaceId(Constants.SYS_DEFAULT_NAMESPACE_ID);\n        }\n        publisher.publish(offlineDTO);\n        return ShenyuResultMessage.SUCCESS;\n    }\n\n    public void checkClientNamespaceExist(final String namespaceId) {\n        NamespaceVO namespaceVO = namespaceService.findByNamespaceId(namespaceId);\n        if (Objects.isNull(namespaceVO)) {\n            throw new IllegalArgumentException(\"namespaceId is not exist\");\n        }\n    }\n}\n","sourceCodeStart":131,"sourceCodeEnd":153,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuClientHttpRegistryController.java#L131-L153","documentation":"ShenyuClientHttpRegistryController.checkClientNamespaceExist validates, before any client registration operation, that the supplied namespaceId resolves to a namespace via namespaceService.findByNamespaceId. If none is found it throws IllegalArgumentException(\"namespaceId is not exist\"), rejecting the registration call.","triggerScenarios":"A Shenyu client (spring-mvc/dubbo etc.) registers over HTTP with a namespaceId that admin has not registered; typical path is any register/registerUri/registerMetadata endpoint that invokes this check.","commonSituations":"Client's shenyu.register.namespace config not matching an admin namespace; admin DB reinitialized losing namespaces; multi-environment setup with mismatched ids.","solutions":["Create the namespace in the admin dashboard (System -> Namespace) before clients register","Align the client's shenyu.register.namespace property with a registered admin namespace id","Re-seed the admin DB's namespace table if it was wiped during migration"],"exampleFix":"// before (client config)\nshenyu:\n  register:\n    namespace: my-ns        // not registered in admin\n// after\nshenyu:\n  register:\n    namespace: 649330b6-c2d7-4f6c-9b2c-9f5c7f1b2f3a   // registered","handlingStrategy":"validation","validationCode":"// on the client, before registering\nif (!namespaceRegisteredInAdmin(namespaceId)) {\n    throw new IllegalStateException(\"namespaceId is not registered in admin: \" + namespaceId);\n}","typeGuard":null,"tryCatchPattern":"try {\n    registryClient.register(metadata);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"namespaceId is not exist\")) { /* create namespace or fix client config */ }\n}","preventionTips":["Create namespaces in admin before starting any Shenyu clients","Keep shenyu.register.namespace identical across client configs per environment","After DB re-initialization, recreate namespaces before clients reconnect"],"tags":["client-registration","namespace","validation"],"backgroundTag":"resource-not-found","analyzedSha":"567142e07261b3e615ae8850b30f4421f455cc5d","analyzedAt":"2026-09-12T10:08:21.293Z","contentChangedAt":"2026-09-12T10:08:21.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}