{"record":{"id":"8513d7d20df91146","repo":"hyperledger/fabric","slug":"nil-header-in-payload","errorCode":null,"errorMessage":"nil header in payload","messagePattern":"nil header in payload","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/deliverclient/util.go","lineNumber":41,"sourceCode":"\t}\n\ttxn := block.Data.Data[0]\n\tenv, err := protoutil.GetEnvelopeFromBlock(txn)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\tpayload, err := protoutil.UnmarshalPayload(env.Payload)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\tif block.Header.Number == 0 {\n\t\tconfigEnvelope, err := configtx.UnmarshalConfigEnvelope(payload.Data)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"invalid config envelope\")\n\t\t}\n\t\treturn configEnvelope, nil\n\t}\n\tif payload.Header == nil {\n\t\treturn nil, errors.New(\"nil header in payload\")\n\t}\n\tchdr, err := protoutil.UnmarshalChannelHeader(payload.Header.ChannelHeader)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\tif common.HeaderType(chdr.Type) != common.HeaderType_CONFIG {\n\t\treturn nil, ErrNotAConfig\n\t}\n\tconfigEnvelope, err := configtx.UnmarshalConfigEnvelope(payload.Data)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"invalid config envelope\")\n\t}\n\treturn configEnvelope, nil\n}\n","sourceCodeStart":23,"sourceCodeEnd":56,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/deliverclient/util.go#L23-L56","documentation":"Returned by deliverclient.ConfigFromBlock for non-genesis blocks when the transaction payload lacks a header. Config blocks after genesis embed a config update envelope whose payload must be well-formed; a nil header means the payload is malformed and cannot be classified.","triggerScenarios":"Thrown at common/deliverclient/util.go:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rebuild the block from a valid envelope with a populated payload header","Treat the block as corrupt and re-fetch it"],"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"}