Skip to content

Commit

Permalink
[FAB-4205] Clarify missing system chain error
Browse files Browse the repository at this point in the history
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 <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed May 31, 2017
1 parent 5ba27bf commit db3f62e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions common/configtx/tool/configtxgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion orderer/multichain/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db3f62e

Please sign in to comment.