{"record":{"id":"58f12eaab453cb84","repo":"hyperledger/fabric","slug":"ledgerid-s-does-not-exist","errorCode":null,"errorMessage":"ledgerID [%s] does not exist","messagePattern":"ledgerID \\[(.+?)\\] does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/ledger/blkstorage/rollback.go","lineNumber":255,"sourceCode":"\tconf := &Conf{blockStorageDir: blockStorageDir}\n\tledgerDir := conf.getLedgerBlockDir(ledgerID)\n\tif err := validateLedgerID(ledgerDir, ledgerID); err != nil {\n\t\treturn err\n\t}\n\tif err := validateTargetBlkNum(ledgerDir, targetBlockNum); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc validateLedgerID(ledgerDir, ledgerID string) error {\n\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":237,"sourceCodeEnd":272,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/ledger/blkstorage/rollback.go#L237-L272","documentation":"Returned by validateLedgerID during rollback-parameter validation when the block-storage directory for the given ledgerID does not exist on disk. The rollback command targeted a ledger (channel) that this peer/orderer does not maintain.","triggerScenarios":"Thrown at common/ledger/blkstorage/rollback.go:255 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the ledger/channel ID and the peer's fileSystemPath","List available ledgers under filesystemPath/ledgers to find the correct ID"],"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"}