{"record":{"id":"572255d4b8cea339","repo":"hyperledger/fabric","slug":"failed-to-unmarshal-channel-header","errorCode":null,"errorMessage":"failed to unmarshal channel header","messagePattern":"failed to unmarshal channel header","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/bundle.go","lineNumber":186,"sourceCode":"// 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 {\n\t\treturn nil, errors.Wrap(err, \"initializing channelconfig failed\")\n\t}\n\n\tpolicyProviderMap := make(map[int32]policies.Provider)\n\tfor pType := range cb.Policy_PolicyType_name {","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/bundle.go#L168-L204","documentation":"Returned by NewBundleFromEnvelope when protoutil.UnmarshalChannelHeader fails to decode the payload's channel header bytes. The envelope had a header, but the channel header field is not valid protobuf, so the channel identity of the config cannot be established.","triggerScenarios":"Thrown at common/channelconfig/bundle.go:186 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped decode error for details","Use a well-formed config envelope from a real Fabric block"],"exampleFix":null,"handlingStrategy":"try-catch","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"}