{"record":{"id":"a89ada13dd6726bf","repo":"hyperledger/fabric","slug":"malformed-chaincode-invocation-spec-a89ada","errorCode":null,"errorMessage":"malformed chaincode invocation spec","messagePattern":"malformed chaincode invocation spec","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v13/lscc_validation_logic.go","lineNumber":363,"sourceCode":") commonerrors.TxValidationError {\n\tcpp, err := protoutil.UnmarshalChaincodeProposalPayload(cap.ChaincodeProposalPayload)\n\tif err != nil {\n\t\tlogger.Errorf(\"VSCC error: GetChaincodeProposalPayload failed, err %s\", err)\n\t\treturn policyErr(err)\n\t}\n\n\tcis := &pb.ChaincodeInvocationSpec{}\n\terr = proto.Unmarshal(cpp.Input, cis)\n\tif err != nil {\n\t\tlogger.Errorf(\"VSCC error: Unmarshal ChaincodeInvocationSpec failed, err %s\", err)\n\t\treturn policyErr(err)\n\t}\n\n\tif cis.ChaincodeSpec == nil ||\n\t\tcis.ChaincodeSpec.Input == nil ||\n\t\tcis.ChaincodeSpec.Input.Args == nil {\n\t\tlogger.Errorf(\"VSCC error: committing invalid vscc invocation\")\n\t\treturn policyErr(fmt.Errorf(\"malformed chaincode invocation spec\"))\n\t}\n\n\tlsccFunc := string(cis.ChaincodeSpec.Input.Args[0])\n\tlsccArgs := cis.ChaincodeSpec.Input.Args[1:]\n\n\tlogger.Debugf(\"VSCC info: ValidateLSCCInvocation acting on %s %#v\", lsccFunc, lsccArgs)\n\n\tswitch lsccFunc {\n\tcase lscc.UPGRADE, lscc.DEPLOY:\n\t\tlogger.Debugf(\"VSCC info: validating invocation of lscc function %s on arguments %#v\", lsccFunc, lsccArgs)\n\n\t\tif len(lsccArgs) < 2 {\n\t\t\treturn policyErr(fmt.Errorf(\"Wrong number of arguments for invocation lscc(%s): expected at least 2, received %d\", lsccFunc, len(lsccArgs)))\n\t\t}\n\n\t\tif (!ac.PrivateChannelData() && len(lsccArgs) > 5) ||\n\t\t\t(ac.PrivateChannelData() && len(lsccArgs) > 6) {\n\t\t\treturn policyErr(fmt.Errorf(\"Wrong number of arguments for invocation lscc(%s): received %d\", lsccFunc, len(lsccArgs)))","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v13/lscc_validation_logic.go#L345-L381","documentation":"ValidateLSCCInvocation unmarshalled the proposal payload but the ChaincodeInvocationSpec is incomplete — ChaincodeSpec, its Input, or Input.Args is nil. VSCC cannot determine which LSCC function is being invoked.","triggerScenarios":"Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:363 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure LSCC invocations carry a fully populated ChaincodeSpec with args","Reject the malformed transaction"],"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"}