hyperledger/fabric · error

failed parsing smartbft configuration

Error message

failed parsing smartbft configuration

What it means

HandleChain parses the SmartBFT metadata options (from the channel config block's ConsensusMetadata) via util.ConfigFromMetadataOptions to build the SmartBFT-Go runtime config. If that parsing/validation fails, the error is wrapped as 'failed parsing smartbft configuration' and the chain fails to start.

Source

Thrown at orderer/consensus/smartbft/consenter.go:192

}

// HandleChain returns a new Chain instance or an error upon failure
func (c *Consenter) HandleChain(support consensus.ConsenterSupport, metadata *cb.Metadata) (consensus.Chain, error) {
	consenters := support.SharedConfig().Consenters()
	configOptions, err := createSmartBftConfig(support.SharedConfig())
	if err != nil {
		return nil, err
	}

	selfID, err := c.detectSelfID(consenters)
	if err != nil {
		return nil, errors.Wrap(err, "without a system channel, a follower should have been created")
	}
	c.Logger.Infof("Local consenter id is %d", selfID)

	config, err := util.ConfigFromMetadataOptions(uint64(selfID), configOptions)
	if err != nil {
		return nil, errors.Wrap(err, "failed parsing smartbft configuration")
	}
	c.Logger.Debugf("SmartBFT-Go config: %+v", config)

	configValidator := &ConfigBlockValidator{
		ValidatingChannel:    support.ChannelID(),
		Filters:              c.Registrar,
		ConfigUpdateProposer: c.Registrar,
		Logger:               c.Logger,
	}

	egressCommFactory := func(runtimeConfig *atomic.Value, channelId string, comm cluster.Communicator) EgressComm {
		channelDecorator := zap.String("channel", channelId)
		return &Egress{
			RuntimeConfig: runtimeConfig,
			Channel:       channelId,
			Logger:        flogging.MustGetLogger("orderer.consensus.smartbft.egress").With(channelDecorator),
			RPC: &cluster.RPC{
				Logger:        flogging.MustGetLogger("orderer.consensus.smartbft.rpc").With(channelDecorator),

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Regenerate the channel genesis/config block with configtxgen and correct SmartBFT Options in configtx.yaml (ensure RequestMaxBytes <= BatchSize.MaxMessageCount-compatible limits)
  2. Inspect the wrapped inner error from ConfigFromMetadataOptions in the logs for the exact violated constraint
  3. Validate the profile's Consensus section against the fabric version you run; upgrade configtxgen if the metadata format changed
  4. Re-create the channel (or submit a config update fixing the Options) with valid consensus metadata

Example fix

// before (configtx.yaml)
ConsenterMapping: ...
Options:
  RequestBatchMaxBytes: 10MB   # larger than block batch max

// after
Options:
  RequestBatchMaxBytes: 1MB    # must fit within BlockBatch limits
Defensive patterns

Strategy: validation

Validate before calling

// Validate SmartBFT options before channel creation
if cfg.Options.RequestBatchMaxBytes > cfg.BatchSizeAbsoluteMaxBytes {
    return errors.New("RequestBatchMaxBytes exceeds block batch limits; fix configtx.yaml Options")
}
// And sanity-check the generated genesis block's consensus metadata decodes
var md consensus.Metadata
if err := proto.Unmarshal(genesisBlock.Metadata, &md); err != nil {
    return err
}

Prevention

When it happens

Trigger: The channel config block contains a ConsensusMetadata whose options (e.g. request batch max bytes exceeding block batch size, malformed/invalid smartbft options) violate ConfigFromMetadataOptions invariants, or the metadata is missing/corrupted in the genesis/join block.

Common situations: Channel created with configtxgen output where SmartBFT Options were misconfigured (RequestBatchMaxBytes > BlockBatchMaxBytes); a config block edited by hand corrupting consensus metadata; mixing fabric versions where the metadata schema changed; joining with a truncated config block.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/64a0ab796f7036b9. Report an issue: GitHub.