{"record":{"id":"7f32398e1d76ea36","repo":"alibaba/nacos","slug":"the-addressing-mode-exists-name-just-support","errorCode":null,"errorMessage":"The addressing mode exists : {name}, just support : [{Arrays.toString(LookupType.values())}]","messagePattern":"The addressing mode exists : (.+?), just support : \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/alibaba/nacos/core/cluster/lookup/LookupFactory.java","lineNumber":90,"sourceCode":"        Loggers.CLUSTER.info(\"Current addressing mode selection : {}\",\n            LOOK_UP.getClass().getSimpleName());\n        return LOOK_UP;\n    }\n    \n    /**\n     * Switch to target addressing mode.\n     *\n     * @param name          target member-lookup name\n     * @param memberManager {@link ServerMemberManager}\n     * @return {@link MemberLookup}\n     * @throws NacosException {@link NacosException}\n     */\n    public static MemberLookup switchLookup(String name, ServerMemberManager memberManager)\n        throws NacosException {\n        LookupType lookupType = LookupType.sourceOf(name);\n        \n        if (Objects.isNull(lookupType)) {\n            throw new IllegalArgumentException(\n                \"The addressing mode exists : \" + name + \", just support : [\"\n                    + Arrays.toString(LookupType.values())\n                    + \"]\");\n        }\n        \n        if (Objects.equals(currentLookupType, lookupType)) {\n            return LOOK_UP;\n        }\n        MemberLookup newLookup = find(lookupType);\n        currentLookupType = lookupType;\n        if (Objects.nonNull(LOOK_UP)) {\n            LOOK_UP.destroy();\n        }\n        LOOK_UP = newLookup;\n        LOOK_UP.injectMemberManager(memberManager);\n        Loggers.CLUSTER.info(\"Current addressing mode selection : {}\",\n            LOOK_UP.getClass().getSimpleName());\n        return LOOK_UP;","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/cluster/lookup/LookupFactory.java#L72-L108","documentation":"Thrown by LookupFactory.switchLookup when the requested member-addressing (cluster discovery) mode name does not match a known LookupType. The LookupType enum only defines two lookup names: 'file' (cluster.conf) and 'address-server' (Nacos address server). Note the message text is misleading: it says the mode 'exists' but actually means the mode is UNRECOGNIZED/unsupported, and it lists the supported values.","triggerScenarios":"Calling PUT /v3/admin/core/cluster/lookup with a LookupUpdateRequest whose 'type' field is any string other than 'file' or 'address-server' (e.g. 'none', 'dns', 'config', empty after trim). Internally LookupType.sourceOf(name) iterates the enum and matches the 'name' field (not the enum constant), returning null when no match is found.","commonSituations":"Operator typo in the addressing-mode switch API; assuming the type value is the enum constant name ('FILE_CONFIG'/'ADDRESS_SERVER') instead of the lookup name ('file'/'address-server'); sending a mode supported by an older/newer Nacos version against a server that only ships the two built-in lookup types.","solutions":["Use one of the supported lookup names: 'file' (read cluster members from cluster.conf) or 'address-server' (pull members from the address server).","If you intended a custom MemberLookup SPI implementation, confirm the SPI is registered and that its lookup name is returned by a LookupType you added; built-in Nacos only ships the two above.","Check the LookupUpdateRequest payload serialization so the 'type' field is not null, whitespace, or mangled by JSON binding."],"exampleFix":"// before\nPUT /v3/admin/core/cluster/lookup\n{\"type\": \"config\"}\n\n// after\nPUT /v3/admin/core/cluster/lookup\n{\"type\": \"file\"}","handlingStrategy":"validation","validationCode":"private static final Set<String> VALID_LOOKUP = Set.of(\"file\", \"address-server\");\nif (!VALID_LOOKUP.contains(request.getType())) {\n    // reject before calling switchLookup / the API\n    throw new IllegalArgumentException(\"Unsupported lookup type: \" + request.getType());\n}","typeGuard":null,"tryCatchPattern":"try {\n    LookupFactory.switchLookup(type, memberManager);\n} catch (IllegalArgumentException e) {\n    // type not supported; surface supported values to the operator\n}","preventionTips":["Whitelist the lookup type on the client using the exact names 'file'/'address-server'.","Reject null/blank type before sending the lookup-switch request."],"tags":["cluster","addressing-mode","configuration","illegal-argument"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}