{"record":{"id":"a80b3e61152e74bd","repo":"aeron-io/aeron","slug":"expected-schemaid-recordingdescriptorpoller","errorCode":null,"errorMessage":"expected schemaId=","messagePattern":"expected schemaId=","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"aeron-archive/src/main/java/io/aeron/archive/client/RecordingDescriptorPoller.java","lineNumber":176,"sourceCode":"        this.remainingRecordCount = recordCount;\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.RECORDING_UNKNOWN == code && responseCorrelationId == correlationId)","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-archive/src/main/java/io/aeron/archive/client/RecordingDescriptorPoller.java#L158-L194","documentation":"RecordingDescriptorPoller.onFragment wraps the incoming SBE buffer in a MessageHeaderDecoder and verifies the SBE schemaId matches the archive protocol schema. A mismatch means the fragment is not an archive control-protocol message (wrong channel, corrupted frame, or a different SBE schema version), so ArchiveException('expected schemaId=..., actual=...') is thrown.","triggerScenarios":"A fragment arrives on the subscription used by RecordingDescriptorPoller whose header schemaId differs from MessageHeaderDecoder.SCHEMA_ID — e.g. the poller was pointed at a channel carrying non-archive data, or client/server archive SBE schema versions differ.","commonSituations":"Subscribing the descriptor poller to the wrong stream/channel; mixing Aeron client and archive versions (protocol schema changed between releases); garbage from a misconfigured shared endpoint.","solutions":["Use matching Aeron Archive client and server versions (same SBE schema).","Point the poller's subscription at the archive control response channel/stream it was designed for.","Verify the stream is not shared with other publishers sending non-archive messages."],"exampleFix":"// before\n// poller subscribed to a stream fed by a different Aeron Archive version\narchive.listRecording(subscription, poller, recordingId); // ArchiveException: expected schemaId=...\n\n// after\n// align versions in pom.xml\n// <dependency><artifactId>aeron-archive</artifactId><version>X.Y.Z</version></dependency>\n// <dependency><artifactId>aeron-driver</artifactId><version>X.Y.Z</version></dependency>","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    archive.listRecording(recordingId, recordingDescriptorPoller);\n} catch (ArchiveException e) {\n    if (e.getMessage().startsWith(\"expected schemaId=\")) {\n        // wrong stream content or schema version mismatch: reconnect/upgrade\n    }\n}","preventionTips":["Pin aeron-archive and aeron-driver to the same release version.","Do not share the archive control response stream with other publishers."],"tags":["aeron-archive","sbe","protocol-mismatch"],"backgroundTag":"unexpected-response-shape","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"}