{"record":{"id":"2e2928f2de9dc7cd","repo":"hyperledger/fabric","slug":"no-collection-access-policy-filter-computed-for-v","errorCode":null,"errorMessage":"No collection access policy filter computed for %v","messagePattern":"No collection access policy filter computed for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/privdata/distributor.go","lineNumber":186,"sourceCode":"\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 {\n\t\t\t\td.logger.Error(\"Collection access policy for\", collectionName, \"has no filter\")\n\t\t\t\treturn nil, errors.Errorf(\"No collection access policy filter computed for %v\", collectionName)\n\t\t\t}\n\n\t\t\tpvtDataMsg, err := d.createPrivateDataMessage(txID, namespace, collection, &peer.CollectionConfigPackage{Config: []*peer.CollectionConfig{colCP}}, blkHt)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.WithStack(err)\n\t\t\t}\n\n\t\t\td.logger.Debugf(\"Computing dissemination plan for collection [%s]\", collectionName)\n\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","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/privdata/distributor.go#L168-L204","documentation":"computeDisseminationPlan could not compute a collection access policy filter for a private rwset collection: either its config was missing from the collection config package or AccessPolicy evaluation failed, so no dissemination plan for pvt data can be built and the distribution is aborted.","triggerScenarios":"colAP.AccessFilter() returns nil during computeDisseminationPlan — happens when the computed policy has no filter implementation (unexpected/unsupported policy type).","commonSituations":"Custom or malformed collection access policy implementation returning nil filter; internal policy construction succeeded but the concrete policy type does not support filtering.","solutions":["Verify the collection access policy implementation returns a non-nil AccessFilter","Re-check the collection config type in the config package (static vs. unsupported variant)","Rebuild collection config so a valid static collection config is used"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"colAP, err := accessPolicy(colCP, chainID)\nif err == nil && colAP.AccessFilter() == nil { /* treat as invalid policy */ }","typeGuard":"func hasFilter(ap privdata.CollectionAccessPolicy) bool { return ap != nil && ap.AccessFilter() != nil }","tryCatchPattern":null,"preventionTips":["Use standard static collection configs so AccessFilter is implemented","Never hand-roll CollectionAccessPolicy without a filter"],"tags":["hyperledger-fabric","gossip","private-data","nil-filter"],"backgroundTag":"nil-collection-filter","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"}