{"record":{"id":"6cd1fcbe94b8c455","repo":"alibaba/nacos","slug":"api-function-disabled-6cd1fc","errorCode":"API_FUNCTION_DISABLED","errorMessage":"Current functionMode is `config`, naming module is disabled.","messagePattern":"Current functionMode is `config`, naming module is disabled\\.","errorType":"exception","errorClass":"NacosApiException","httpStatus":501,"severity":"error","filePath":"console/src/main/java/com/alibaba/nacos/console/handler/impl/noop/naming/InstanceNoopHandler.java","lineNumber":46,"sourceCode":"\n/**\n * Noop Implementation of InstanceHandler that handles instance-related operations.\n * Used when `naming` module is disabled(functionMode is `config`)\n *\n * @author xiweng.yy\n */\n@Service\n@ConditionalOnMissingBean(value = InstanceHandler.class, ignored = InstanceNoopHandler.class)\npublic class InstanceNoopHandler implements InstanceHandler {\n    \n    private static final String MCP_NOT_ENABLED_MESSAGE =\n        \"Current functionMode is `config`, naming module is disabled.\";\n    \n    @Override\n    public Page<? extends Instance> listInstances(String namespaceId,\n        String serviceNameWithoutGroup, String groupName,\n        String clusterName, int page, int pageSize) throws NacosException {\n        throw new NacosApiException(NacosException.SERVER_NOT_IMPLEMENTED,\n            ErrorCode.API_FUNCTION_DISABLED,\n            MCP_NOT_ENABLED_MESSAGE);\n    }\n    \n    @Override\n    public void updateInstance(InstanceForm instanceForm, Instance instance) throws NacosException {\n        throw new NacosApiException(NacosException.SERVER_NOT_IMPLEMENTED,\n            ErrorCode.API_FUNCTION_DISABLED,\n            MCP_NOT_ENABLED_MESSAGE);\n    }\n    \n    @Override\n    public void removeInstance(InstanceForm instanceForm, Instance instance) throws NacosException {\n        throw new NacosApiException(NacosException.SERVER_NOT_IMPLEMENTED,\n            ErrorCode.API_FUNCTION_DISABLED,\n            MCP_NOT_ENABLED_MESSAGE);\n    }\n}","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/console/src/main/java/com/alibaba/nacos/console/handler/impl/noop/naming/InstanceNoopHandler.java#L28-L64","documentation":"Thrown by InstanceNoopHandler.listInstances when functionMode=config. Listing service instances needs the naming module, which ConditionFunctionEnabled.ConditionNamingEnabled does not enable in config-only mode, so Spring loads InstanceNoopHandler and every list call returns API_FUNCTION_DISABLED (40001) / HTTP 501.","triggerScenarios":"GET /v3/console/ns/instance/list or /v3/admin/ns/instance/list?serviceName=...&groupName=...&namespaceId=... against a server started with -Dnacos.functionMode=config. Also any SDK listInstances() call hitting a config-only node.","commonSituations":"A config-only Nacos node is deployed for configuration management, but a service-discovery dashboard or health check still polls instances here; mismatched functionMode after splitting a cluster into config-only and naming-only nodes.","solutions":["Route instance-list queries to a node whose functionMode enables naming (unset, =naming, =microservice, or =ai).","Restart the node in a naming-capable mode if discovery is actually required here.","Verify function_mode via GET /v3/admin/core/state before listing instances.","Remove the instance-list call from clients pointed at the config-only cluster."],"exampleFix":"# before\n-Dnacos.functionMode=config   # InstanceNoopHandler active -> listInstances -> 501\n\n# after — enable naming on this node\n-Dnacos.functionMode=naming   # or unset for all-modules","handlingStrategy":"validation","validationCode":"// GET {nacos}/v3/admin/core/state -> data[\"function_mode\"]\nString mode = serverState.get(\"function_mode\");\nboolean namingEnabled = (mode == null || mode.isEmpty())\n    || \"naming\".equalsIgnoreCase(mode)\n    || \"microservice\".equalsIgnoreCase(mode)\n    || \"ai\".equalsIgnoreCase(mode);\nif (!namingEnabled) { /* do not call listInstances; report naming disabled */ }","typeGuard":null,"tryCatchPattern":"try {\n    handler.listInstances(namespaceId, serviceName, groupName, clusterName, page, pageSize);\n} catch (NacosApiException e) {\n    if (e.getDetailErrCode() == ErrorCode.API_FUNCTION_DISABLED.getCode()) {\n        // naming module disabled (functionMode=config) -> skip discovery UI\n    } else { throw e; }\n}","preventionTips":["Keep a per-node function_mode map and never send naming requests to config-only nodes.","Cache /v3/admin/core/state at startup and refresh on reconnect.","Gate instance-list calls behind a namingEnabled check to avoid guaranteed 501s."],"tags":["function-mode","naming","noop-handler","config-only","configuration"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}