{"record":{"id":"ab89fdc0a0c143e5","repo":"apache/pulsar","slug":"unable-to-convert-digest-type-digesttype","errorCode":null,"errorMessage":"Unable to convert digest type ${digestType}","messagePattern":"Unable to convert digest type (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/OffloadIndexBlockImpl.java","lineNumber":261,"sourceCode":"\n        @Override\n        public long getLength() {\n            return this.length;\n        }\n\n        @Override\n        public DigestType getDigestType() {\n            switch (this.digestType) {\n                case HMAC:\n                    return DigestType.MAC;\n                case CRC32:\n                    return DigestType.CRC32;\n                case CRC32C:\n                    return DigestType.CRC32C;\n                case DUMMY:\n                    return DigestType.DUMMY;\n                default:\n                    throw new IllegalArgumentException(\"Unable to convert digest type \" + digestType);\n            }\n        }\n\n        @Override\n        public long getCtime() {\n            return this.ctime;\n        }\n\n        @Override\n        public boolean isClosed() {\n            return this.state == State.CLOSED;\n        }\n\n        @Override\n        public Map<String, byte[]> getCustomMetadata() {\n            return this.customMetadata;\n        }\n","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/OffloadIndexBlockImpl.java#L243-L279","documentation":"When building an OffloadIndexBlock from LedgerMetadata, the builder converts the ledger digest type (BookKeeper DigestType) to the protocol-level DigestType for serialization. An unrecognized enum value hits the default branch and throws IllegalArgumentException('Unable to convert digest type ...'), meaning the offload code does not support that digest type.","triggerScenarios":"Offloading a ledger whose LedgerMetadata digest type is not CRC32, CRC32C, or DUMMY — e.g. MAC/HMAC digest ledgers or a newer BookKeeper digest type added after this offload implementation was written.","commonSituations":"Brokers configured with digestType=MAC (or a newer digest) attempting tiered storage offload; upgrading BookKeeper to add a digest type while the jcloud offload module is older; misconfigured bookkeeper.conf digest type.","solutions":["Reconfigure the ledger digest type to a supported value (CRC32, CRC32C, or DUMMY) and write new ledgers, then offload those","Upgrade the Pulsar/BookKeeper jcloud offload module to a version supporting the digest type in use","Prevent offload for unsupported-digest ledgers (e.g. exclude them from offload policies)","Check bookkeeper digests enabled on the cluster and align with the offload module's supported set"],"exampleFix":"// before: offloading a MAC-digest ledger\nbroker.conf: managedLedgerMaxEntriesPerLedger=... digestType=MAC\n// after: use a supported digest for offloadable ledgers\ndigestType=CRC32C","handlingStrategy":"validation","validationCode":"DigestType dt = ledgerMetadata.getDigestType();\nSet<DigestType> supported = Set.of(DigestType.CRC32, DigestType.CRC32C, DigestType.DUMMY);\nif (!supported.contains(dt)) {\n    throw new IllegalArgumentException(\"Digest type not offloadable: \" + dt);\n}","typeGuard":null,"tryCatchPattern":"try {\n    OffloadIndexBlock idx = builder.withLedgerMetadata(meta, ctime).build();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unable to convert digest type\")) {\n        // exclude this ledger from offload or change digest type\n    } else { throw e; }\n}","preventionTips":["Configure broker/bookkeeper digestType to CRC32/CRC32C/DUMMY where offload is used","Align digest support when upgrading BookKeeper while keeping the jcloud offload module","Filter unsupported-digest ledgers out of offload policies","Verify digest config in bookkeeper.conf before enabling tiered storage"],"tags":["configuration","digest-type","unsupported-feature","tiered-storage"],"backgroundTag":"unsupported-digest-type","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}