{"record":{"id":"49913784ce23d06d","repo":"hyperledger/fabric","slug":"illegal-consensus-type-detected-during-consensus-m","errorCode":null,"errorMessage":"illegal consensus type detected during consensus metadata validation: %s","messagePattern":"illegal consensus type detected during consensus metadata validation: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"orderer/consensus/etcdraft/chain.go","lineNumber":1480,"sourceCode":"\t}\n\n\t// metadata was not updated\n\tif newOrdererConfig.ConsensusMetadata() == nil {\n\t\treturn nil\n\t}\n\n\tif newOrdererConfig.ConsensusType() != \"etcdraft\" {\n\t\tif newOrdererConfig.ConsensusType() == \"BFT\" {\n\t\t\t// This is a migration, so we have to validate the config change and make sure that endpoints per org are configured\n\t\t\tfor _, org := range newOrdererConfig.Organizations() {\n\t\t\t\tif len(org.Endpoints()) == 0 {\n\t\t\t\t\treturn errors.Errorf(\"illegal orderer config detected during consensus metadata validation: endpoints of org %s are missing\", org.Name())\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t} else {\n\t\t\tc.logger.Panicf(\"illegal consensus type detected during consensus metadata validation: %s\", newOrdererConfig.ConsensusType())\n\t\t\treturn errors.Errorf(\"illegal consensus type detected during consensus metadata validation: %s\", newOrdererConfig.ConsensusType())\n\n\t\t}\n\t}\n\n\tif oldOrdererConfig == nil {\n\t\tc.logger.Panic(\"Programming Error: ValidateConsensusMetadata called with nil old channel config\")\n\t\treturn nil\n\t}\n\n\tif oldOrdererConfig.ConsensusMetadata() == nil {\n\t\tc.logger.Panic(\"Programming Error: ValidateConsensusMetadata called with nil old metadata\")\n\t\treturn nil\n\t}\n\n\toldMetadata := &etcdraft.ConfigMetadata{}\n\tif err := proto.Unmarshal(oldOrdererConfig.ConsensusMetadata(), oldMetadata); err != nil {\n\t\tc.logger.Panicf(\"Programming Error: Failed to unmarshal old etcdraft consensus metadata: %v\", err)\n\t}","sourceCodeStart":1462,"sourceCodeEnd":1498,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/consensus/etcdraft/chain.go#L1462-L1498","documentation":"Raised when the consensus type found in the new orderer config during metadata validation is neither 'etcdraft' nor 'BFT'. The code first panics with the same message (unrecoverable programming/config state) and then returns this error defensively.","triggerScenarios":"A config update carries an unsupported ConsensusType value in the Orderer group — a typo or a Fabric build without support for the configured consensus type.","commonSituations":"Hand-edited channel config introducing an invalid ConsensusType string; using a config generated for a different Fabric version with consensus plugins this build lacks; mixed-version cluster during migration.","solutions":["Correct the ConsensusType in the channel config to 'etcdraft' (or 'BFT' when migrating on a supporting version).","Regenerate the config update from a known-good configtx.yaml profile.","Ensure all orderers run a Fabric version that supports the intended consensus type.","Validate the decoded config with configtxlator before submitting the update."],"exampleFix":"// channel config\n# before\nConsensusType: \"etcd raft\"\n# after\nConsensusType: \"etcdraft\"","handlingStrategy":"validation","validationCode":"for _, org := range newCfg.Orderer.Organizations {\n    if len(org.OrdererEndpoints) == 0 {\n        return fmt.Errorf(\"org %s has no OrdererEndpoints; required for BFT migration\", org.Name)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Define OrdererEndpoints for every org before migration.","Validate the new config with configtxlator decode.","Follow the official consensus-type migration checklist.","Test migration on a throwaway network first."],"tags":["hyperledger-fabric","etcdraft","consensus-type","config-validation"],"backgroundTag":"illegal-consensus-type","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"}