{"record":{"id":"55c9f4a731eaf5dc","repo":"hyperledger/fabric","slug":"no-configuration-for-collection-s-found","errorCode":null,"errorMessage":"no configuration for collection %s found","messagePattern":"no configuration for collection (.+?) found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/privdata/distributor.go","lineNumber":213,"sourceCode":"\t\t\tdPlan, err := d.disseminationPlanForMsg(colAP, colFilter, pvtDataMsg)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.WithMessagef(err, \"could not build private data dissemination plan for chaincode %s and collection %s\", namespace, collectionName)\n\t\t\t}\n\t\t\tdisseminationPlan = append(disseminationPlan, dPlan...)\n\t\t}\n\t}\n\treturn disseminationPlan, nil\n}\n\nfunc (d *distributorImpl) getCollectionConfig(config *peer.CollectionConfigPackage, collection *rwset.CollectionPvtReadWriteSet) (*peer.CollectionConfig, error) {\n\tfor _, c := range config.Config {\n\t\tif staticConfig := c.GetStaticCollectionConfig(); staticConfig != nil {\n\t\t\tif staticConfig.Name == collection.CollectionName {\n\t\t\t\treturn c, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, errors.New(fmt.Sprint(\"no configuration for collection\", collection.CollectionName, \"found\"))\n}\n\nfunc (d *distributorImpl) disseminationPlanForMsg(colAP privdata.CollectionAccessPolicy, colFilter privdata.Filter, pvtDataMsg *protoext.SignedGossipMessage) ([]*dissemination, error) {\n\tvar disseminationPlan []*dissemination\n\n\troutingFilter, err := d.gossipAdapter.PeerFilter(gossipCommon.ChannelID(d.chainID), func(signature api.PeerSignature) bool {\n\t\treturn colFilter(protoutil.SignedData{\n\t\t\tData:      signature.Message,\n\t\t\tSignature: signature.Signature,\n\t\t\tIdentity:  signature.PeerIdentity,\n\t\t})\n\t})\n\tif err != nil {\n\t\td.logger.Error(\"Failed to retrieve peer routing filter for channel\", d.chainID, \":\", err)\n\t\treturn nil, err\n\t}\n\n\tm := pvtDataMsg.GetPrivateData().Payload","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/privdata/distributor.go#L195-L231","documentation":"getCollectionConfig scans the CollectionConfigPackage for a static collection config whose name matches the collection in the private rwset. If none matches, it returns this error, aborting dissemination for that namespace.","triggerScenarios":"computeDisseminationPlan calls getCollectionConfig for a collection name that has no matching StaticCollectionConfig entry in the namespace's CollectionConfigPackage.","commonSituations":"Data written under an older collection name that was renamed or removed in the latest collection config; typo in collection name in chaincode; reconciliation of private data spanning a config update that dropped the collection.","solutions":["Ensure the collection name in PutPrivateData matches a collection defined in the chaincode's collection config","If the collection was removed/renamed via collection config update, accept that old data can no longer be disseminated or restore the collection definition","Re-commit a collection config containing the missing collection"],"exampleFix":"// before\nerr := stub.PutPrivateData(\"oldCollection\", key, value)\n// after\n// use a collection name present in collections_config.json\nerr := stub.PutPrivateData(\"collectionMarbles\", key, value)","handlingStrategy":"validation","validationCode":"func collectionDefined(cfgPkg *peer.CollectionConfigPackage, name string) bool {\n  for _, c := range cfgPkg.GetConfig() {\n    if sc := c.GetStaticCollectionConfig(); sc != nil && sc.Name == name { return true }\n  }\n  return false\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"no configuration for collection\") {\n  // re-check collection name vs collections_config.json\n}","preventionTips":["Verify every PutPrivateData collection name exists in the deployed collection config","Review collection config changes (renames/removals) before upgrading chaincode"],"tags":["hyperledger-fabric","private-data","collection-config","not-found"],"backgroundTag":"collection-not-found","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"}