{"record":{"id":"11760fa8862de15d","repo":"aeron-io/aeron","slug":"sessionid-sessionidstr-must-reference-a-network-publication","errorCode":null,"errorMessage":"sessionId=<sessionIdStr> must reference a network publication: channel=<channelUri>","messagePattern":"sessionId=<sessionIdStr> must reference a network publication: channel=<channelUri>","errorType":"exception","errorClass":"InvalidChannelException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java","lineNumber":454,"sourceCode":"                {\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\n                    sessionId = publication.sessionId();\n                    mtuLength = publication.mtuLength();\n                    termLength = publication.termBufferLength();\n                }\n            }\n            else\n            {\n                sessionId = parseInt(sessionIdStr, SESSION_ID_PARAM_NAME);\n            }\n        }\n        else\n        {\n            sessionId = driverConductor.nextAvailableSessionId(streamId, canonicalForm);\n        }","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java#L436-L472","documentation":"Same as the IPC case but for network channels: the `session-id=tag:<t>` parameter references a tag for which findNetworkPublicationByTag finds no NetworkPublication, so Aeron throws InvalidChannelException. Tagged session ids must resolve to an existing network publication on the driver.","triggerScenarios":"Adding a UDP publication with `session-id=tag:<t>` where no NetworkPublication with that tag exists — reference created too early, tag belongs to an IPC publication, or the source publication was closed.","commonSituations":"Tag lookup across wrong transport (IPC vs UDP); publication closed by unsubscription/race; mistyped tag value; expecting tags to persist after driver restart (they do not).","solutions":["Create the tagged network publication first, then the referencing one","Verify the tag belongs to a network publication, not an IPC one","Confirm the referenced publication is still open at add time","Use a fixed numeric session-id instead of tag referencing if no shared publication is intended"],"exampleFix":"// before (tag 42 is an IPC publication tag)\naeron.addPublication(\"aeron:udp?endpoint=localhost:40456|session-id=tag:42\", 1001);\n// after\nPublication p = aeron.addPublication(\"aeron:udp?endpoint=localhost:40456|tags=1001,42\", 1001);\nPublication q = aeron.addPublication(\"aeron:udp?endpoint=localhost:40456|session-id=tag:42\", 1001);","handlingStrategy":"validation","validationCode":"NetworkPublication p = driverConductor.findNetworkPublicationByTag(tag);\nif (p == null) throw new IllegalStateException(\"Tagged network publication \" + tag + \" must be created first\");","typeGuard":null,"tryCatchPattern":"try { publication = aeron.addPublication(\"aeron:udp?...|session-id=tag:\" + tag, streamId); }\ncatch (InvalidChannelException e) {\n    if (e.getMessage().contains(\"must reference a network publication\")) {\n        // create or recreate the tagged publication, then retry once\n    } throw e;\n}","preventionTips":["Keep tagged network publications alive as long as dependents exist","Separate tag namespaces for IPC and network publications","Log publication tags at registration for debugging"],"tags":["aeron","udp","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"}