hyperledger/fabric · critical
peer.gossip.pvtData.implicitCollectionDisseminationPolicy.re
Error message
peer.gossip.pvtData.implicitCollectionDisseminationPolicy.requiredPeerCount (%d) cannot be less than zero
What it means
loadPrivDataConfig panics when the configured implicit collection dissemination requiredPeerCount is negative. requiredPeerCount is the number of peers that must each acknowledge private data dissemination, so a negative value is nonsensical and the gossip privdata layer fails fast at config load time via panic rather than returning an error.
Source
Thrown at gossip/privdata/config.go:77
c.ReconcileBatchSize = viper.GetInt("peer.gossip.pvtData.reconcileBatchSize")
if c.ReconcileBatchSize == 0 {
logger.Warning("Configuration key peer.gossip.pvtData.reconcileBatchSize isn't set, defaulting to", reconcileBatchSizeDefault)
c.ReconcileBatchSize = reconcileBatchSizeDefault
}
c.ReconciliationEnabled = viper.GetBool("peer.gossip.pvtData.reconciliationEnabled")
requiredPeerCount := viper.GetInt("peer.gossip.pvtData.implicitCollectionDisseminationPolicy.requiredPeerCount")
maxPeerCount := implicitCollectionMaxPeerCountDefault
if viper.Get("peer.gossip.pvtData.implicitCollectionDisseminationPolicy.maxPeerCount") != nil {
// allow override maxPeerCount to 0 that will effectively disable dissemination on the peer
maxPeerCount = viper.GetInt("peer.gossip.pvtData.implicitCollectionDisseminationPolicy.maxPeerCount")
}
if requiredPeerCount < 0 {
panic(fmt.Sprintf("peer.gossip.pvtData.implicitCollectionDisseminationPolicy.requiredPeerCount (%d) cannot be less than zero",
requiredPeerCount))
}
if maxPeerCount < requiredPeerCount {
panic(fmt.Sprintf("peer.gossip.pvtData.implicitCollectionDisseminationPolicy.maxPeerCount (%d) cannot be less than requiredPeerCount (%d)",
maxPeerCount, requiredPeerCount))
}
c.ImplicitCollDisseminationPolicy.RequiredPeerCount = requiredPeerCount
c.ImplicitCollDisseminationPolicy.MaxPeerCount = maxPeerCount
}
View on GitHub (pinned to 2736b63f8f)
Solutions
- Edit core.yaml so requiredPeerCount is >= 0
- Check overriding environment variables for a negative value
- Restore a sane default (typically 1) if the config file was corrupted
Example fix
// before (core.yaml)
peer:
gossip:
pvtData:
implicitCollectionDisseminationPolicy:
requiredPeerCount: -1
// after
requiredPeerCount: 1 Defensive patterns
Strategy: validation
Validate before calling
const required = viper.GetInt("peer.gossip.pvtData.implicitCollectionDisseminationPolicy.requiredPeerCount")
if required < 0 {
return fmt.Errorf("requiredPeerCount %d invalid; must be >= 0", required)
} Prevention
- Validate core.yaml against the schema before peer startup
- Keep requiredPeerCount non-negative (use 0 to disable)
- Audit env var overrides for negative values
- Keep config files under version control to spot accidental edits
When it happens
Trigger: Setting peer.gossip.pvtData.implicitCollectionDisseminationPolicy.requiredPeerCount to a negative number in core.yaml (or via env override) and calling GlobalConfig / loadPrivDataConfig at peer startup.
Common situations: Typo in core.yaml (e.g. -1 placeholder), env var CORE_PEER_GOSSIP_PVTDATA_IMPLICITCOLLDISSEMINATIONPOLICY_REQUIREDPEERCOUNT=-1, templated config that interpolates to a negative number.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- peer.gossip.pvtData.implicitCollectionDisseminationPolicy.ma
- unable to load key at '%s'
- unable to load cert at '%s'
- Block data is empty
- Block header is nil
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/1979ea8a0023338d.
Report an issue: GitHub.