{"record":{"id":"a099bb78b96a5c00","repo":"hyperledger/fabric","slug":"cannot-get-ledger-height","errorCode":null,"errorMessage":"cannot get ledger height","messagePattern":"cannot get ledger height","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/deliverservice/deliveryclient.go","lineNumber":168,"sourceCode":"\tif !d.conf.DeliverServiceConfig.BlockGossipEnabled {\n\t\tlogger.Infow(\"This peer will retrieve blocks from ordering service (will not disseminate them to other peers in the organization)\", \"channel\", chainID)\n\t} else {\n\t\tlogger.Infow(\"This peer will retrieve blocks from ordering service and disseminate to other peers in the organization\", \"channel\", chainID)\n\t}\n\n\td.channelID = chainID\n\n\tgo func() {\n\t\td.blockDeliverer.DeliverBlocks()\n\t\tfinalizer()\n\t}()\n\treturn nil\n}\n\nfunc (d *deliverServiceImpl) createBlockDelivererCFT(chainID string, ledgerInfo blocksprovider.LedgerInfo) (*blocksprovider.Deliverer, error) {\n\theight, err := ledgerInfo.LedgerHeight()\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"cannot get ledger height\")\n\t}\n\tcurrentBlockHash, err := ledgerInfo.GetCurrentBlockHash()\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"cannot get current block hash\")\n\t}\n\tif height == 0 {\n\t\treturn nil, errors.New(\"cannot create a block deliverer because height=0\")\n\t}\n\tubv, err := deliverclient.NewBlockVerificationAssistantFromConfig(\n\t\td.conf.ChannelConfig, height-1, currentBlockHash, chainID, d.conf.CryptoProvider, flogging.MustGetLogger(\"common.deliverclient.blockverification\"),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogger.Debugf(\"Created an updatable block verifier from ChannelConfig, height: %d,`%+v`\", height, ubv)\n\n\tlogger.Infof(\"Creating a CFT (crash fault tolerant) BlockDeliverer for channel `%s`\", chainID)\n\tdc := &blocksprovider.Deliverer{","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/deliverservice/deliveryclient.go#L150-L186","documentation":"Returned by createBlockDelivererCFT when LedgerInfo.LedgerHeight() fails while provisioning the CFT block deliverer. The starting seek height is mandatory for resuming delivery, so a ledger-height query failure aborts deliverer creation.","triggerScenarios":"Thrown at core/deliverservice/deliveryclient.go:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check ledger/blkstorage health and retry joining or starting delivery","Inspect the wrapped error for the underlying ledger failure"],"exampleFix":null,"handlingStrategy":"retry","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"}