{"record":{"id":"e908894c2b02d343","repo":"hyperledger/fabric","slug":"envelope-header-cannot-be-nil","errorCode":null,"errorMessage":"envelope header cannot be nil","messagePattern":"envelope header cannot be nil","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/bundle.go","lineNumber":181,"sourceCode":"\n\treturn nil\n}\n\n// NewBundleFromEnvelope wraps the NewBundle function, extracting the needed\n// information from a full configtx\nfunc NewBundleFromEnvelope(env *cb.Envelope, bccsp bccsp.BCCSP) (*Bundle, error) {\n\tpayload, err := protoutil.UnmarshalPayload(env.Payload)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to unmarshal payload from envelope\")\n\t}\n\n\tconfigEnvelope, err := configtx.UnmarshalConfigEnvelope(payload.Data)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to unmarshal config envelope from payload\")\n\t}\n\n\tif payload.Header == nil {\n\t\treturn nil, errors.Errorf(\"envelope header cannot be nil\")\n\t}\n\n\tchdr, err := protoutil.UnmarshalChannelHeader(payload.Header.ChannelHeader)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to unmarshal channel header\")\n\t}\n\n\treturn NewBundle(chdr.ChannelId, configEnvelope.Config, bccsp)\n}\n\n// NewBundle creates a new immutable bundle of configuration\nfunc NewBundle(channelID string, config *cb.Config, bccsp bccsp.BCCSP) (*Bundle, error) {\n\tif err := preValidate(config); err != nil {\n\t\treturn nil, err\n\t}\n\n\tchannelConfig, err := NewChannelConfig(config.ChannelGroup, bccsp)\n\tif err != nil {","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/bundle.go#L163-L199","documentation":"Returned by NewBundleFromEnvelope when the payload extracted from a config envelope has a nil Header. A valid configtx envelope must carry a header (containing the channel header used to bind the config to a channel); its absence means the envelope is malformed or truncated.","triggerScenarios":"Thrown at common/channelconfig/bundle.go:181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject/rebuild the envelope; valid Fabric payloads always carry a header","If produced by custom tooling, fix the envelope construction to include a channel header"],"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"}