{"record":{"id":"5913806d02838013","repo":"hyperledger/fabric","slug":"collection-configuration-arguments-supplied-for-ch-591380","errorCode":null,"errorMessage":"collection configuration arguments supplied for chaincode %s:%s do not match the configuration in the lscc writeset","messagePattern":"collection configuration arguments supplied for chaincode (.+?):(.+?) do not match the configuration in the lscc writeset","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v13/lscc_validation_logic.go","lineNumber":255,"sourceCode":"\t/**********************************************************/\n\tvar collectionsConfigArg []byte\n\tif len(lsccArgs) > 5 {\n\t\tcollectionsConfigArg = lsccArgs[5]\n\t}\n\n\tvar collectionsConfigLedger []byte\n\tif len(lsccrwset.Writes) == 2 {\n\t\tkey := privdata.BuildCollectionKVSKey(cdRWSet.Name)\n\t\tif lsccrwset.Writes[1].Key != key {\n\t\t\treturn policyErr(fmt.Errorf(\"invalid key for the collection of chaincode %s:%s; expected '%s', received '%s'\",\n\t\t\t\tcdRWSet.Name, cdRWSet.Version, key, lsccrwset.Writes[1].Key))\n\t\t}\n\n\t\tcollectionsConfigLedger = lsccrwset.Writes[1].Value\n\t}\n\n\tif !bytes.Equal(collectionsConfigArg, collectionsConfigLedger) {\n\t\treturn policyErr(fmt.Errorf(\"collection configuration arguments supplied for chaincode %s:%s do not match the configuration in the lscc writeset\",\n\t\t\tcdRWSet.Name, cdRWSet.Version))\n\t}\n\n\tchannelState, err := vscc.stateFetcher.FetchState()\n\tif err != nil {\n\t\treturn &commonerrors.VSCCExecutionFailureError{Err: fmt.Errorf(\"failed obtaining query executor: %v\", err)}\n\t}\n\tdefer channelState.Done()\n\n\tstate := &state{channelState}\n\n\t// The following condition check added in v1.1 may not be needed as it is not possible to have the chaincodeName~collection key in\n\t// the lscc namespace before a chaincode deploy. To avoid forks in v1.2, the following condition is retained.\n\tif lsccFunc == lscc.DEPLOY {\n\t\tcolCriteria := privdata.CollectionCriteria{Channel: channelName, Namespace: cdRWSet.Name}\n\t\tccp, err := privdata.RetrieveCollectionConfigPackageFromState(colCriteria, state)\n\t\tif err != nil {\n\t\t\t// fail if we get any error other than NoSuchCollectionError","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v13/lscc_validation_logic.go#L237-L273","documentation":"The collection configuration passed as an LSCC deploy/upgrade argument differs byte-wise from the collection config written to the ledger write-set. VSCC requires the declared args and the actual writes to agree exactly.","triggerScenarios":"Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:255 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the collections config argument identical to the value written by LSCC","Rebuild and resubmit the deploy transaction with consistent collection bytes"],"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"}