{"record":{"id":"598be3b9f9c1798f","repo":"hyperledger/fabric","slug":"error-unmarshalling-payload","errorCode":null,"errorMessage":"error unmarshalling Payload","messagePattern":"error unmarshalling Payload","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"protoutil/unmarshalers.go","lineNumber":47,"sourceCode":"// UnmarshalChaincodeDeploymentSpec unmarshals bytes to a ChaincodeDeploymentSpec\nfunc UnmarshalChaincodeDeploymentSpec(code []byte) (*peer.ChaincodeDeploymentSpec, error) {\n\tcds := &peer.ChaincodeDeploymentSpec{}\n\terr := proto.Unmarshal(code, cds)\n\treturn cds, errors.Wrap(err, \"error unmarshalling ChaincodeDeploymentSpec\")\n}\n\n// UnmarshalChaincodeInvocationSpec unmarshals bytes to a ChaincodeInvocationSpec\nfunc UnmarshalChaincodeInvocationSpec(encoded []byte) (*peer.ChaincodeInvocationSpec, error) {\n\tcis := &peer.ChaincodeInvocationSpec{}\n\terr := proto.Unmarshal(encoded, cis)\n\treturn cis, errors.Wrap(err, \"error unmarshalling ChaincodeInvocationSpec\")\n}\n\n// UnmarshalPayload unmarshals bytes to a Payload\nfunc UnmarshalPayload(encoded []byte) (*common.Payload, error) {\n\tpayload := &common.Payload{}\n\terr := proto.Unmarshal(encoded, payload)\n\treturn payload, errors.Wrap(err, \"error unmarshalling Payload\")\n}\n\n// UnmarshalEnvelope unmarshals bytes to a Envelope\nfunc UnmarshalEnvelope(encoded []byte) (*common.Envelope, error) {\n\tenvelope := &common.Envelope{}\n\terr := proto.Unmarshal(encoded, envelope)\n\treturn envelope, errors.Wrap(err, \"error unmarshalling Envelope\")\n}\n\n// UnmarshalChannelHeader unmarshals bytes to a ChannelHeader\nfunc UnmarshalChannelHeader(bytes []byte) (*common.ChannelHeader, error) {\n\tchdr := &common.ChannelHeader{}\n\terr := proto.Unmarshal(bytes, chdr)\n\treturn chdr, errors.Wrap(err, \"error unmarshalling ChannelHeader\")\n}\n\n// UnmarshalChaincodeID unmarshals bytes to a ChaincodeID\nfunc UnmarshalChaincodeID(bytes []byte) (*peer.ChaincodeID, error) {","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/protoutil/unmarshalers.go#L29-L65","documentation":"UnmarshalPayload wraps a proto.Unmarshal failure: the bytes are not a valid common.Payload (nil, empty, truncated, or a different message). This is the first decode step for nearly every envelope-processing path, so garbage envelopes surface here.","triggerScenarios":"Thrown at protoutil/unmarshalers.go:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject the envelope; the payload bytes are not a protobuf Payload","Check the sender's SDK and serialization format"],"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"}