{"record":{"id":"54d3d74f7654619f","repo":"hyperledger/fabric","slug":"error-while-trying-to-retrieve-transaction-info-by","errorCode":null,"errorMessage":"error while trying to retrieve transaction info by TXID [%s]","messagePattern":"error while trying to retrieve transaction info by TXID \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/ledger/blkstorage/blockindex.go","lineNumber":253,"sourceCode":"\t\treturn false, errors.Wrapf(err, \"error while trying to check the presence of TXID [%s]\", txID)\n\t}\n\treturn present, nil\n}\n\nfunc (index *blockIndex) getTxIDVal(txID string) (*TxIDIndexValue, uint64, error) {\n\tif !index.isAttributeIndexed(IndexableAttrTxID) {\n\t\treturn nil, 0, errors.New(\"transaction IDs not maintained in index\")\n\t}\n\trangeScan := constructTxIDRangeScan(txID)\n\titr, err := index.db.GetIterator(rangeScan.startKey, rangeScan.stopKey)\n\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}","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/ledger/blkstorage/blockindex.go#L235-L271","documentation":"Returned by blockIndex.getTxIDVal when the levelDB range-scan iterator over the TXID index cannot be created. The database itself errored (not merely a missing key), and the failing TXID is included in the wrapped message.","triggerScenarios":"Thrown at common/ledger/blkstorage/blockindex.go:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check peer logs for LevelDB/FS errors and repair the index directory","Restart the peer to release locks; rebuild the index if corruption persists"],"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-08T15:18:49.778Z"}