{"record":{"id":"71db00b2f70cc37b","repo":"aeron-io/aeron","slug":"unknown-mds-subscription-registrationid-driverconductor","errorCode":null,"errorMessage":"unknown MDS subscription: {registrationId}","messagePattern":"unknown MDS subscription: (.+?)","errorType":"exception","errorClass":"UnknownSubscriptionException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java","lineNumber":3198,"sourceCode":"            this.registrationId = registrationId;\n            parseChannelResult = nativeResourceAgentProxy.parseChannel(destinationChannel, false);\n        }\n\n        boolean execute()\n        {\n            final UdpChannel udpChannel = parseChannelResult.get();\n            if (null == udpChannel)\n            {\n                return false;\n            }\n\n            final SubscriptionParams params =\n                SubscriptionParams.getSubscriptionParams(udpChannel.channelUri(), ctx, 0);\n            final SubscriptionLink mdsSubscriptionLink = findMdsSubscriptionLink(subscriptionLinks, registrationId);\n\n            if (null == mdsSubscriptionLink)\n            {\n                throw new UnknownSubscriptionException(\"unknown MDS subscription: \" + registrationId);\n            }\n\n            final SpySubscriptionLink subscriptionLink = new SpySubscriptionLink(\n                registrationId,\n                udpChannel,\n                mdsSubscriptionLink.streamId(),\n                mdsSubscriptionLink.aeronClient(),\n                params);\n\n            subscriptionLinks.add(subscriptionLink);\n            clientProxy.operationSucceeded(correlationId);\n\n            for (int i = 0, size = networkPublications.size(); i < size; i++)\n            {\n                final NetworkPublication publication = networkPublications.get(i);\n                if (subscriptionLink.matches(publication) && publication.isAcceptingSubscriptions())\n                {\n                    clientProxy.onAvailableImage(","sourceCodeStart":3180,"sourceCodeEnd":3216,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java#L3180-L3216","documentation":"Thrown when adding a spy destination to a Multi-Destination Subscription (MDS) but no subscription link matching the given registrationId exists in the driver. findMdsSubscriptionLink scanned subscriptionLinks and returned null, so the target MDS subscription is unknown.","triggerScenarios":"Calling addRcvDestination (spy path) or similar with a registrationId that is not an active MDS subscription: wrong id, subscription already closed, or the id belongs to a normal (non-MDS) subscription.","commonSituations":"Using the registrationId returned from a different driver instance; racing a closeSubscription with addRcvDestination from another thread/client; mistaking a publication registrationId for a subscription registrationId.","solutions":["Confirm the registrationId is the one returned by the addSubscription call for the multi-destination subscription in the same running driver.","Check the subscription is still open (not closed) before adding destinations.","Catch UnknownSubscriptionException in the client and re-add the subscription to obtain a fresh registrationId.","Use aeron-stat / driver tooling to list active subscriptions and verify the id."],"exampleFix":"// before\nlong badId = 12345L; // subscription already closed\n// after\nlong mdsId = aeron.addSubscription(\"aeron:udp?control-mode=manual\", streamId); // keep the live id\ndriverProxy.addRcvDestination(mdsId, spyChannel);","handlingStrategy":"validation","validationCode":"boolean known = subscriptionLinks.stream().anyMatch(l -> l.registrationId() == mdsRegistrationId && l.isMds());\nif (!known) { /* re-create subscription before addRcvDestination */ }","typeGuard":null,"tryCatchPattern":"try {\n    driverProxy.addRcvDestination(mdsId, channel);\n} catch (UnknownSubscriptionException e) {\n    mdsId = aeron.addSubscription(uri, streamId);\n    driverProxy.addRcvDestination(mdsId, channel);\n}","preventionTips":["Keep registrationIds in variables returned from addSubscription, never hardcode","Synchronize add/close of destinations with subscription lifecycle","Verify ids with aeron-stat in shared environments"],"tags":["aeron","driver","subscription","mds"],"backgroundTag":"resource-not-found","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"}