{"record":{"id":"8ee4819243468197","repo":"hyperledger/fabric","slug":"attempted-to-change-consensus-type-from-s-to-s","errorCode":null,"errorMessage":"attempted to change consensus type from %s to %s","messagePattern":"attempted to change consensus type from (.+?) to (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/bundle.go","lineNumber":91,"sourceCode":"\n// ConfigtxValidator returns the configtx.Validator for the channel.\nfunc (b *Bundle) ConfigtxValidator() configtx.Validator {\n\treturn b.configtxManager\n}\n\n// ValidateNew checks if a new bundle's contained configuration is valid to be derived from the current bundle.\n// This allows checks of the nature \"Make sure that the consensus type did not change\".\nfunc (b *Bundle) ValidateNew(nb Resources) error {\n\tif oc, ok := b.OrdererConfig(); ok {\n\t\tnoc, ok := nb.OrdererConfig()\n\t\tif !ok {\n\t\t\treturn errors.New(\"current config has orderer section, but new config does not\")\n\t\t}\n\n\t\t// Prevent consensus-type migration when channel capabilities ConsensusTypeMigration is disabled\n\t\tif !b.channelConfig.Capabilities().ConsensusTypeMigration() {\n\t\t\tif oc.ConsensusType() != noc.ConsensusType() {\n\t\t\t\treturn errors.Errorf(\"attempted to change consensus type from %s to %s\",\n\t\t\t\t\toc.ConsensusType(), noc.ConsensusType())\n\t\t\t}\n\t\t}\n\n\t\t// When we move to capability V3_0 we insist on per Org endpoints for every org\n\t\tisOldV3 := b.ChannelConfig().Capabilities().ConsensusTypeBFT()\n\t\tisNewV3 := nb.ChannelConfig().Capabilities().ConsensusTypeBFT()\n\t\tif !isOldV3 && isNewV3 {\n\t\t\tfor _, org := range noc.Organizations() {\n\t\t\t\tif len(org.Endpoints()) == 0 {\n\t\t\t\t\treturn errors.Errorf(\"illegal orderer config update detected: endpoints of org %s are missing\", org.Name())\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor orgName, org := range oc.Organizations() {\n\t\t\tnorg, ok := noc.Organizations()[orgName]\n\t\t\tif !ok {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/bundle.go#L73-L109","documentation":"ValidateNew guard: an attempt to change the channel's consensus type (e.g. etcdraft to BFT) in a config update, which Fabric forbids because existing ledger data cannot be re-validated under a different consensus.","triggerScenarios":"Thrown at common/channelconfig/bundle.go:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the existing ConsensusType value in the config update","To migrate consensus, follow the documented channel-migration/recreation procedure instead of a plain config update"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}