hyperledger/fabric · error

failed to parse config

Error message

failed to parse config

What it means

MaintenanceFilter.inspect wraps errors from channelconfig.NewBundle (parsing the proposed next config into a valid bundle) with "failed to parse config". It means the resulting Config structure inside the envelope is invalid: bad channel ID, missing required groups/values, unmarshalable values, or failing validation of some config value.

Source

Thrown at orderer/common/msgprocessor/maintenancefilter.go:86

		"ConsensusState", ordererConf.ConsensusState(), "channel", chanHdr.ChannelId)
	err = mf.inspect(configEnvelope, ordererConf)
	if err != nil {
		return errors.Wrap(err, "config transaction inspection failed")
	}

	return nil
}

// inspect checks whether the next orderer config, extracted from the incoming configEnvelope, respects the
// transition rules of consensus-type migration using maintenance-mode.
func (mf *MaintenanceFilter) inspect(configEnvelope *cb.ConfigEnvelope, ordererConfig channelconfig.Orderer) error {
	if configEnvelope.LastUpdate == nil {
		return errors.Errorf("updated config does not include a config update")
	}

	bundle, err := channelconfig.NewBundle(mf.support.ChannelID(), configEnvelope.Config, mf.bccsp)
	if err != nil {
		return errors.Wrap(err, "failed to parse config")
	}

	nextOrdererConfig, ok := bundle.OrdererConfig()
	if !ok {
		return errors.New("next config is missing orderer group")
	}

	if !ordererConfig.Capabilities().ConsensusTypeMigration() {
		if nextState := nextOrdererConfig.ConsensusState(); nextState != orderer.ConsensusType_STATE_NORMAL {
			return errors.Errorf("next config attempted to change ConsensusType.State to %s, but capability is disabled", nextState)
		}
		if ordererConfig.ConsensusType() != nextOrdererConfig.ConsensusType() {
			return errors.Errorf("next config attempted to change ConsensusType.Type from %s to %s, but capability is disabled",
				ordererConfig.ConsensusType(), nextOrdererConfig.ConsensusType())
		}
		return nil
	}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Inspect the wrapped cause for the exact parse/validation failure
  2. Regenerate the config update with configtxgen/configtxlator instead of hand-editing the marshalled config
  3. Validate the proposed config locally by running channelconfig.NewBundle (or configtxlator proto_decode) before submission
  4. Ensure ConsensusMetadata is a valid etcdraft.ConfigMetadata or smartbft.Options proto as appropriate
Defensive patterns

Strategy: validation

Validate before calling

if err := channelconfig.NewBundle(chID, nextConfig, bccsp); err != nil {
	return fmt.Errorf("next config invalid: %w", err)
}

Try / catch

err := filter.Apply(env)
var cause error
for cause = err; errors.Unwrap(cause) != nil; cause = errors.Unwrap(cause) {}
if strings.Contains(err.Error(), "failed to parse config") {
	log.Errorf("bad next config: %v", cause)
}

Prevention

When it happens

Trigger: A config update produces a next Config that channelconfig.NewBundle cannot build: missing Application/Orderer/Consortium groups required for the channel, malformed policy or value protos, or values that fail their Validate() checks.

Common situations: configtxlator-produced updates edited by hand and corrupted; consensus metadata JSON/proto in the Orderer group malformed; migrating to a config missing required capabilities values.

Understand the failure class

Related errors


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