{"record":{"id":"08c7d45f828f86e8","repo":"aeron-io/aeron","slug":"zero-services-are-only-supported-when","errorCode":null,"errorMessage":"zero services are only supported when ConsensusModuleExtension is enabled","messagePattern":"zero services are only supported when ConsensusModuleExtension is enabled","errorType":"validation","errorClass":"ClusterException","httpStatus":null,"severity":"error","filePath":"aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModule.java","lineNumber":2158,"sourceCode":"            {\n                egressPublisher = new EgressPublisher(leaderHeartbeatTimeoutNs);\n            }\n\n            final ChannelUri channelUri = parse(logChannel());\n            isLogMdc = channelUri.isUdp() && null == channelUri.get(ENDPOINT_PARAM_NAME);\n\n            if (null == consensusModuleExtension)\n            {\n                consensusModuleExtension = Configuration.newConsensusModuleExtension();\n            }\n\n            if (null != consensusModuleExtension && 0 != serviceCount)\n            {\n                throw new ClusterException(\"service count must be zero when ConsensusModuleExtension is enabled\");\n            }\n            else if (null == consensusModuleExtension && 0 == serviceCount)\n            {\n                throw new ClusterException(\"zero services are only supported when ConsensusModuleExtension is enabled\");\n            }\n\n            concludeMarkFile();\n\n            if (CommonContext.shouldPrintConfigurationOnStart())\n            {\n                System.out.println(this);\n            }\n        }\n\n        /**\n         * Has the context had the {@link #conclude()} method called.\n         *\n         * @return true of the {@link #conclude()} method has been called.\n         */\n        public boolean isConcluded()\n        {\n            return isConcluded;","sourceCodeStart":2140,"sourceCodeEnd":2176,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModule.java#L2140-L2176","documentation":"Running a cluster with zero services is only supported via ConsensusModuleExtension. conclude() throws if no extension is configured but serviceCount is 0, because a normal consensus module must host at least one ClusteredService.","triggerScenarios":"Launching ConsensusModule/ClusteredMediaDriver without registering any services (serviceCount == 0) and without the extension property set.","commonSituations":"Boilerplate copied from a driver-only test; forgetting to pass ClusteredServiceContainer contexts/serviceCount; intending to run extension mode but forgetting to set the extension property.","solutions":["Register at least one ClusteredService or set context.serviceCount(n) with n >= 1 plus service container configurations.","If you truly want zero services, enable the ConsensusModuleExtension via its configuration property.","Verify how serviceCount is derived from the service container contexts you pass to ClusteredMediaDriver.launch()."],"exampleFix":"// before\nClusteredMediaDriver.launch(driverCtx, mediaCtx, moduleCtx); // serviceCount=0, no extension\n// after\nmoduleCtx.serviceContainerContexts(List.of(new ClusteredServiceContainer.Context().clusteredService(new MyService())));\nClusteredMediaDriver.launch(driverCtx, mediaCtx, moduleCtx);","handlingStrategy":"validation","validationCode":"if (null == Configuration.newConsensusModuleExtension() && ctx.serviceCount() == 0) {\n    throw new IllegalArgumentException(\"register at least one clustered service or enable the extension\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure at least one ClusteredService is registered in normal mode","Enable the extension property explicitly when running zero-service clusters","Assert serviceCount > 0 in launch-time config checks"],"tags":["aeron-cluster","configuration","services","startup"],"backgroundTag":"conflicting-config-options","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}