From db3f62ee4cc9e9386fea67f2a1bcb91526628fe9 Mon Sep 17 00:00:00 2001 From: Jason Yellick Date: Wed, 31 May 2017 01:24:41 -0400 Subject: [PATCH] [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 --- common/configtx/tool/configtxgen/main.go | 3 +++ orderer/multichain/manager.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/configtx/tool/configtxgen/main.go b/common/configtx/tool/configtxgen/main.go index be5bfaf6351..af7a6e17161 100644 --- a/common/configtx/tool/configtxgen/main.go +++ b/common/configtx/tool/configtxgen/main.go @@ -44,6 +44,9 @@ var logger = flogging.MustGetLogger("common/configtx/tool") func doOutputBlock(config *genesisconfig.Profile, channelID string, outputBlock string) error { pgen := provisional.New(config) logger.Info("Generating genesis block") + if config.Consortiums == nil { + logger.Warning("Genesis block does not contain a consortiums group definition. This block cannot be used for orderer bootstrap.") + } genesisBlock := pgen.GenesisBlockForChannel(channelID) logger.Info("Writing genesis block") err := ioutil.WriteFile(outputBlock, utils.MarshalOrPanic(genesisBlock), 0644) diff --git a/orderer/multichain/manager.go b/orderer/multichain/manager.go index 56de62a05b2..06334140a3e 100644 --- a/orderer/multichain/manager.go +++ b/orderer/multichain/manager.go @@ -136,7 +136,7 @@ func NewManagerImpl(ledgerFactory ledger.Factory, consenters map[string]Consente } if ml.systemChannelID == "" { - logger.Panicf("No system chain found") + logger.Panicf("No system chain found. If bootstrapping, does your system channel contain a consortiums group definition?") } return ml