Skip to content

Commit db3f62e

Browse files
author
Jason Yellick
committed
[FAB-4205] Clarify missing system chain error
As reported in FAB-4205, it can be confusing for a user who generates a genesis block via configtxgen without a consortiums group and attempts to use this genesis block for orderer bootstrap. The resulting error is that no system channel is defined, and the orderer will not start. However, it is non-obvious from the log what the underlying cause of the error might be. This CR adds a warning message to the configtxgen tool when it is being used to generate a genesis block (typically used for orderer bootstrap) which does not contain a consortiums group. It additionally makes the "No system channel" error message more verbose and suggests the likely cause of a missing consortiums definition. Change-Id: Ic3bb22e7ad401718d08de5f4d7a2918d2493dcc5 Signed-off-by: Jason Yellick <[email protected]>
1 parent 5ba27bf commit db3f62e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

common/configtx/tool/configtxgen/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ var logger = flogging.MustGetLogger("common/configtx/tool")
4444
func doOutputBlock(config *genesisconfig.Profile, channelID string, outputBlock string) error {
4545
pgen := provisional.New(config)
4646
logger.Info("Generating genesis block")
47+
if config.Consortiums == nil {
48+
logger.Warning("Genesis block does not contain a consortiums group definition. This block cannot be used for orderer bootstrap.")
49+
}
4750
genesisBlock := pgen.GenesisBlockForChannel(channelID)
4851
logger.Info("Writing genesis block")
4952
err := ioutil.WriteFile(outputBlock, utils.MarshalOrPanic(genesisBlock), 0644)

orderer/multichain/manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func NewManagerImpl(ledgerFactory ledger.Factory, consenters map[string]Consente
136136
}
137137

138138
if ml.systemChannelID == "" {
139-
logger.Panicf("No system chain found")
139+
logger.Panicf("No system chain found. If bootstrapping, does your system channel contain a consortiums group definition?")
140140
}
141141

142142
return ml

0 commit comments

Comments
 (0)