{"record":{"id":"103bf3f12cb4fba0","repo":"apache/shenyu","slug":"shenyu-discovery-mode-current-didn-t-support-s","errorCode":null,"errorMessage":"shenyu discovery mode current didn't support %s","messagePattern":"shenyu discovery mode current didn't support (.+?)","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"shenyu-admin/src/main/java/org/apache/shenyu/admin/discovery/DiscoveryProcessorHolder.java","lineNumber":57,"sourceCode":"    /**\n     * chooseProcessor.\n     *\n     * @param mode mode\n     * @return DiscoveryProcessor\n     */\n    public DiscoveryProcessor chooseProcessor(final String mode) {\n        if (DiscoveryMode.LOCAL.name().equalsIgnoreCase(mode)) {\n            return localDiscoveryProcessor;\n        } else if (DiscoveryMode.ZOOKEEPER.name().equalsIgnoreCase(mode)) {\n            return defaultDiscoveryProcessor;\n        } else if (DiscoveryMode.ETCD.name().equalsIgnoreCase(mode)) {\n            return defaultDiscoveryProcessor;\n        } else if (DiscoveryMode.NACOS.name().equalsIgnoreCase(mode)) {\n            return defaultDiscoveryProcessor;\n        } else if (DiscoveryMode.EUREKA.name().equalsIgnoreCase(mode)) {\n            return apDiscoveryProcessor;\n        } else {\n            throw new NotImplementedException(\"shenyu discovery mode current didn't support \" + mode);\n        }\n    }\n\n}\n","sourceCodeStart":39,"sourceCodeEnd":62,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-admin/src/main/java/org/apache/shenyu/admin/discovery/DiscoveryProcessorHolder.java#L39-L62","documentation":"DiscoveryProcessorHolder.chooseProcessor selects the DiscoveryProcessor implementation that handles upstream discovery for a discoveryConfig whose `mode` field is one of the DiscoveryMode enum values (local, zookeeper, nacos, eureka). If the configured mode matches none of the supported branches, it throws NotImplementedException. This means the admin's discovery configuration references a discovery mode the running ShenYu build cannot process.","triggerScenarios":"Calling chooseProcessor (via discovery config save/sync in shenyu-admin) with a discoveryConfig.mode that is not LOCAL, ZOOKEEPER, NACOS or EUREKA (case-insensitive) — e.g. mode set to CONSUL, ETCD or a typo like 'nacos ' or 'NacosX'.","commonSituations":"Dashboard/API request posting a discovery config with a hand-typed mode string; database seeded with a mode value from a newer ShenYu version that this build's DiscoveryMode/processor set doesn't support; mixing proxy plugin (e.g. websocket proxy uses eureka 'ap' discovery) configs across versions.","solutions":["Set the discovery config's mode to one of the supported values: local, zookeeper, nacos, or eureka (case-insensitive).","Fix typos or stray whitespace in the mode field of the discovery_config row / dashboard form.","If the mode is genuinely needed (e.g. etcd/consul discovery), upgrade ShenYu to a version that ships a DiscoveryProcessor for it, or implement and register a custom DiscoveryProcessor.","Verify the mode reaches admin intact — check the REST payload in the admin logs before assuming the processor layer is at fault."],"exampleFix":"// before\ndiscoveryConfig.setMode(\"consul\");\n// after\ndiscoveryConfig.setMode(DiscoveryMode.NACOS.name());","handlingStrategy":"validation","validationCode":"java.util.Arrays.stream(DiscoveryMode.values())\n    .map(Enum::name)\n    .filter(m -> m.equalsIgnoreCase(mode))\n    .findFirst()\n    .orElseThrow(() -> new IllegalArgumentException(\"unsupported discovery mode: \" + mode));","typeGuard":null,"tryCatchPattern":"try {\n    processor = DiscoveryProcessorHolder.getInstance().chooseProcessor(mode);\n} catch (NotImplementedException e) {\n    LOG.error(\"discovery mode {} not supported, falling back to local\", mode, e);\n}","preventionTips":["Only submit mode values from the DiscoveryMode enum, never free text","Validate mode in the dashboard form with a dropdown","Pin admin and gateway to the same ShenYu version"],"tags":["discovery","unsupported-mode","configuration"],"backgroundTag":"unsupported-enum-value","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"}