{"record":{"id":"9933399a05528ff5","repo":"hyperledger/fabric","slug":"no-such-collection-s","errorCode":null,"errorMessage":"no such collection '%s'","messagePattern":"no such collection '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/lifecycle/deployedcc_infoprovider.go","lineNumber":376,"sourceCode":"\tisImplicitCollection, mspID := implicitcollection.MspIDIfImplicitCollection(collectionName)\n\tif isImplicitCollection {\n\t\treturn vc.ImplicitCollectionEndorsementPolicyAsBytes(channelID, mspID)\n\t}\n\n\tif definedChaincode.Collections != nil {\n\t\tfor _, conf := range definedChaincode.Collections.Config {\n\t\t\tstaticCollConfig := conf.GetStaticCollectionConfig()\n\t\t\tif staticCollConfig != nil && staticCollConfig.Name == collectionName {\n\t\t\t\tif staticCollConfig.EndorsementPolicy != nil {\n\t\t\t\t\treturn protoutil.MarshalOrPanic(staticCollConfig.EndorsementPolicy), nil, nil\n\t\t\t\t}\n\t\t\t\t// default to chaincode endorsement policy\n\t\t\t\treturn definedChaincode.ValidationInfo.ValidationParameter, nil, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, nil, errors.Errorf(\"no such collection '%s'\", collectionName)\n}\n","sourceCodeStart":358,"sourceCodeEnd":378,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/lifecycle/deployedcc_infoprovider.go#L358-L378","documentation":"CollectionValidationInfo returns this when the requested collectionName is not found among the chaincode's defined static collections and it is not an implicit collection name. It means the transaction or query referenced a private data collection that the committed chaincode definition does not declare.","triggerScenarios":"Endorsement/validation requests CollectionValidationInfo(channelID, chaincodeName, collectionName) with a name that is neither in the chaincode's collections config nor of the form _implicit_org_<MSPID>.","commonSituations":"Typo in collection name in the chaincode (getStateByRange/private data APIs) or in collections.json; client queries a collection defined in a newer version of chaincode while the peer still runs the old definition; collection name case mismatch.","solutions":["Compare the collection name used at runtime against the committed collections.json (peer lifecycle chaincode queryinstalled/committed and collections-config).","Fix the collection name in the chaincode or client query to match the committed definition exactly.","If a new collection is needed, package updated collections config and commit a new chaincode definition sequence on the channel.","Ensure all orgs have approved the definition containing the new collection before invoking."],"exampleFix":"// before\nhandle.GetPrivateData(\"_invisible_col\", key)\n// after (name must match collections.json exactly)\nhandle.GetPrivateData(\"collectionOne\", key)","handlingStrategy":"validation","validationCode":"// Go: confirm the collection name exists in the committed definition before use\ncommitted, _ := client.Lifecycle().QueryChaincodeDefinition(name, channel)\nknown := map[string]bool{\"collectionOne\": true, \"_implicit_org_Org1MSP\": true}\nif !known[collectionName] {\n  return fmt.Errorf(\"collection %s not in committed definition\", collectionName)\n}","typeGuard":null,"tryCatchPattern":"err := handle.GetPrivateData(coll, key)\nif err != nil && strings.Contains(err.Error(), \"no such collection\") {\n  // correct name or commit new definition including the collection\n}","preventionTips":["Keep a single source of truth for collection names shared between chaincode and clients.","GetPrivateData names must match collections.json byte-for-byte.","After adding collections, commit the new definition on all orgs before use.","Watch for typos and case differences in collection names."],"tags":["hyperledger-fabric","private-data","collection-definition","chaincode-lifecycle"],"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"}