{"record":{"id":"7c34633b4bad5a66","repo":"hyperledger/fabric","slug":"target-block-number-d-should-be-less-than-the-b","errorCode":null,"errorMessage":"target block number [%d] should be less than the biggest block number [%d]","messagePattern":"target block number \\[(.+?)\\] should be less than the biggest block number \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/ledger/blkstorage/rollback.go","lineNumber":267,"sourceCode":"\tlogger.Debugf(\"Validating the existence of ledgerID [%s]\", ledgerID)\n\texists, err := fileutil.DirExists(ledgerDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !exists {\n\t\treturn errors.Errorf(\"ledgerID [%s] does not exist\", ledgerID)\n\t}\n\treturn nil\n}\n\nfunc validateTargetBlkNum(ledgerDir string, targetBlockNum uint64) error {\n\tlogger.Debugf(\"Validating the given block number [%d] against the ledger block height\", targetBlockNum)\n\tblkfilesInfo, err := constructBlockfilesInfo(ledgerDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif blkfilesInfo.lastPersistedBlock <= targetBlockNum {\n\t\treturn errors.Errorf(\"target block number [%d] should be less than the biggest block number [%d]\",\n\t\t\ttargetBlockNum, blkfilesInfo.lastPersistedBlock)\n\t}\n\treturn nil\n}\n","sourceCodeStart":249,"sourceCodeEnd":272,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/ledger/blkstorage/rollback.go#L249-L272","documentation":"Returned by validateTargetBlkNum when the requested rollback target block number is >= the last persisted block. A rollback must remove at least one block, so a target at or beyond the current height is rejected as a no-op/invalid request.","triggerScenarios":"Thrown at common/ledger/blkstorage/rollback.go:267 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a target block number strictly less than the current last persisted block","Check current block height and rerun rollback with a valid target"],"exampleFix":null,"handlingStrategy":"validation","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"}