{"record":{"id":"d3c6f991fbb19d94","repo":"aeron-io/aeron","slug":"publication-is-not-connected","errorCode":null,"errorMessage":"publication is not connected","messagePattern":"publication is not connected","errorType":"console","errorClass":"ClusterException","httpStatus":null,"severity":"error","filePath":"aeron-cluster/src/main/java/io/aeron/cluster/service/ConsensusModuleProxy.java","lineNumber":223,"sourceCode":"                .wrapAndApplyHeader(bufferClaim.buffer(), bufferClaim.offset(), messageHeaderEncoder)\n                .correlationId(correlationId)\n                .extended(BooleanType.TRUE);\n\n            bufferClaim.commit();\n\n            return true;\n        }\n\n        checkResult(position, publication);\n\n        return false;\n    }\n\n    private static void checkResult(final long position, final Publication publication)\n    {\n        if (Publication.NOT_CONNECTED == position)\n        {\n            throw new ClusterException(\"publication is not connected\");\n        }\n\n        if (Publication.CLOSED == position)\n        {\n            throw new ClusterException(\"publication is closed\");\n        }\n\n        if (Publication.MAX_POSITION_EXCEEDED == position)\n        {\n            throw new ClusterException(\"publication at max position: term-length=\" + publication.termBufferLength());\n        }\n    }\n}\n","sourceCodeStart":205,"sourceCodeEnd":237,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-cluster/src/main/java/io/aeron/cluster/service/ConsensusModuleProxy.java#L205-L237","documentation":"ConsensusModuleProxy.send/checkResult inspects the return code of Publication.offer/tryClaim/scheduleTimer etc. When the result equals Publication.NOT_CONNECTED, meaning no subscribers are currently attached to the consensus module's log/control publication, it throws this ClusterException. It signals that messages cannot currently be delivered to the consensus module.","triggerScenarios":"Calling ConsensusModuleProxy.scheduleTimer, cancelTimer, offer, tryClaim, ack, or closeSession when the underlying publication has no connected subscriber (consensus module not up, crashed, or publication not yet connected).","commonSituations":"ClusteredService calling scheduleTimer during startup before the consensus module subscribes; consensus module restarted while a stale service-side proxy publication remains; service started before the cluster node's consensus module agent.","solutions":["Ensure the consensus module is running and connected before invoking the proxy.","Retry the operation after a short delay; NOT_CONNECTED is often transient during startup/shutdown.","Verify cluster node startup order and that the service is not left over from a previous failed run.","Check archive/recording log consistency if the consensus module repeatedly fails to start."],"exampleFix":"// before\nproxy.scheduleTimer(correlationId, deadlineMs);\n// after\nif (!proxy.scheduleTimer(correlationId, deadlineMs)) {\n    // publication not connected/closed; retry on next cycle\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    proxy.scheduleTimer(correlationId, deadlineMs);\n} catch (ClusterException e) {\n    if (e.getMessage().contains(\"not connected\")) {\n        // retry after backoff; consensus module not yet attached\n    } else {\n        throw e;\n    }\n}","preventionTips":["Sequence service work so proxy calls happen only while the consensus module agent is running.","Check the boolean return of offer/tryClaim-style calls instead of assuming success.","Monitor cluster connectivity counters before issuing control calls."],"tags":["aeron","publication","cluster","connectivity"],"backgroundTag":"connection-refused","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"}