{"record":{"id":"d8bc9804984def3f","repo":"hyperledger/fabric","slug":"failed-to-parse-config","errorCode":null,"errorMessage":"failed to parse config","messagePattern":"failed to parse config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/common/msgprocessor/maintenancefilter.go","lineNumber":86,"sourceCode":"\t\t\"ConsensusState\", ordererConf.ConsensusState(), \"channel\", chanHdr.ChannelId)\n\terr = mf.inspect(configEnvelope, ordererConf)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"config transaction inspection failed\")\n\t}\n\n\treturn nil\n}\n\n// inspect checks whether the next orderer config, extracted from the incoming configEnvelope, respects the\n// transition rules of consensus-type migration using maintenance-mode.\nfunc (mf *MaintenanceFilter) inspect(configEnvelope *cb.ConfigEnvelope, ordererConfig channelconfig.Orderer) error {\n\tif configEnvelope.LastUpdate == nil {\n\t\treturn errors.Errorf(\"updated config does not include a config update\")\n\t}\n\n\tbundle, err := channelconfig.NewBundle(mf.support.ChannelID(), configEnvelope.Config, mf.bccsp)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to parse config\")\n\t}\n\n\tnextOrdererConfig, ok := bundle.OrdererConfig()\n\tif !ok {\n\t\treturn errors.New(\"next config is missing orderer group\")\n\t}\n\n\tif !ordererConfig.Capabilities().ConsensusTypeMigration() {\n\t\tif nextState := nextOrdererConfig.ConsensusState(); nextState != orderer.ConsensusType_STATE_NORMAL {\n\t\t\treturn errors.Errorf(\"next config attempted to change ConsensusType.State to %s, but capability is disabled\", nextState)\n\t\t}\n\t\tif ordererConfig.ConsensusType() != nextOrdererConfig.ConsensusType() {\n\t\t\treturn errors.Errorf(\"next config attempted to change ConsensusType.Type from %s to %s, but capability is disabled\",\n\t\t\t\tordererConfig.ConsensusType(), nextOrdererConfig.ConsensusType())\n\t\t}\n\t\treturn nil\n\t}\n","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/common/msgprocessor/maintenancefilter.go#L68-L104","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if err := channelconfig.NewBundle(chID, nextConfig, bccsp); err != nil {\n\treturn fmt.Errorf(\"next config invalid: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"err := filter.Apply(env)\nvar cause error\nfor cause = err; errors.Unwrap(cause) != nil; cause = errors.Unwrap(cause) {}\nif strings.Contains(err.Error(), \"failed to parse config\") {\n\tlog.Errorf(\"bad next config: %v\", cause)\n}","preventionTips":["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"],"tags":["ordering","channelconfig","config-validation","maintenance-mode"],"backgroundTag":"channel-config-parse-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"}