{"record":{"id":"bd4e1663e3d4fa94","repo":"apache/shenyu","slug":"namespace-is-not-exist","errorCode":null,"errorMessage":"namespace is not exist","messagePattern":"namespace is not exist","errorType":"validation","errorClass":"ShenyuAdminException","httpStatus":null,"severity":"error","filePath":"shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ConfigController.java","lineNumber":77,"sourceCode":"        this.httpLongPollingDataChangedListener = httpLongPollingDataChangedListener;\n        this.namespaceService = namespaceService;\n    }\n    \n    /**\n     * Fetch configs shenyu result.\n     *\n     * @param groupKeys   the group keys\n     * @param namespaceId namespaceId\n     * @return the shenyu result\n     */\n    @GetMapping(\"/fetch\")\n    public ShenyuAdminResult fetchConfigs(@NotNull final String[] groupKeys, final String namespaceId) {\n        if (StringUtils.isEmpty(namespaceId)) {\n            throw new ShenyuAdminException(\"namespaceId is null\");\n        }\n        NamespaceVO existNamespace = namespaceService.findByNamespaceId(namespaceId);\n        if (StringUtils.isNotEmpty(namespaceId) && ObjectUtils.isEmpty(existNamespace)) {\n            throw new ShenyuAdminException(\"namespace is not exist\");\n        }\n        Map<String, ConfigData<?>> result = Maps.newHashMap();\n        for (String groupKey : groupKeys) {\n            ConfigData<?> data = httpLongPollingDataChangedListener.fetchConfig(ConfigGroupEnum.valueOf(groupKey), namespaceId);\n            result.put(groupKey, data);\n        }\n        return ShenyuAdminResult.success(ShenyuResultMessage.SUCCESS, result);\n    }\n    \n    /**\n     * Listener.\n     *\n     * @param request  the request\n     * @param response the response\n     */\n    @PostMapping(value = \"/listener\")\n    public void listener(final HttpServletRequest request, final HttpServletResponse response) {\n        httpLongPollingDataChangedListener.doLongPolling(request, response);","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ConfigController.java#L59-L95","documentation":"After validating that namespaceId is present, fetchConfigs looks it up via namespaceService.findByNamespaceId and throws ShenyuAdminException(\"namespace is not exist\") when no namespace with that id is registered in admin. The gateway must only sync namespaces the admin knows about.","triggerScenarios":"GET /configs/fetch with a namespaceId that does not exist in the admin's namespace table (typo, wrong environment, namespace deleted, or DB not migrated/seeded with the default namespace).","commonSituations":"Pointing a gateway at a different admin environment than the one the namespace was created in; copying a namespaceId from docs without registering it; database recreated without namespace records.","solutions":["Check the exact namespaceId in the admin dashboard (System -> Namespace) and correct the client's config to match","Create the missing namespace in the admin dashboard/API before syncing","If the namespace table is empty, ensure the schema was initialized from the matching db/init script for your version"],"exampleFix":"// before\nnamespaceId=prod-01            // namespace never registered\n// after\nnamespaceId=649330b6-c2d7-4f6c-9b2c-9f5c7f1b2f3a   // registered in admin","handlingStrategy":"validation","validationCode":"// before calling the API, confirm the namespace exists\nShenyuAdminResult ns = adminClient.get(\"/namespace/detail?id=\" + namespaceId);\nif (ns.getCode() != 200) { throw new IllegalStateException(\"namespace not registered in admin: \" + namespaceId); }","typeGuard":null,"tryCatchPattern":"try {\n    return fetchConfigs(groupKeys, namespaceId);\n} catch (HttpServerErrorException e) {\n    if (e.getResponseBodyAsString().contains(\"namespace is not exist\")) { /* create namespace or fix id */ }\n}","preventionTips":["Copy namespace ids from the admin dashboard, not from docs or memory","Pin namespace ids in config per environment (dev/staging/prod) and verify at deploy time","Recreate namespaces after DB rebuilds or version migrations"],"tags":["http-api","namespace","resource-not-found"],"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"}