hyperledger/fabric · error

bad config metadata option ViewChangeResendInterval

Error message

bad config metadata option ViewChangeResendInterval

What it means

ConfigFromMetadataOptions parses duration strings from the BFT consensus metadata options embedded in the orderer config block. This error wraps a time.ParseDuration failure for the ViewChangeResendInterval option, meaning the value in the block's consensus metadata is not a valid Go duration string (e.g. '10s', '1m'). The block is rejected so the chain never starts or applies invalid timing configuration.

Source

Thrown at orderer/consensus/smartbft/util/util.go:44

	config.RequestBatchMaxCount = options.RequestBatchMaxCount
	config.RequestBatchMaxBytes = options.RequestBatchMaxBytes
	if config.RequestBatchMaxInterval, err = time.ParseDuration(options.RequestBatchMaxInterval); err != nil {
		return config, errors.Wrap(err, "bad config metadata option RequestBatchMaxInterval")
	}
	config.IncomingMessageBufferSize = options.IncomingMessageBufferSize
	config.RequestPoolSize = options.RequestPoolSize
	if config.RequestForwardTimeout, err = time.ParseDuration(options.RequestForwardTimeout); err != nil {
		return config, errors.Wrap(err, "bad config metadata option RequestForwardTimeout")
	}
	if config.RequestComplainTimeout, err = time.ParseDuration(options.RequestComplainTimeout); err != nil {
		return config, errors.Wrap(err, "bad config metadata option RequestComplainTimeout")
	}
	if config.RequestAutoRemoveTimeout, err = time.ParseDuration(options.RequestAutoRemoveTimeout); err != nil {
		return config, errors.Wrap(err, "bad config metadata option RequestAutoRemoveTimeout")
	}
	if config.ViewChangeResendInterval, err = time.ParseDuration(options.ViewChangeResendInterval); err != nil {
		return config, errors.Wrap(err, "bad config metadata option ViewChangeResendInterval")
	}
	if config.ViewChangeTimeout, err = time.ParseDuration(options.ViewChangeTimeout); err != nil {
		return config, errors.Wrap(err, "bad config metadata option ViewChangeTimeout")
	}
	if config.LeaderHeartbeatTimeout, err = time.ParseDuration(options.LeaderHeartbeatTimeout); err != nil {
		return config, errors.Wrap(err, "bad config metadata option LeaderHeartbeatTimeout")
	}
	config.LeaderHeartbeatCount = options.LeaderHeartbeatCount
	if config.CollectTimeout, err = time.ParseDuration(options.CollectTimeout); err != nil {
		return config, errors.Wrap(err, "bad config metadata option CollectTimeout")
	}
	config.SyncOnStart = options.SyncOnStart
	config.SpeedUpViewChange = options.SpeedUpViewChange

	if options.LeaderRotation != smartbft.Options_ROTATION_ON {
		config.LeaderRotation = false
		config.DecisionsPerLeader = 0
	} else {

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Fix ViewChangeResendInterval in the channel's consensus metadata options to a valid Go duration string, e.g. "10s"
  2. Regenerate the config block from a correct config.yaml so the option is populated
  3. Run the `orderer genesis inspect` tool on the offending block to confirm which option fails parsing
  4. Verify channel config update tooling (configtxgen / configtxlator) emits duration strings, not integers

Example fix

// before (consensus metadata)
"ViewChangeResendInterval": 10
// after
"ViewChangeResendInterval": "10s"
Defensive patterns

Strategy: validation

Validate before calling

func validDuration(s string) error { _, err := time.ParseDuration(s); return err }
if err := validDuration(opts.ViewChangeResendInterval); err != nil { return fmt.Errorf("ViewChangeResendInterval invalid: %w", err) }

Try / catch

cfg, err := util.ConfigFromMetadataOptions(selfID, opts)
if err != nil { return fmt.Errorf("aborting chain start, BFT options invalid: %w", err) }

Prevention

When it happens

Trigger: Orderer start (HandleChain), channel creation/update processing (configBlockToBFTConfig), or the `inspect` CLI run when the consensus metadata option ViewChangeResendInterval is missing, empty, or not a valid duration (e.g. '10', 'ten-seconds', '10sec').

Common situations: Hand-edited or generated config block where the option was written as a bare number of seconds, YAML value not quoted properly, empty string from a templating tool, or metadata produced by an older/newer tooling version that renamed or dropped the field.

Understand the failure class

Background: "invalid duration" / "failed to parse duration": why your timeout, interval, or TTL string is rejected and which formats each library accepts — this error's family across 32 libraries.

Related errors


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