{"record":{"id":"11399524c64a8307","repo":"hyperledger/fabric","slug":"failed-to-unmarshal-config-envelope-from-payload","errorCode":null,"errorMessage":"failed to unmarshal config envelope from payload","messagePattern":"failed to unmarshal config envelope from payload","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/bundle.go","lineNumber":177,"sourceCode":"\t\t}\n\t} else if _, okNew := nb.ConsortiumsConfig(); okNew {\n\t\treturn errors.Errorf(\"current config has no consortiums section, but new config does\")\n\t}\n\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","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/bundle.go#L159-L195","documentation":"Wrapped configtx.UnmarshalConfigEnvelope failure in NewBundleFromEnvelope: the payload decoded, but its data field is not a valid ConfigEnvelope — the block payload is corrupt or of an unexpected type.","triggerScenarios":"Thrown at common/channelconfig/bundle.go:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the protobuf decode failure detail","Obtain the config envelope from a verified config block and retry"],"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"}