{"record":{"id":"855327b10beaf68b","repo":"aeron-io/aeron","slug":"expected-schemaid-1055-actual-schemaid","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/RecordingSignalPoller.java","lineNumber":250,"sourceCode":"    public String errorMessage()\n    {\n        return errorMessage;\n    }\n\n    ControlledFragmentHandler.Action onFragment(\n        final DirectBuffer buffer, final int offset, final int length, final Header header)\n    {\n        if (isPollComplete)\n        {\n            return ControlledFragmentHandler.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\n        if (ControlResponseDecoder.TEMPLATE_ID == templateId)\n        {\n            controlResponseDecoder.wrap(\n                buffer,\n                offset + MessageHeaderEncoder.ENCODED_LENGTH,\n                messageHeaderDecoder.blockLength(),\n                messageHeaderDecoder.version());\n\n            if (controlResponseDecoder.controlSessionId() == controlSessionId)\n            {\n                this.templateId = templateId;\n                correlationId = controlResponseDecoder.correlationId();\n                relevantId = controlResponseDecoder.relevantId();\n                code = controlResponseDecoder.code();","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-archive/src/main/java/io/aeron/archive/client/RecordingSignalPoller.java#L232-L268","documentation":"RecordingSignalPoller.onFragment validates each fragment's SBE MessageHeader schemaId against MessageHeaderDecoder.SCHEMA_ID (1055). A differing schemaId means the message does not conform to the Aeron Archive control schema, so the poller refuses to decode and throws ArchiveException including the actual id received.","triggerScenarios":"The archive control subscription receives a fragment whose schemaId differs from 1055 — wrong schema generation on the sending side, non-archive traffic on the control stream, or a corrupted frame header.","commonSituations":"Sender built with a different aeron-archive-codecs version; archive replaced by another service publishing on the same channel/stream; byte corruption or wrong offset injection in custom transport plumbing.","solutions":["Align aeron-archive-codecs versions between client and archive so schemaId=1055 matches","Confirm the control subscription points at the real archive control channel/stream","Check for custom code writing to the control publication with a different schema","Verify fragments are passed with the original offset and length from the fragment handler"],"exampleFix":"// before\ndirectPoller.poll(fragmentHandler); // shared channel with foreign messages\n// after\nRecordingSignalPoller poller = new RecordingSignalPoller(ctx, subscription, fragmentHandlerLimit);","handlingStrategy":"try-catch","validationCode":"MessageHeaderDecoder hdr = new MessageHeaderDecoder().wrap(buffer, offset);\nif (hdr.schemaId() != MessageHeaderDecoder.SCHEMA_ID) throw new IllegalStateException(\"bad schemaId \" + hdr.schemaId());","typeGuard":"boolean hasArchiveSchema(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(\"expected schemaId=\")) { reconnectWithMatchingCodecs(); } }","preventionTips":["Pin the same aeron-archive version in all services","Keep control streams free of non-archive publishers","Test cross-version compatibility in CI before upgrading"],"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"}