hyperledger/fabric · error
capabilities not passed in init
Error message
capabilities not passed in init
What it means
Init() returns this error when the capabilities dependency is nil. The validator consults the channel capabilities (e.g. whether collection config upgrades, key-level validation, or v1.2+ features are enabled) to decide which validation paths to apply. Without capabilities it cannot validate safely and refuses to start.
Source
Thrown at core/handlers/validation/builtin/default_validation.go:134
}
if stateFetcher, isStateFetcher := dep.(vs.StateFetcher); isStateFetcher {
sf = stateFetcher
}
if policyEvaluator, isPolicyFetcher := dep.(vp.PolicyEvaluator); isPolicyFetcher {
pe = policyEvaluator
}
if collectionResources, isCollectionResources := dep.(plugindispatcher.CollectionResources); isCollectionResources {
cor = collectionResources
}
}
if sf == nil {
return errors.New("stateFetcher not passed in init")
}
if d == nil {
return errors.New("identityDeserializer not passed in init")
}
if c == nil {
return errors.New("capabilities not passed in init")
}
if pe == nil {
return errors.New("policy fetcher not passed in init")
}
if cor == nil {
return errors.New("collection resources not passed in init")
}
v.Capabilities = c
v.TxValidatorV1_2 = v12.New(c, sf, d, pe)
v.TxValidatorV1_3 = v13.New(c, sf, d, pe)
v.TxValidatorV2_0 = v20.New(c, sf, d, pe, cor)
return nil
}
View on GitHub (pinned to 2736b63f8f)
Solutions
- Supply the channel Capabilities object (typically from the channelconfig/capabilities provider) to Init()
- Check that dependency assembly for validation handlers includes all five required deps (sf, d, c, pe, cor)
- Update custom plugin code after version upgrades so new required dependencies are provided
Example fix
// before err := handler.Init(sf, deserializer, nil, policyEvaluator, collectionResources) // after caps := channelconfig.NewApplicationCapabilities(...) err := handler.Init(sf, deserializer, caps, policyEvaluator, collectionResources)
Defensive patterns
Strategy: validation
Validate before calling
if c == nil {
return errors.New("cannot init validation handler: Capabilities dependency is nil")
}
err := handler.Init(sf, d, c, pe, cor) Type guard
func depsComplete(c Capabilities) bool { return c != nil } Prevention
- Fetch channel capabilities from the channel config before creating validators
- Update custom plugins when new versions add required dependencies
- Verify Init is called only after channelconfig is loaded
When it happens
Trigger: Calling Init() with c == nil: constructing the built-in validation handler without a Capabilities provider in the dependency map.
Common situations: Hand-rolled plugin constructors omitting channel capabilities; peers created before capabilities were wired in newer versions; test harnesses with incomplete dependency stubs.
Related errors
- stateFetcher not passed in init
- identityDeserializer not passed in init
- policy fetcher not passed in init
- Error in instantiating ledger provider: %+v
- %s capability %s is required but not supported
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/1a32c5cd306a1b37.
Report an issue: GitHub.