{"record":{"id":"46b8b73912c6e385","repo":"hyperledger/fabric","slug":"nil-payload-signature-header","errorCode":null,"errorMessage":"nil payload signature header","messagePattern":"nil payload signature header","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/tx/processor_factory.go","lineNumber":93,"sourceCode":"\n\tif len(payload.Header.ChannelHeader) == 0 {\n\t\treturn nil, &tx.InvalidErr{\n\t\t\tActualErr:      errors.New(\"nil payload channel header\"),\n\t\t\tValidationCode: peer.TxValidationCode_BAD_PAYLOAD,\n\t\t}\n\t}\n\n\tchdr, err := protoutil.UnmarshalChannelHeader(payload.Header.ChannelHeader)\n\tif err != nil {\n\t\treturn nil, &tx.InvalidErr{\n\t\t\tActualErr:      err,\n\t\t\tValidationCode: peer.TxValidationCode_BAD_PAYLOAD,\n\t\t}\n\t}\n\n\tif len(payload.Header.SignatureHeader) == 0 {\n\t\treturn nil, &tx.InvalidErr{\n\t\t\tActualErr:      errors.New(\"nil payload signature header\"),\n\t\t\tValidationCode: peer.TxValidationCode_BAD_PAYLOAD,\n\t\t}\n\t}\n\n\tshdr, err := protoutil.UnmarshalSignatureHeader(payload.Header.SignatureHeader)\n\tif err != nil {\n\t\treturn nil, &tx.InvalidErr{\n\t\t\tActualErr:      err,\n\t\t\tValidationCode: peer.TxValidationCode_BAD_PAYLOAD,\n\t\t}\n\t}\n\n\t// other checks over shdr.Nonce, shdr.Creator can be added if universally applicable\n\n\t// what TODO in legacy validation:\n\t//   validate cHdr.ChannelId ?\n\t//   validate epoch in cHdr.Epoch?\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/tx/processor_factory.go#L75-L111","documentation":"This error is returned by validateProtoAndConstructTxEnv in core/tx/processor_factory.go:93 when the payload's Header.SignatureHeader field is empty. Fabric's transaction validation requires a decodable SignatureHeader (creator identity, nonce) to build the transaction environment; without one the transaction is marked BAD_PAYLOAD with peer.TxValidationCode_BAD_PAYLOAD. It indicates the payload was constructed or deserialized incorrectly before reaching the processor.","triggerScenarios":"Calling CreateProcessor with a common.Payload whose Header.SignatureHeader byte slice has zero length, typically after unmarshaling a corrupted envelope or an envelope that never had its signature header populated.","commonSituations":"Programmatically assembled transactions missing the signature header; envelopes created by non-SDK tools that omit the field; truncated or tampered envelopes read from a block; protobuf version mismatches causing silent field drops.","solutions":["Ensure the transaction envelope is built with a populated SignatureHeader (protoutil.MakeSignatureHeader / protoutil.SignOrFail) before submission","Verify the payload is unmarshaled from a complete, uncorrupted envelope and that the signer/creator identity is set","Check the client SDK / gateway version compatibility with the peer and that the envelope passed integrity checks (signature verified earlier in validation)","If reading from a block, inspect the envelope bytes for truncation or corruption in your storage path"],"exampleFix":"// before: manually assembled payload without signature header\npayload.Header = &common.Header{ChannelHeader: chdrBytes}\n\n// after: include SignatureHeader\nsigHdr, _ := protoutil.MakeSignatureHeader(creator, nonce)\npayload.Header = &common.Header{ChannelHeader: chdrBytes, SignatureHeader: sigHdr}","handlingStrategy":"validation","validationCode":"if payload == nil || payload.Header == nil || len(payload.Header.SignatureHeader) == 0 {\n    return errors.New(\"payload missing SignatureHeader; rebuild envelope with protoutil.MakeSignatureHeader\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build envelopes via protoutil.CreateSignedEnvelope or the SDK gateway API","Assert SignatureHeader length > 0 before submitting to the peer","Pin protobuf/gateway versions between client and peer"],"tags":["hyperledger-fabric","transaction-validation","protobuf","bad-payload"],"backgroundTag":"malformed-transaction-envelope","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"}