{"record":{"id":"80aa776316993fe9","repo":"hyperledger/fabric","slug":"collection-config-package-for-s-chaincode-is-not","errorCode":null,"errorMessage":"collection config package for %s chaincode is not provided","messagePattern":"collection config package for (.+?) chaincode is not provided","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/privdata/distributor.go","lineNumber":166,"sourceCode":"}\n\ntype dissemination struct {\n\tmsg      *protoext.SignedGossipMessage\n\tcriteria gossipgossip.SendCriteria\n}\n\nfunc (d *distributorImpl) computeDisseminationPlan(txID string,\n\tprivDataWithConfig *transientstore.TxPvtReadWriteSetWithConfigInfo,\n\tblkHt uint64,\n) ([]*dissemination, error) {\n\tprivData := privDataWithConfig.PvtRwset\n\tvar disseminationPlan []*dissemination\n\tfor _, pvtRwset := range privData.NsPvtRwset {\n\t\tnamespace := pvtRwset.Namespace\n\t\tconfigPackage, found := privDataWithConfig.CollectionConfigs[namespace]\n\t\tif !found {\n\t\t\td.logger.Error(\"Collection config package for\", namespace, \"chaincode is not provided\")\n\t\t\treturn nil, errors.New(fmt.Sprint(\"collection config package for\", namespace, \"chaincode is not provided\"))\n\t\t}\n\n\t\tfor _, collection := range pvtRwset.CollectionPvtRwset {\n\t\t\tcolCP, err := d.getCollectionConfig(configPackage, collection)\n\t\t\tcollectionName := collection.CollectionName\n\t\t\tif err != nil {\n\t\t\t\td.logger.Error(\"Could not find collection access policy for\", namespace, \" and collection\", collectionName, \"error\", err)\n\t\t\t\treturn nil, errors.WithMessage(err, fmt.Sprint(\"could not find collection access policy for\", namespace, \" and collection\", collectionName, \"error\", err))\n\t\t\t}\n\n\t\t\tcolAP, err := d.AccessPolicy(colCP, d.chainID)\n\t\t\tif err != nil {\n\t\t\t\td.logger.Error(\"Could not obtain collection access policy, collection name\", collectionName, \"due to\", err)\n\t\t\t\treturn nil, errors.Wrap(err, fmt.Sprint(\"Could not obtain collection access policy, collection name\", collectionName, \"due to\", err))\n\t\t\t}\n\n\t\t\tcolFilter := colAP.AccessFilter()\n\t\t\tif colFilter == nil {","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/privdata/distributor.go#L148-L184","documentation":"During private data dissemination, the distributor looks up the collection config package for each namespace in the tx's private write set. If the caller-supplied CollectionConfigs map has no entry for a namespace, dissemination cannot proceed, so computeDisseminationPlan aborts with this error.","triggerScenarios":"Distribute (via computeDisseminationPlan) is called with a privdata object whose CollectionConfigs map lacks a key for a namespace present in NsPvtRwset — e.g. the endorser/config cache did not return configs for that chaincode.","commonSituations":"Chaincode renamed or namespace mismatch between the rwset and the configs fetched from the ledger; collection config not yet committed/available on this peer; upstream code building privData omitted the namespace.","solutions":["Ensure CollectionConfigs is populated for every namespace in NsPvtRwset before calling Distribute","Check that the collection config for the chaincode is committed on the channel and cached on this peer","Verify chaincode/namespace names match exactly between the tx rwset and the config map"],"exampleFix":"// before\nprivDataWithConfig := &privdata.PrivateDataWithConfig{NsPvtRwset: rwset, CollectionConfigs: partialConfigs}\n// after\nfor _, ns := range rwset.NsPvtRwset {\n  if _, ok := partialConfigs[ns.Namespace]; !ok { /* fetch config or skip */ }\n}","handlingStrategy":"validation","validationCode":"for _, ns := range privData.NsPvtRwset {\n  if _, ok := privDataWithConfig.CollectionConfigs[ns.Namespace]; !ok {\n    return fmt.Errorf(\"missing collection config for namespace %s\", ns.Namespace)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build CollectionConfigs from the ledger for every namespace in the rwset","Log and assert namespace coverage before calling Distribute"],"tags":["hyperledger-fabric","gossip","private-data","missing-config"],"backgroundTag":"missing-collection-config","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}