{"record":{"id":"283d8e8071b71c59","repo":"hyperledger/fabric","slug":"channelconfig-config-cannot-be-nil","errorCode":null,"errorMessage":"channelconfig Config cannot be nil","messagePattern":"channelconfig Config cannot be nil","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/bundle.go","lineNumber":235,"sourceCode":"\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"initializing policymanager failed\")\n\t}\n\n\tconfigtxManager, err := configtx.NewValidatorImpl(channelID, config, RootGroupKey, policyManager)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"initializing configtx manager failed\")\n\t}\n\n\treturn &Bundle{\n\t\tpolicyManager:   policyManager,\n\t\tchannelConfig:   channelConfig,\n\t\tconfigtxManager: configtxManager,\n\t}, nil\n}\n\nfunc preValidate(config *cb.Config) error {\n\tif config == nil {\n\t\treturn errors.New(\"channelconfig Config cannot be nil\")\n\t}\n\n\tif config.ChannelGroup == nil {\n\t\treturn errors.New(\"config must contain a channel group\")\n\t}\n\n\tif og, ok := config.ChannelGroup.Groups[OrdererGroupKey]; ok {\n\t\tif _, ok := og.Values[CapabilitiesKey]; !ok {\n\t\t\tif _, ok := config.ChannelGroup.Values[CapabilitiesKey]; ok {\n\t\t\t\treturn errors.New(\"cannot enable channel capabilities without orderer support first\")\n\t\t\t}\n\n\t\t\tif ag, ok := config.ChannelGroup.Groups[ApplicationGroupKey]; ok {\n\t\t\t\tif _, ok := ag.Values[CapabilitiesKey]; ok {\n\t\t\t\t\treturn errors.New(\"cannot enable application capabilities without orderer support first\")\n\t\t\t\t}\n\t\t\t}\n\t\t}","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/bundle.go#L217-L253","documentation":"Returned by preValidate, the first sanity check NewBundle runs on a cb.Config before any processing. A nil config pointer means the caller passed no configuration at all; it is a programming/argument error rather than a config-content error.","triggerScenarios":"Thrown at common/channelconfig/bundle.go:235 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the config is extracted from a valid config envelope before calling NewBundle","Add a nil check at the call site that produced the config"],"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"}