{"record":{"id":"dfa35a6d82eafe0d","repo":"hyperledger/fabric","slug":"nil-channel-group-dfa35a","errorCode":null,"errorMessage":"Nil channel group","messagePattern":"Nil channel group","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/scc/cscc/configure.go","lineNumber":233,"sourceCode":"// validateConfigBlock validate configuration block to see whenever it's contains valid config transaction\nfunc validateConfigBlock(block *common.Block, bccsp bccsp.BCCSP) error {\n\tenvelopeConfig, err := protoutil.ExtractEnvelope(block, 0)\n\tif err != nil {\n\t\treturn errors.Errorf(\"Failed to %s\", err)\n\t}\n\n\tconfigEnv := &common.ConfigEnvelope{}\n\t_, err = protoutil.UnmarshalEnvelopeOfType(envelopeConfig, common.HeaderType_CONFIG, configEnv)\n\tif err != nil {\n\t\treturn errors.Errorf(\"Bad configuration envelope: %s\", err)\n\t}\n\n\tif configEnv.Config == nil {\n\t\treturn errors.New(\"Nil config envelope Config\")\n\t}\n\n\tif configEnv.Config.ChannelGroup == nil {\n\t\treturn errors.New(\"Nil channel group\")\n\t}\n\n\tif configEnv.Config.ChannelGroup.Groups == nil {\n\t\treturn errors.New(\"No channel configuration groups are available\")\n\t}\n\n\t_, exists := configEnv.Config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey]\n\tif !exists {\n\t\treturn errors.Errorf(\"Invalid configuration block, missing %s \"+\n\t\t\t\"configuration group\", channelconfig.ApplicationGroupKey)\n\t}\n\n\t// Check the capabilities requirement\n\tif err = channelconfig.ValidateCapabilities(block, bccsp); err != nil {\n\t\treturn errors.Errorf(\"Failed capabilities check: [%s]\", err)\n\t}\n\n\treturn nil","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/scc/cscc/configure.go#L215-L251","documentation":"The ConfigEnvelope decoded fine and Config is present, but Config.ChannelGroup is nil. ChannelGroup is the root of the channel's configuration tree (orderer, application, capabilities groups); without it cscc cannot derive any channel configuration. This indicates the configuration structure is empty at its root.","triggerScenarios":"Submitting a ConfigEnvelope whose Config has no ChannelGroup (e.g. built from a configtxgen profile that produced an empty config); manually constructing *common.Config without setting ChannelGroup; decoding a partial/invalid config via configtxlator where the top-level group was stripped.","commonSituations":"Misconfigured configtx.yaml profile (missing Organizations section so no top-level group is emitted); tooling that copies only sub-groups; broken configtxlator round trips; Fabric version mismatches where config marshaling dropped fields.","solutions":["Regenerate the configuration from a valid configtx.yaml profile with Organizations, Capabilities, and Orderer/Application sections defined","Verify with `configtxlator proto_decode --type common.Config` that ChannelGroup is populated before submitting","If building programmatically, assign Config.ChannelGroup = &common.ConfigGroup{...} with at least Version and Groups populated","Cross-check the genesis block: `configtxgen -inspectBlock genesis.block` should show a Channel group"],"exampleFix":"// before\nconfig := &common.Config{}\n// after\nconfig := &common.Config{\n    ChannelGroup: &common.ConfigGroup{\n        Groups: map[string]*common.ConfigGroup{\n            channelconfig.OrdererGroupKey:    ordererGroup,\n            channelconfig.ApplicationGroupKey: appGroup,\n        },\n    },\n}","handlingStrategy":"validation","validationCode":"if configEnv.Config == nil || configEnv.Config.ChannelGroup == nil {\n    return errors.New(\"config has no ChannelGroup; regenerate from a valid configtx.yaml profile\")\n}","typeGuard":"func hasChannelGroup(cfg *common.Config) bool { return cfg != nil && cfg.ChannelGroup != nil }","tryCatchPattern":"if cfg.GetChannelGroup() == nil {\n    return fmt.Errorf(\"ChannelGroup missing: check configtx.yaml profile and regenerate\")\n}","preventionTips":["Inspect generated config with `configtxgen -inspectBlock` before submission","Never construct *common.Config empty structs in production paths","Validate profiles with configtxgen -printOrg / -inspectChannelCreateTx","Keep configtx.yaml profiles under version control"],"tags":["fabric","system-chaincode","channel-config","nil-field"],"backgroundTag":"malformed-config-envelope","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"}