hyperledger/fabric · error
block is not a config block
Error message
block is not a config block
What it means
ValidateJoinBlock guard: protoutil.IsConfigBlock reported that the block submitted to the channel participation join API contains no CONFIG envelope in its data, i.e. it is a normal transaction block. Only a config block (typically the genesis block) can be used to join a channel.
Source
Thrown at orderer/common/channelparticipation/validator.go:29
"strconv"
"github.com/hyperledger/fabric-lib-go/bccsp/factory"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/common/channelconfig"
"github.com/hyperledger/fabric/common/configtx"
"github.com/hyperledger/fabric/orderer/common/types"
"github.com/hyperledger/fabric/protoutil"
"github.com/pkg/errors"
)
// ValidateJoinBlock checks whether this block can be used as a join block for the channel participation API.
// It returns the channel ID.
// It verifies that it is not a system channel by checking that consortiums config does not exist.
// It verifies it is an application channel by checking that the application group exists.
// It returns an error when it cannot be used as a join-block.
func ValidateJoinBlock(configBlock *cb.Block) (channelID string, err error) {
if !protoutil.IsConfigBlock(configBlock) {
return "", errors.New("block is not a config block")
}
if configBlock.Metadata == nil || len(configBlock.Metadata.Metadata) == 0 {
return "", errors.New("invalid block: does not have metadata")
}
dataHash := protoutil.ComputeBlockDataHash(configBlock.Data)
if !bytes.Equal(dataHash, configBlock.Header.DataHash) {
return "", errors.New("invalid block: Header.DataHash is different from Hash(block.Data)")
}
envelope, err := protoutil.ExtractEnvelope(configBlock, 0)
if err != nil {
return "", err
}
cryptoProvider := factory.GetDefault()
bundle, err := channelconfig.NewBundleFromEnvelope(envelope, cryptoProvider)View on GitHub (pinned to 2736b63f8f)
Solutions
- Submit the channel's genesis config block or the latest config block instead of a data block
- Fetch the correct block with 'osnadmin channel list' or from a peer's ledger
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at orderer/common/channelparticipation/validator.go:29 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/f06b166e41537911.
Report an issue: GitHub.