{"record":{"id":"d3cb7cd0680698ff","repo":"hyperledger/fabric","slug":"unexpected-error-while-unmarshalling-bytes-v-i","errorCode":null,"errorMessage":"unexpected error while unmarshalling bytes [%#v] into TxIDIndexValProto","messagePattern":"unexpected error while unmarshalling bytes \\[%#v\\] into TxIDIndexValProto","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/ledger/blkstorage/blockindex.go","lineNumber":264,"sourceCode":"\tif err != nil {\n\t\treturn nil, 0, errors.WithMessagef(err, \"error while trying to retrieve transaction info by TXID [%s]\", txID)\n\t}\n\tdefer itr.Release()\n\n\tpresent := itr.Next()\n\tif err := itr.Error(); err != nil {\n\t\treturn nil, 0, errors.Wrapf(err, \"error while trying to retrieve transaction info by TXID [%s]\", txID)\n\t}\n\tif !present {\n\t\treturn nil, 0, errors.Errorf(\"no such transaction ID [%s] in index\", txID)\n\t}\n\tvalBytes := itr.Value()\n\tif len(valBytes) == 0 {\n\t\treturn nil, 0, errNilValue\n\t}\n\tval := &TxIDIndexValue{}\n\tif err := proto.Unmarshal(valBytes, val); err != nil {\n\t\treturn nil, 0, errors.Wrapf(err, \"unexpected error while unmarshalling bytes [%#v] into TxIDIndexValProto\", valBytes)\n\t}\n\tblockNum, err := retrieveBlockNum(itr.Key(), len(rangeScan.startKey))\n\tif err != nil {\n\t\treturn nil, 0, errors.WithMessage(err, \"error while decoding block number from txID index key\")\n\t}\n\treturn val, blockNum, nil\n}\n\nfunc (index *blockIndex) getTXLocByBlockNumTranNum(blockNum uint64, tranNum uint64) (*fileLocPointer, error) {\n\tif !index.isAttributeIndexed(IndexableAttrBlockNumTranNum) {\n\t\treturn nil, errors.New(\"<blockNumber, transactionNumber> tuple not maintained in index\")\n\t}\n\tb, err := index.db.Get(constructBlockNumTranNumKey(blockNum, tranNum))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif b == nil {\n\t\treturn nil, errors.Errorf(\"no such blockNumber, transactionNumber <%d, %d> in index\", blockNum, tranNum)","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/ledger/blkstorage/blockindex.go#L246-L282","documentation":"Returned by blockIndex.getTxIDVal when the raw value bytes retrieved from the TXID index cannot be proto-unmarshaled into TxIDIndexValue. It indicates index corruption or an on-disk format mismatch, and dumps the offending bytes for diagnosis.","triggerScenarios":"Thrown at common/ledger/blkstorage/blockindex.go:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Drop and rebuild the block index (deleteIndexEntries / re-sync on restart)","Investigate disk-level corruption of the LevelDB index files"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}