hyperledger/fabric · error

no collection config was found for collection <%s> namespace

Error message

no collection config was found for collection <%s> namespace <%s> txID <%s>

What it means

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.

Source

Thrown at gossip/privdata/dataretriever.go:157

		confHistoryRetriever, err := dr.committer.GetConfigHistoryRetriever()
		if err != nil {
			return nil, errors.Errorf("cannot obtain configuration history retriever, for collection <%s>"+
				" txID <%s> block sequence number <%d> due to <%s>", dig.Collection, dig.TxId, dig.BlockSeq, err)
		}

		configInfo, err := confHistoryRetriever.MostRecentCollectionConfigBelow(dig.BlockSeq, dig.Namespace)
		if err != nil {
			return nil, errors.Errorf("cannot find recent collection config update below block sequence = %d,"+
				" collection name = <%s> for chaincode <%s>", dig.BlockSeq, dig.Collection, dig.Namespace)
		}

		if configInfo == nil {
			return nil, errors.Errorf("no collection config update below block sequence = <%d>"+
				" collection name = <%s> for chaincode <%s> is available ", dig.BlockSeq, dig.Collection, dig.Namespace)
		}
		configs := extractCollectionConfig(configInfo.CollectionConfig, dig.Collection)
		if configs == nil {
			return nil, errors.Errorf("no collection config was found for collection <%s>"+
				" namespace <%s> txID <%s>", dig.Collection, dig.Namespace, dig.TxId)
		}
		pvtRWSetWithConfig.CollectionConfig = configs
		results[common.DigKey{
			Namespace:  dig.Namespace,
			Collection: dig.Collection,
			TxId:       dig.TxId,
			BlockSeq:   dig.BlockSeq,
			SeqInBlock: dig.SeqInBlock,
		}] = pvtRWSetWithConfig
	}

	return results, nil
}

func (dr *dataRetriever) fromTransientStore(dig *protosgossip.PvtDataDigest, filter map[string]ledger.PvtCollFilter) (*util.PrivateRWSetWithConfig, error) {
	results := &util.PrivateRWSetWithConfig{}
	it, err := dr.store.GetTxPvtRWSetByTxid(dig.TxId, filter)

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Verify the collection name in the digest matches the name in the chaincode's collections_config.json exactly (case-sensitive).
  2. Re-issue the pvt-data request with a collection that exists in the current chaincode definition.
  3. Check the chaincode's collection definitions to confirm the collection was declared.
  4. If the collection was intentionally removed, stop reconciliation of its historical pvt data.

Example fix

// before: collection name from stale client config
dig := &protosgossip.PvtDataDigest{Collection: "coll1_old", ...}

// after: use the declared name
dig := &protosgossip.PvtDataDigest{Collection: "coll1", Namespace: "ns", ...} // matches collections_config.json
Defensive patterns

Strategy: validation

Validate before calling

configs, err := extractCollectionConfigFromJSON(collectionsJSON)
if configs == nil {
    return errors.Errorf("collection %q not declared in collections_config.json", collectionName)
}

Type guard

func collectionDeclared(ccp *peer.CollectionConfigPackage, coll string) bool {
    for _, c := range ccp.GetConfig() {
        if s := c.GetStaticCollectionConfig(); s != nil && s.Name == coll {
            return true
        }
    }
    return false
}

Try / catch

configs := extractCollectionConfig(configInfo.CollectionConfig, dig.Collection)
if configs == nil {
    logger.Warningf("collection %s missing from config package; skipping", dig.Collection)
    return
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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