{"record":{"id":"3dabb1fafade8453","repo":"aeron-io/aeron","slug":"sessionid-sessionidstr-must-reference-an-ipc-publication","errorCode":null,"errorMessage":"sessionId=<sessionIdStr> must reference an IPC publication: channel=<channelUri>","messagePattern":"sessionId=<sessionIdStr> must reference an IPC publication: channel=<channelUri>","errorType":"exception","errorClass":"InvalidChannelException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java","lineNumber":440,"sourceCode":"            if (isSessionIdTagged)\n            {\n                final long tag;\n                try\n                {\n                    tag = ChannelUri.getTag(sessionIdStr);\n                }\n                catch (final RuntimeException ex)\n                {\n                    throw new InvalidChannelException(\n                        SESSION_ID_PARAM_NAME + \"=\" + sessionIdStr + \" has an invalid tag: channel=\" + channelUri, ex);\n                }\n\n                if (channelUri.isIpc())\n                {\n                    final IpcPublication publication = driverConductor.findIpcPublicationByTag(tag);\n                    if (null == publication)\n                    {\n                        throw new InvalidChannelException(\n                            SESSION_ID_PARAM_NAME + \"=\" + sessionIdStr + \" must reference an IPC publication: \" +\n                            \"channel=\" + channelUri);\n                    }\n\n                    sessionId = publication.sessionId();\n                    mtuLength = publication.mtuLength();\n                    termLength = publication.termBufferLength();\n                }\n                else\n                {\n                    final NetworkPublication publication = driverConductor.findNetworkPublicationByTag(tag);\n                    if (null == publication)\n                    {\n                        throw new InvalidChannelException(\n                            SESSION_ID_PARAM_NAME + \"=\" + sessionIdStr + \" must reference a network publication: \" +\n                            \"channel=\" + channelUri);\n                    }\n","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java#L422-L458","documentation":"The `session-id` URI parameter referenced a well-formed tag, but on an IPC channel no existing IpcPublication with that tag exists in the driver conductor. Aeron throws InvalidChannelException because tagged session ids must point at an already-created publication to reuse its session id, MTU, and other params.","triggerScenarios":"Adding an IPC publication with `session-id=tag:<t>` where findIpcPublicationByTag returns null — the referenced publication was never created, was closed, or the tag belongs to a network (not IPC) publication.","commonSituations":"Ordering bugs: subscriber/publication with tag reference added before the tagged publication is created; the source publication was closed; tag typo; referencing a UDP publication's tag from an IPC (aeron:ipc) channel.","solutions":["Create the tagged IPC publication before adding the channel that references its tag","Confirm the tag matches the existing IPC publication's tag (check its registration output)","Check for premature close of the referenced publication","If the target is a network publication, use a aeron:udp channel instead of aeron:ipc"],"exampleFix":"// before (no IPC publication with tag 42 exists)\naeron.addPublication(\"aeron:ipc|session-id=tag:42\", 1001);\n// after\nPublication p = aeron.addPublication(\"aeron:ipc|tags=1001,42\", 1001);\nPublication q = aeron.addPublication(\"aeron:ipc|session-id=tag:42\", 1001);","handlingStrategy":"validation","validationCode":"IpcPublication p = driverConductor.findIpcPublicationByTag(tag);\nif (p == null) throw new IllegalStateException(\"Tagged IPC publication \" + tag + \" must be created first\");","typeGuard":null,"tryCatchPattern":"try { publication = aeron.addPublication(\"aeron:ipc|session-id=tag:\" + tag, streamId); }\ncatch (InvalidChannelException e) {\n    if (e.getMessage().contains(\"must reference an IPC publication\")) {\n        // create the tagged publication first, then retry\n    } throw e;\n}","preventionTips":["Enforce creation order: tagged publication before referencing publications","Track referenced publication lifecycles and close dependents together","Do not reuse network tags on IPC channels"],"tags":["aeron","ipc","tag","session-id"],"backgroundTag":"entity-not-found","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}