{"record":{"id":"092b3b86797b9ae2","repo":"apache/shenyu","slug":"s-plugin-not-enabled-for-current-namespace-or-plugin-not","errorCode":null,"errorMessage":"%s plugin not enabled for current namespace or plugin not exist for namespaceId: %s","messagePattern":"(.+?) plugin not enabled for current namespace or plugin not exist for namespaceId: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"shenyu-admin/src/main/java/org/apache/shenyu/admin/service/register/AbstractShenyuClientRegisterServiceImpl.java","lineNumber":231,"sourceCode":"        String handler = buildHandle(validUriList, selectorDO);\n        if (Objects.nonNull(handler)) {\n            selectorDO.setHandle(handler);\n            SelectorData selectorData = selectorService.buildByNameAndPluginNameAndNamespaceId(selectorName, PluginNameAdapter.rpcTypeAdapter(rpcType()), namespaceId);\n            selectorData.setHandle(handler);\n            // update db\n            selectorService.updateSelective(selectorDO);\n            // publish change event.\n            doDiscoveryLocal(selectorDO, pluginName, validUriList);\n        }\n        return ShenyuResultMessage.SUCCESS;\n    }\n\n    @Override\n    public void checkNamespacePluginRel(final String namespaceId, final String pluginName) {\n        String errorMsg = String.format(\"%s plugin not enabled for current namespace or plugin not exist for namespaceId: %s\", pluginName, namespaceId);\n        PluginDO pluginDO = pluginMapper.selectByName(pluginName);\n        if (Objects.isNull(pluginDO)) {\n            throw new IllegalArgumentException(errorMsg);\n        }\n        NamespacePluginVO namespacePluginRelation = namespacePluginRelMapper.selectByPluginIdAndNamespaceId(pluginDO.getId(), namespaceId);\n        if (Objects.isNull(namespacePluginRelation)) {\n            throw new IllegalArgumentException(errorMsg);\n        }\n    }\n    \n    @Override\n    public String doHeartbeat(final String selectorName, final List<URIRegisterDTO> uriList, final String namespaceId) {\n        if (CollectionUtils.isEmpty(uriList)) {\n            return \"\";\n        }\n        String pluginName = PluginNameAdapter.rpcTypeAdapter(rpcType());\n        SelectorDO selectorDO = selectorService.findByNameAndPluginNameAndNamespaceId(selectorName, pluginName, namespaceId);\n        if (Objects.isNull(selectorDO)) {\n            throw new ShenyuException(\"doHeartbeat Failed to execute,wait to retry.\");\n        }\n        // update upstream","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/register/AbstractShenyuClientRegisterServiceImpl.java#L213-L249","documentation":"checkNamespacePluginRel() throws IllegalArgumentException when the plugin itself does not exist in the plugin table (pluginMapper.selectByName returns null). The formatted message names the plugin and namespaceId. This is a precondition check run by register() and doRegisterURI() to ensure the client's rpc type plugin is present before any registration proceeds.","triggerScenarios":"A client of rpcType X registers while no plugin named (per PluginNameAdapter mapping) X exists in the plugin table — e.g. the plugin module is not deployed/enabled in this admin build, or the plugin name adapter produces a name not seeded in the DB.","commonSituations":"Deploying an admin instance without the plugin's DB seed data; typo or version mismatch where the client's rpc type maps to a renamed plugin; fresh database missing plugin rows; client misconfigured with a rpcType the admin doesn't support.","solutions":["Confirm the plugin exists in the admin dashboard's plugin list; if missing, re-run the DB init scripts for your database.","Check the client's rpcType configuration maps to the expected plugin name (PluginNameAdapter.rpcTypeAdapter).","Add/enable the corresponding shenyu plugin in admin so its row exists in the plugin table.","Verify admin and client versions agree on plugin naming."],"exampleFix":"// before: client config\n{\"rpcType\": \"grpc\"}  // grpc plugin row absent from DB\n// after: run db init / insert plugin row or choose a plugin that exists, e.g.\n{\"rpcType\": \"springCloud\"}","handlingStrategy":"validation","validationCode":"PluginDO plugin = pluginMapper.selectByName(pluginName);\nif (plugin == null) {\n    throw new IllegalStateException(pluginName + \" plugin row missing; run DB init scripts or enable the plugin before client registration\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    registerService.register(metaData);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"plugin not enabled for current namespace\")) {\n        // prompt operator to enable the plugin / verify rpcType mapping\n    }\n    throw e;\n}","preventionTips":["Run the full DB init scripts so all plugin rows exist before clients register.","Match admin and client versions so rpcType-to-plugin-name mapping agrees.","Confirm the plugin appears in the admin dashboard plugin list during deployment checks.","Verify the client's rpcType is one the deployed admin supports."],"tags":["plugin","namespace","registration","validation"],"backgroundTag":"entity-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"}