{"record":{"id":"5cdd5756b9f17bd7","repo":"aeron-io/aeron","slug":"expected-schemaid-1055-actual-schemaid-5cdd57","errorCode":null,"errorMessage":"expected schemaId=1055, actual=<schemaId>","messagePattern":"expected schemaId=1055, actual=<schemaId>","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"aeron-archive/src/main/java/io/aeron/archive/client/RecordingSubscriptionDescriptorPoller.java","lineNumber":182,"sourceCode":"        this.remainingSubscriptionCount = subscriptionCount;\n        isDispatchComplete = false;\n    }\n\n    @SuppressWarnings(\"MethodLength\")\n    ControlledFragmentAssembler.Action onFragment(\n        final DirectBuffer buffer, final int offset, final int length, final Header header)\n    {\n        if (isDispatchComplete)\n        {\n            return ControlledFragmentAssembler.Action.ABORT;\n        }\n\n        messageHeaderDecoder.wrap(buffer, offset);\n\n        final int schemaId = messageHeaderDecoder.schemaId();\n        if (schemaId != MessageHeaderDecoder.SCHEMA_ID)\n        {\n            throw new ArchiveException(\"expected schemaId=\" + MessageHeaderDecoder.SCHEMA_ID + \", actual=\" + schemaId);\n        }\n\n        final int templateId = messageHeaderDecoder.templateId();\n        switch (templateId)\n        {\n            case ControlResponseDecoder.TEMPLATE_ID:\n                controlResponseDecoder.wrap(\n                    buffer,\n                    offset + MessageHeaderEncoder.ENCODED_LENGTH,\n                    messageHeaderDecoder.blockLength(),\n                    messageHeaderDecoder.version());\n\n                if (controlResponseDecoder.controlSessionId() == controlSessionId)\n                {\n                    final ControlResponseCode code = controlResponseDecoder.code();\n                    final long responseCorrelationId = controlResponseDecoder.correlationId();\n\n                    if (ControlResponseCode.SUBSCRIPTION_UNKNOWN == code && responseCorrelationId == correlationId)","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-archive/src/main/java/io/aeron/archive/client/RecordingSubscriptionDescriptorPoller.java#L164-L200","documentation":"RecordingSubscriptionDescriptorPoller.onFragment checks each fragment's SBE MessageHeader schemaId against MessageHeaderDecoder.SCHEMA_ID (1055) before dispatching on templateId. A mismatch means the fragment is not an Archive control-protocol message and cannot be safely decoded, so ArchiveException is thrown with the actual schemaId.","triggerScenarios":"Fragments on the control subscription used to list recording subscriptions carry a schemaId other than 1055 — codec version mismatch, foreign publisher on the control stream, or wrong stream wiring.","commonSituations":"Upgrading Aeron partially (client new, archive old or vice versa); reusing a control channel also used by an application publisher; custom tooling replaying foreign messages into the stream.","solutions":["Use the same aeron-archive version on archive and client so SBE schema ids match","Dedicate the control channel/stream to archive control traffic","Confirm listRecordingSubscriptions targets the correct archive control channel","Validate no manual offset manipulation occurs before messageHeaderDecoder.wrap"],"exampleFix":"// before: mixed versions\n<dependency io.aeron:aeron-client:1.40.0> + archive 1.44.0\n// after: aligned versions\n<dependency io.aeron:aeron-client:1.44.0> + <dependency io.aeron:aeron-archive:1.44.0>","handlingStrategy":"try-catch","validationCode":"MessageHeaderDecoder hdr = new MessageHeaderDecoder().wrap(buffer, offset);\nassert hdr.schemaId() == MessageHeaderDecoder.SCHEMA_ID : \"schema mismatch: \" + hdr.schemaId();","typeGuard":"boolean isArchiveControlFragment(DirectBuffer buffer, int offset) {\n    return new MessageHeaderDecoder().wrap(buffer, offset).schemaId() == MessageHeaderDecoder.SCHEMA_ID;\n}","tryCatchPattern":"try { poller.poll(); }\ncatch (ArchiveException e) { if (e.getMessage().contains(\"schemaId\")) { log.error(\"codec version mismatch\", e); } }","preventionTips":["Align aeron-archive versions between client and archive","Dedicate the archive control channel to archive traffic only","Log the actual schemaId to identify the foreign schema quickly"],"tags":["sbe","schema","aeron-archive","deserialization"],"backgroundTag":"schema-validation-failed","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"}