{"record":{"id":"521d640380223288","repo":"hyperledger/fabric","slug":"no-collection-config-was-found-for-collection-s","errorCode":null,"errorMessage":"no collection config was found for collection <%s> namespace <%s> txID <%s>","messagePattern":"no collection config was found for collection <(.+?)> namespace <(.+?)> txID <(.+?)>","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/privdata/dataretriever.go","lineNumber":157,"sourceCode":"\t\tconfHistoryRetriever, err := dr.committer.GetConfigHistoryRetriever()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"cannot obtain configuration history retriever, for collection <%s>\"+\n\t\t\t\t\" txID <%s> block sequence number <%d> due to <%s>\", dig.Collection, dig.TxId, dig.BlockSeq, err)\n\t\t}\n\n\t\tconfigInfo, err := confHistoryRetriever.MostRecentCollectionConfigBelow(dig.BlockSeq, dig.Namespace)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"cannot find recent collection config update below block sequence = %d,\"+\n\t\t\t\t\" collection name = <%s> for chaincode <%s>\", dig.BlockSeq, dig.Collection, dig.Namespace)\n\t\t}\n\n\t\tif configInfo == nil {\n\t\t\treturn nil, errors.Errorf(\"no collection config update below block sequence = <%d>\"+\n\t\t\t\t\" collection name = <%s> for chaincode <%s> is available \", dig.BlockSeq, dig.Collection, dig.Namespace)\n\t\t}\n\t\tconfigs := extractCollectionConfig(configInfo.CollectionConfig, dig.Collection)\n\t\tif configs == nil {\n\t\t\treturn nil, errors.Errorf(\"no collection config was found for collection <%s>\"+\n\t\t\t\t\" namespace <%s> txID <%s>\", dig.Collection, dig.Namespace, dig.TxId)\n\t\t}\n\t\tpvtRWSetWithConfig.CollectionConfig = configs\n\t\tresults[common.DigKey{\n\t\t\tNamespace:  dig.Namespace,\n\t\t\tCollection: dig.Collection,\n\t\t\tTxId:       dig.TxId,\n\t\t\tBlockSeq:   dig.BlockSeq,\n\t\t\tSeqInBlock: dig.SeqInBlock,\n\t\t}] = pvtRWSetWithConfig\n\t}\n\n\treturn results, nil\n}\n\nfunc (dr *dataRetriever) fromTransientStore(dig *protosgossip.PvtDataDigest, filter map[string]ledger.PvtCollFilter) (*util.PrivateRWSetWithConfig, error) {\n\tresults := &util.PrivateRWSetWithConfig{}\n\tit, err := dr.store.GetTxPvtRWSetByTxid(dig.TxId, filter)","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/privdata/dataretriever.go#L139-L175","documentation":"The config history entry was found (configInfo non-nil), but extractCollectionConfig could not locate the specific collection within the CollectionConfigPackage. This means the config bundle for that block range does not contain the named collection, so its access policy can't be built and the digest is rejected.","triggerScenarios":"Digest names a collection that is not present in the historical collection config package — typically a collection name typo, a renamed/removed collection, or requesting a collection the chaincode never declared at that block height.","commonSituations":"Chaincode upgraded to drop or rename a collection while old pvt-data requests still reference the old name; client/chaincode mismatch in collection names; reconciling pvt data for collections the peer was never a member of.","solutions":["Verify the collection name in the digest matches the name in the chaincode's collections_config.json exactly (case-sensitive).","Re-issue the pvt-data request with a collection that exists in the current chaincode definition.","Check the chaincode's collection definitions to confirm the collection was declared.","If the collection was intentionally removed, stop reconciliation of its historical pvt data."],"exampleFix":"// before: collection name from stale client config\ndig := &protosgossip.PvtDataDigest{Collection: \"coll1_old\", ...}\n\n// after: use the declared name\ndig := &protosgossip.PvtDataDigest{Collection: \"coll1\", Namespace: \"ns\", ...} // matches collections_config.json","handlingStrategy":"validation","validationCode":"configs, err := extractCollectionConfigFromJSON(collectionsJSON)\nif configs == nil {\n    return errors.Errorf(\"collection %q not declared in collections_config.json\", collectionName)\n}","typeGuard":"func collectionDeclared(ccp *peer.CollectionConfigPackage, coll string) bool {\n    for _, c := range ccp.GetConfig() {\n        if s := c.GetStaticCollectionConfig(); s != nil && s.Name == coll {\n            return true\n        }\n    }\n    return false\n}","tryCatchPattern":"configs := extractCollectionConfig(configInfo.CollectionConfig, dig.Collection)\nif configs == nil {\n    logger.Warningf(\"collection %s missing from config package; skipping\", dig.Collection)\n    return\n}","preventionTips":["Match collection names byte-for-byte against collections_config.json (case-sensitive).","Update all clients/tooling when collections are renamed or removed.","Keep chaincode definitions and digest builders in sync.","Lint collection config packages before chaincode upgrades."],"tags":["fabric","collection-config","chaincode","private-data"],"backgroundTag":"collection-not-in-config","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"}