{"record":{"id":"032d3afc38e25851","repo":"hyperledger/fabric","slug":"error-unmarshalling-chaincodeinvocationspec","errorCode":null,"errorMessage":"error unmarshalling ChaincodeInvocationSpec","messagePattern":"error unmarshalling ChaincodeInvocationSpec","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"protoutil/unmarshalers.go","lineNumber":40,"sourceCode":"// UnmarshalBlock unmarshals bytes to a Block\nfunc UnmarshalBlock(encoded []byte) (*common.Block, error) {\n\tblock := &common.Block{}\n\terr := proto.Unmarshal(encoded, block)\n\treturn block, errors.Wrap(err, \"error unmarshalling Block\")\n}\n\n// 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) {","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/protoutil/unmarshalers.go#L22-L58","documentation":"UnmarshalChaincodeInvocationSpec wraps a proto.Unmarshal failure: the proposal payload's chaincode invocation spec bytes are not a valid ChaincodeInvocationSpec protobuf — malformed or version-incompatible proposal input.","triggerScenarios":"Thrown at protoutil/unmarshalers.go:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rebuild/re-sign the proposal with a compatible SDK","Verify the input bytes correspond to a ChaincodeInvocationSpec"],"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"}