{"record":{"id":"62df853be9514627","repo":"aeron-io/aeron","slug":"publication-is-not-connected-snapshottaker","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/SnapshotTaker.java","lineNumber":186,"sourceCode":"    protected static void checkInterruptStatus()\n    {\n        if (Thread.currentThread().isInterrupted())\n        {\n            throw new AgentTerminationException(\"interrupted\");\n        }\n    }\n\n    /**\n     * Check the result of offering to a publication when writing a snapshot.\n     *\n     * @param position    of an offer or try claim to a publication.\n     * @param publication on which the offer or try claim was attempted.\n     */\n    protected 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    /**\n     * Check the result of offering to a publication when writing a snapshot and then idle after invoking the client\n     * agent if necessary.\n     *\n     * @param position of an offer or try claim to a publication.","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-cluster/src/main/java/io/aeron/cluster/service/SnapshotTaker.java#L168-L204","documentation":"SnapshotTaker.checkResult inspects the result of Publication.offer/tryClaim when writing a snapshot. A result equal to Publication.NOT_CONNECTED means the snapshot publication has no connected subscribers (no consensus module/image is consuming it), so the snapshot data cannot be delivered. The taker throws a ClusterException instead of silently dropping snapshot content.","triggerScenarios":"checkResultAndIdle is called after offer/tryClaim returned Publication.NOT_CONNECTED — the snapshot publication's channel has no active subscriber (e.g. consensus module already closed or channel URI wrong).","commonSituations":"Taking a snapshot after the consensus module shut down its subscription, misconfigured snapshot channel endpoint in the cluster config, or network partition between cluster members during snapshot transfer.","solutions":["Ensure the consensus module is running and subscribed to the snapshot channel before triggering a snapshot","Verify aeron.cluster.snapshot.channel / stream-id configuration matches on both sides","Check network connectivity and endpoints between container and consensus module","Retry the snapshot after the publication connects (subscriber registered)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Before triggering a snapshot, confirm the consensus module subscription exists\nif (!consensusModuleProxy.isSnapshotChannelConnected()) { waitForSnapshotSubscriber(); }","typeGuard":null,"tryCatchPattern":"try { snapshotTaker.snapshot(...); } catch (ClusterException e) { rescheduleSnapshotAfterReconnect(); }","preventionTips":["Check channel endpoint/stream-id match between container and consensus module configs","Trigger snapshots only while the cluster is fully connected","Monitor publication connection status before writing"],"tags":["aeron-cluster","snapshot","publication","network"],"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"}