{"record":{"id":"c41ade4497bf4289","repo":"hyperledger/fabric","slug":"failed-creating-a-new-bftchain","errorCode":null,"errorMessage":"failed creating a new BFTChain","messagePattern":"failed creating a new BFTChain","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/consensus/smartbft/consenter.go","lineNumber":238,"sourceCode":"\t\tconfigValidator,\n\t\tuint64(selfID),\n\t\tconfig,\n\t\tpath.Join(c.WALBaseDir, support.ChannelID()),\n\t\tc.ClusterDialer,\n\t\tc.Conf.General.Cluster,\n\t\tc.Comm,\n\t\tc.SignerSerializer,\n\t\tc.GetPolicyManager(support.ChannelID()),\n\t\tsupport,\n\t\tc.Metrics,\n\t\tc.MetricsBFT,\n\t\tc.MetricsWalBFT,\n\t\tc.BCCSP,\n\t\tegressCommFactory,\n\t\t&synchronizerCreator{},\n\t)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed creating a new BFTChain\")\n\t}\n\n\t// refresh cluster service with updated consenters\n\tc.ClusterService.ConfigureNodeCerts(chain.Channel, consenters)\n\tchain.ClusterService = c.ClusterService\n\n\treturn chain, nil\n}\n\nfunc (c *Consenter) IsChannelMember(joinBlock *cb.Block) (bool, error) {\n\tif joinBlock == nil {\n\t\treturn false, errors.New(\"nil block\")\n\t}\n\tenvelopeConfig, err := protoutil.ExtractEnvelope(joinBlock, 0)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tbundle, err := channelconfig.NewBundleFromEnvelope(envelopeConfig, c.BCCSP)","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/consensus/smartbft/consenter.go#L220-L256","documentation":"HandleChain constructs the SmartBFT chain object (chain.New/NewChain) wiring committer, WAL, metrics, BCCSP, egress comm factory and synchronizer. If any of these internal constructors fails, the error is wrapped as 'failed creating a new BFTChain' and the channel cannot start.","triggerScenarios":"NewChain returns an error — typically from WAL creation (unwritable/partially corrupted WAL directory under FileLedger/WAL location), crypto/BCCSP setup, or runtime resource initialization for the channel.","commonSituations":"Disk permission problems or corrupted write-ahead log from an unclean shutdown; ledger data directory migrated or mounted read-only; resource exhaustion preventing goroutine/timer allocation; fabric upgrade leaving WAL entries from an incompatible version.","solutions":["Check the wrapped inner error in the orderer log for the root cause","Fix filesystem permissions on the orderer's ledger/WAL directory (FileLedger location) and ensure it is writable and not full","If the WAL is corrupted, stop the orderer and remove/rebuild the channel's WAL data (or restore the orderer from backup) — ledger data itself may need rejoin via osnadmin","After a version upgrade, verify WAL compatibility or rejoin the node to the channel with the latest config block"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check prerequisites before starting the chain\nif err := checkDirWritable(ledgerPath + \"/chains/\" + channelID); err != nil {\n    return fmt.Errorf(\"WAL/ledger path not writable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"chain, err := newChain(...)\nif err != nil {\n    if strings.Contains(err.Error(), \"WAL\") || errors.Is(err, os.ErrPermission) {\n        // storage problem: fix permissions/disk, optionally rebuild WAL from ledger\n        return repairStorageAndRejoin(channelID)\n    }\n    return fmt.Errorf(\"failed creating a new BFTChain: %w\", err)\n}","preventionTips":["Monitor disk space and permissions on orderer ledger volumes","Shut down orderers cleanly to avoid WAL corruption","Back up the orderer data directory before upgrades","After failed starts, read the wrapped inner error before touching storage"],"tags":["fabric","smartbft","wal","storage","consensus"],"backgroundTag":"chain-init-failed","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"}