hyperledger/fabric · error
failed initializing plugin
Error message
failed initializing plugin
What it means
initPlugin created a validation plugin instance and called plugin.Init(policyEvaluator, stateFetcher, capabilities, collectionResources); Init returned an error, so Fabric wraps it as 'failed initializing plugin'. This means the plugin itself rejected its initialization (bad policy bytes it could not evaluate, state access failure, or internal plugin error).
Source
Thrown at core/committer/txvalidator/v20/plugindispatcher/plugin_validator.go:208
pluginInstance := pbc.pluginFactory.New()
plugin, err := pbc.initPlugin(pluginInstance, channel)
if err != nil {
return nil, err
}
pbc.channels2Plugins[channel] = plugin
return plugin, nil
}
func (pbc *pluginsByChannel) initPlugin(plugin validation.Plugin, channel string) (validation.Plugin, error) {
pp, err := policy.New(pbc.pv.IdentityDeserializer, channel, pbc.pv.ChannelPolicyManagerGetter)
if err != nil {
return nil, errors.WithMessage(err, "could not obtain a policy evaluator")
}
pe := &PolicyEvaluatorWrapper{IdentityDeserializer: pbc.pv.IdentityDeserializer, PolicyEvaluator: pp}
sf := &StateFetcherImpl{QueryExecutorCreator: pbc.pv}
if err := plugin.Init(pe, sf, pbc.pv.capabilities, pbc.pv.CollectionResources); err != nil {
return nil, errors.Wrap(err, "failed initializing plugin")
}
return plugin, nil
}
type PolicyEvaluatorWrapper struct {
msp.IdentityDeserializer
vp.PolicyEvaluator
}
// Evaluate takes a set of SignedData and evaluates whether this set of signatures satisfies the policy
func (id *PolicyEvaluatorWrapper) Evaluate(policyBytes []byte, signatureSet []*protoutil.SignedData) error {
return id.PolicyEvaluator.Evaluate(policyBytes, signatureSet)
}
// DeserializeIdentity unmarshals the given identity to msp.Identity
func (id *PolicyEvaluatorWrapper) DeserializeIdentity(serializedIdentity []byte) (vi.Identity, error) {
mspIdentity, err := id.IdentityDeserializer.DeserializeIdentity(serializedIdentity)
if err != nil {View on GitHub (pinned to 2736b63f8f)
Solutions
- Read the wrapped cause (errors.Wrap output) in the peer log to find why plugin.Init failed and fix that root cause.
- Re-issue the chaincode definition with a valid, well-formed endorsement policy.
- Upgrade the peer to a version whose capabilities match the plugin's requirements.
- Fix or rebuild the custom validation plugin's Init implementation and redeploy it to all validating peers.
- Retry after repairing state/channel resources if the cause was transient state-fetch failure.
Example fix
// before (custom plugin)
func (p *MyPlugin) Init(...) error { return fmt.Errorf("unsupported policy type") }
// after
func (p *MyPlugin) Init(pe, sf, caps, colRes) error { /* evaluate policy bytes correctly */ return nil } Defensive patterns
Strategy: try-catch
Try / catch
try { validate(tx); } catch (err) { if (/failed initializing plugin/.test(err.message)) { const cause = err.cause ?? err; log.error('plugin init failed:', cause.message); /* fix policy/capability/plugin per cause */ } else { throw err; } } Prevention
- Ensure endorsement-policy bytes are well-formed (test with common/tools/protolator or policy parser).
- Match channel capabilities to plugin requirements.
- Keep chaincode definition policies supported by the peer's plugin.
- Unit-test custom plugin Init before channel deployment.
When it happens
Trigger: First validation of a tx for a chaincode whose plugin instance fails Init — e.g. vscc cannot build an evaluator from the stored endorsement-policy bytes (corrupt/unsupported policy), or a custom plugin's Init errors on its own config/capability checks.
Common situations: Corrupt endorsement-policy bytes in the chaincode definition; plugin requiring a capability the peer/channel does not have (mismatched channel capabilities vs plugin expectations); bugs in custom vscc Init implementations; channel resources (CollectionResources) not available for private-data-aware plugins.
Related errors
- expected ValidationPlugin '%s' does not match passed Validat
- chaincode definition for [%s] is invalid, plugin field must
- plugin with name %s wasn't found
- uninitialized package
- nil data
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/3587db13d3f267f0.
Report an issue: GitHub.