hyperledger/fabric · error

Failed obtaining collection filter for channel %s, chaincode

Error message

Failed obtaining collection filter for channel %s, chaincode %s, collection %s

What it means

getLatestCollectionConfigRoutingFilter fetches the latest collection config and its access filter. If the latest config's AccessFilter() is nil, the puller cannot compute peers to ask for the missing private data and returns this error.

Source

Thrown at gossip/privdata/pull.go:544

	}
	return filters, nil
}

func (p *puller) getLatestCollectionConfigRoutingFilter(chaincode string, collection string) (filter.RoutingFilter, error) {
	cc := privdata.CollectionCriteria{
		Channel:    p.channel,
		Collection: collection,
		Namespace:  chaincode,
	}

	latestCollectionConfig, err := p.cs.RetrieveCollectionAccessPolicy(cc)
	if err != nil {
		return nil, errors.WithMessagef(err, "failed obtaining collection policy for channel %s, chaincode %s, config %s", p.channel, chaincode, collection)
	}

	filt := latestCollectionConfig.AccessFilter()
	if filt == nil {
		return nil, errors.Errorf("Failed obtaining collection filter for channel %s, chaincode %s, collection %s", p.channel, chaincode, collection)
	}

	anyPeerInCollection, err := p.getMatchAllRoutingFilter(filt)
	if err != nil {
		return nil, err
	}

	return anyPeerInCollection, nil
}

func (p *puller) getMatchAllRoutingFilter(filt privdata.Filter) (filter.RoutingFilter, error) {
	routingFilter, err := p.PeerFilter(common.ChannelID(p.channel), func(peerSignature api.PeerSignature) bool {
		return filt(protoutil.SignedData{
			Signature: peerSignature.Signature,
			Identity:  peerSignature.PeerIdentity,
			Data:      peerSignature.Message,
		})
	})

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Ensure the latest collection config defines a valid member_orgs_policy that produces an access filter
  2. If the collection was deleted, purge/ignore missing-data entries for it
  3. Check upstream wrapped error 'failed obtaining collection policy' for the root cause
Defensive patterns

Strategy: fallback

Validate before calling

pol, err := cs.RetrieveCollectionAccessPolicy(channel, cc)
if err == nil && pol.AccessFilter() == nil { skip() }

Type guard

func filterable(pol privdata.CollectionAccessPolicy) bool { return pol != nil && pol.AccessFilter() != nil }

Prevention

When it happens

Trigger: Called from computeFilters or computeReconciliationFilters when the latest collection access policy for (channel, chaincode, collection) yields a nil AccessFilter.

Common situations: Collection removed in the latest config but old missing data still tracked; malformed member orgs policy in the newest collection definition; cache returning an incomplete policy object.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/e72c23bc5724d06a. Report an issue: GitHub.