{"record":{"id":"a057d3882a8f05b0","repo":"hyperledger/fabric","slug":"no-read-write-set-for-lscc-was-found-a057d3","errorCode":null,"errorMessage":"No read write set for lscc was found","messagePattern":"No read write set for lscc was found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v13/lscc_validation_logic.go","lineNumber":457,"sourceCode":"\t\t\tlogger.Debugf(\"Namespace %s\", ns.NameSpace)\n\t\t\tif ns.NameSpace == \"lscc\" {\n\t\t\t\tlsccrwset = ns.KvRwSet\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// retrieve from the ledger the entry for the chaincode at hand\n\t\tcdLedger, ccExistsOnLedger, err := vscc.getInstantiatedCC(chid, cdsArgs.ChaincodeSpec.ChaincodeId.Name)\n\t\tif err != nil {\n\t\t\treturn &commonerrors.VSCCExecutionFailureError{Err: err}\n\t\t}\n\n\t\t/******************************************/\n\t\t/* security check 0 - validation of rwset */\n\t\t/******************************************/\n\t\t// there has to be a write-set\n\t\tif lsccrwset == nil {\n\t\t\treturn policyErr(fmt.Errorf(\"No read write set for lscc was found\"))\n\t\t}\n\t\t// there must be at least one write\n\t\tif len(lsccrwset.Writes) < 1 {\n\t\t\treturn policyErr(fmt.Errorf(\"LSCC must issue at least one single putState upon deploy/upgrade\"))\n\t\t}\n\t\t// the first key name must be the chaincode id provided in the deployment spec\n\t\tif lsccrwset.Writes[0].Key != cdsArgs.ChaincodeSpec.ChaincodeId.Name {\n\t\t\treturn policyErr(fmt.Errorf(\"expected key %s, found %s\", cdsArgs.ChaincodeSpec.ChaincodeId.Name, lsccrwset.Writes[0].Key))\n\t\t}\n\t\t// the value must be a ChaincodeData struct\n\t\tcdRWSet := &ccprovider.ChaincodeData{}\n\t\terr = proto.Unmarshal(lsccrwset.Writes[0].Value, cdRWSet)\n\t\tif err != nil {\n\t\t\treturn policyErr(fmt.Errorf(\"unmarshalling of ChaincodeData failed, error %s\", err))\n\t\t}\n\t\t// the chaincode name in the lsccwriteset must match the chaincode name in the deployment spec\n\t\tif cdRWSet.Name != cdsArgs.ChaincodeSpec.ChaincodeId.Name {\n\t\t\treturn policyErr(fmt.Errorf(\"expected cc name %s, found %s\", cdsArgs.ChaincodeSpec.ChaincodeId.Name, cdRWSet.Name))","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v13/lscc_validation_logic.go#L439-L475","documentation":"Returned by ValidateLSCCInvocation (security check 0) when the transaction's rwset contains no 'lscc' namespace entry — a deploy/upgrade must write through LSCC, so a missing LSCC rwset fails validation.","triggerScenarios":"Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:457 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the LSCC invocation actually writes to the lscc namespace","Reject the transaction missing its LSCC rwset"],"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"}