{"record":{"id":"fff60375328ace10","repo":"alibaba/nacos","slug":"api-function-disabled-fff603","errorCode":"API_FUNCTION_DISABLED","errorMessage":"Current functionMode is `naming`, config module is disabled.","messagePattern":"Current functionMode is `naming`, config module is disabled\\.","errorType":"exception","errorClass":"NacosApiException","httpStatus":501,"severity":"error","filePath":"console/src/main/java/com/alibaba/nacos/console/handler/impl/noop/config/HistoryNoopHandler.java","lineNumber":49,"sourceCode":"\n/**\n * Noop Implementation of HistoryHandler for handling internal configuration operations.\n * Used when `config` module is disabled(functionMode is `naming`)\n *\n * @author xiweng.yy\n */\n@Service\n@ConditionalOnMissingBean(value = HistoryHandler.class, ignored = HistoryNoopHandler.class)\npublic class HistoryNoopHandler implements HistoryHandler {\n    \n    private static final String MCP_NOT_ENABLED_MESSAGE =\n        \"Current functionMode is `naming`, config module is disabled.\";\n    \n    @Override\n    public ConfigHistoryDetailInfo getConfigHistoryInfo(String dataId, String group,\n        String namespaceId, Long nid)\n        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 Page<ConfigHistoryBasicInfo> listConfigHistory(String dataId, String group,\n        String namespaceId,\n        Integer pageNo, Integer 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 ConfigHistoryDetailInfo getPreviousConfigHistoryInfo(String dataId, String group,\n        String namespaceId,\n        Long id) throws NacosException {\n        throw new NacosApiException(NacosException.SERVER_NOT_IMPLEMENTED,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/console/src/main/java/com/alibaba/nacos/console/handler/impl/noop/config/HistoryNoopHandler.java#L31-L67","documentation":"Thrown by HistoryNoopHandler.getConfigHistoryInfo under functionMode=naming. Reading a single config-history detail (by nid) needs config-module history persistence, which is not loaded in naming-only mode, so the noop handler returns API_FUNCTION_DISABLED (40001) / HTTP 501.","triggerScenarios":"GET /v3/console/cs/history or /v3/admin/cs/history?dataId=...&group=...&namespaceId=...&nid=... against a naming-only server.","commonSituations":"An audit/compliance tool reads config change history from a naming-only node; functionMode=naming slims the cluster but the history audit still runs here.","solutions":["Query config history against a config-enabled node (functionMode unset, =config, =microservice, or =ai).","Restart the node in a config-capable mode if history reads are expected here.","Verify function_mode via GET /v3/admin/core/state before calling.","Re-point the audit tool to a config-capable node."],"exampleFix":"# before\n-Dnacos.functionMode=naming   # getConfigHistoryInfo -> 501\n\n# after\n# read history on a node with the config module enabled","handlingStrategy":"validation","validationCode":"// Verify config module before getConfigHistoryInfo.\nString mode = serverState.get(\"function_mode\");\nboolean configEnabled = (mode == null || mode.isEmpty())\n    || \"config\".equalsIgnoreCase(mode)\n    || \"microservice\".equalsIgnoreCase(mode)\n    || \"ai\".equalsIgnoreCase(mode);\nif (!configEnabled) { /* skip history detail query */ }","typeGuard":null,"tryCatchPattern":"try {\n    handler.getConfigHistoryInfo(dataId, group, namespaceId, nid);\n} catch (NacosApiException e) {\n    if (e.getDetailErrCode() == ErrorCode.API_FUNCTION_DISABLED.getCode()) {\n        // config disabled -> history unavailable on this node\n    } else { throw e; }\n}","preventionTips":["Run history audits against config-enabled nodes only.","Treat 501/40001 on history as node-capability info, not transient.","Record function_mode in audit logs."],"tags":["function-mode","config-history","noop-handler","naming-only","configuration"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}