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
- Inspect the wrapped cause for the exact parse/validation failure
- Regenerate the config update with configtxgen/configtxlator instead of hand-editing the marshalled config
- Validate the proposed config locally by running channelconfig.NewBundle (or configtxlator proto_decode) before submission
- 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
- Always derive next config from the fetched current channel config
- Validate with channelconfig.NewBundle or configtxlator proto_decode locally first
- Keep ConsensusMetadata as a valid etcdraft.ConfigMetadata / smartbft.Options proto
- Avoid manual edits to marshalled config protos
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
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- config transaction inspection failed
- updated config does not include a config update
- next config is missing orderer group
- next config attempted to change ConsensusType.State to %s, b
- attempted to change ConsensusType.Type from %s to %s, but Co
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/d8bc9804984def3f.
Report an issue: GitHub.