{"record":{"id":"f06b166e41537911","repo":"hyperledger/fabric","slug":"block-is-not-a-config-block","errorCode":null,"errorMessage":"block is not a config block","messagePattern":"block is not a config block","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/common/channelparticipation/validator.go","lineNumber":29,"sourceCode":"\t\"strconv\"\n\n\t\"github.com/hyperledger/fabric-lib-go/bccsp/factory\"\n\tcb \"github.com/hyperledger/fabric-protos-go-apiv2/common\"\n\t\"github.com/hyperledger/fabric/common/channelconfig\"\n\t\"github.com/hyperledger/fabric/common/configtx\"\n\t\"github.com/hyperledger/fabric/orderer/common/types\"\n\t\"github.com/hyperledger/fabric/protoutil\"\n\t\"github.com/pkg/errors\"\n)\n\n// ValidateJoinBlock checks whether this block can be used as a join block for the channel participation API.\n// It returns the channel ID.\n// It verifies that it is not a system channel by checking that consortiums config does not exist.\n// It verifies it is an application channel by checking that the application group exists.\n// It returns an error when it cannot be used as a join-block.\nfunc ValidateJoinBlock(configBlock *cb.Block) (channelID string, err error) {\n\tif !protoutil.IsConfigBlock(configBlock) {\n\t\treturn \"\", errors.New(\"block is not a config block\")\n\t}\n\n\tif configBlock.Metadata == nil || len(configBlock.Metadata.Metadata) == 0 {\n\t\treturn \"\", errors.New(\"invalid block: does not have metadata\")\n\t}\n\n\tdataHash := protoutil.ComputeBlockDataHash(configBlock.Data)\n\tif !bytes.Equal(dataHash, configBlock.Header.DataHash) {\n\t\treturn \"\", errors.New(\"invalid block: Header.DataHash is different from Hash(block.Data)\")\n\t}\n\n\tenvelope, err := protoutil.ExtractEnvelope(configBlock, 0)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcryptoProvider := factory.GetDefault()\n\tbundle, err := channelconfig.NewBundleFromEnvelope(envelope, cryptoProvider)","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/common/channelparticipation/validator.go#L11-L47","documentation":"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.","triggerScenarios":"Thrown at orderer/common/channelparticipation/validator.go:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"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"}