hyperledger/fabric · error

could not find SigningIdentityFetcher in dependencies

Error message

could not find SigningIdentityFetcher in dependencies

What it means

The default endorsement plugin's Init injects dependencies from a dependency registry; it iterates over them looking for a SigningIdentityFetcher and errors if none is present. The plugin cannot fetch a signing identity for endorsement without this dependency, so initialization aborts.

Source

Thrown at core/handlers/endorsement/builtin/default_endorsement.go:65

	signature, err := signer.Sign(append(prpBytes, identityBytes...))
	if err != nil {
		return nil, nil, errors.Wrapf(err, "could not sign the proposal response payload")
	}
	endorsement := &peer.Endorsement{Signature: signature, Endorser: identityBytes}
	return endorsement, prpBytes, nil
}

// Init injects dependencies into the instance of the Plugin
func (e *DefaultEndorsement) Init(dependencies ...endorsement.Dependency) error {
	for _, dep := range dependencies {
		sIDFetcher, isSigningIdentityFetcher := dep.(identities.SigningIdentityFetcher)
		if !isSigningIdentityFetcher {
			continue
		}
		e.SigningIdentityFetcher = sIDFetcher
		return nil
	}
	return errors.New("could not find SigningIdentityFetcher in dependencies")
}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Ensure the plugin factory builds the plugin with dependencies that include a SigningIdentityFetcher (via peer's mgmt.GetLocalSignerService / DeserializersManager registration)
  2. Check that the plugin is loaded inside the peer process, where core handlers auto-register the fetcher dependency
  3. Update the custom factory to mirror the builtin DefaultEndorsementFactory's dependency list for the current Fabric version

Example fix

// before: custom factory omits the fetcher
func (f *MyFactory) New() endorsement.Plugin {
    return &builtin.DefaultEndorsement{}
} // Init gets no SigningIdentityFetcher
// after: register the fetcher alongside the plugin
plugin := &builtin.DefaultEndorsement{}
plugin.Init([]interface{}{mgmt.GetLocalSigningIdentityOrPanic()}) // implements SigningIdentityFetcher
return plugin
Defensive patterns

Strategy: validation

Validate before calling

deps := []interface{}{mgmt.GetLocalSignerService()}
hasFetcher := false
for _, d := range deps {
    if _, ok := d.(mgmt.SigningIdentityFetcher); ok { hasFetcher = true }
}
if !hasFetcher { return errors.New("SigningIdentityFetcher must be registered before Init") }
return plugin.Init(deps)

Type guard

func hasIdentityFetcher(deps []interface{}) bool {
    for _, d := range deps {
        if _, ok := d.(mgmt.SigningIdentityFetcher); ok { return true }
    }
    return false
}

Try / catch

if err := plugin.Init(deps); err != nil {
    return fmt.Errorf("plugin init failed: %w", err)
}

Prevention

When it happens

Trigger: Calling Init on the builtin DefaultEndorsement when the dependencies slice passed by the plugin/discovery infrastructure contains no element implementing mgmt.SigningIdentityFetcher — a wiring/registration bug in the plugin loader or a custom plugin factory that drops the dependency.

Common situations: Custom endorsement plugin registered with a factory that does not append the signing identity fetcher; Fabric version upgrade where the dependency registration API changed; running the plugin outside the peer process (e.g. in tests) without registering the fetcher.

Related errors


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