hyperledger/fabric · error

could not find SigningIdentityFetcher in dependencies

Error message

could not find SigningIdentityFetcher in dependencies

What it means

The pluggable endorsement DefaultEndorsement.Init scans injected dependencies for a SigningIdentityFetcher and returns this error when none is found. Without the fetcher the plugin cannot obtain a signer for any proposal, so initialization fails fast.

Source

Thrown at core/handlers/endorsement/plugin/plugin.go:71

	signature, err := signer.Sign(append(prpBytes, identityBytes...))
	if err != nil {
		return nil, nil, fmt.Errorf("could not sign the proposal response payload: %v", err)
	}
	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")
}

// NewPluginFactory is the function ran by the plugin infrastructure to create an endorsement plugin factory.
func NewPluginFactory() endorsement.PluginFactory {
	return &DefaultEndorsementFactory{}
}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Register the peer's signing identity service (mgmt.GetLocalSignerService) into the dependencies passed to Init
  2. Mirror the builtin factory's dependency construction when writing a custom NewPluginFactory
  3. Verify with the current Fabric version's core handlers registry that dependencies are appended before plugin.Init runs

Example fix

// before: dependencies missing the fetcher
err := plugin.Init([]interface{}{myOtherDep})
// after: include a SigningIdentityFetcher implementation
err := plugin.Init([]interface{}{myOtherDep, mgmt.GetLocalSignerService()})
Defensive patterns

Strategy: validation

Validate before calling

deps := buildDependencies(peerServices) // must include mgmt signer service
for _, d := range deps {
    if _, ok := d.(mgmt.SigningIdentityFetcher); ok {
        return plugin.Init(deps)
    }
}
return errors.New("refusing Init: no SigningIdentityFetcher in deps")

Type guard

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

Try / catch

if err := pl.Init(deps); err != nil {
    return nil, fmt.Errorf("cannot start endorsement plugin: %w", err)
}

Prevention

When it happens

Trigger: Init (used by EndorseWithPlugin path and plugin factory instantiation) is passed a dependencies list that contains no implementation of SigningIdentityFetcher — the plugin loader did not register the peer's signing identity service or a test/plugin host supplied an incomplete dependency set.

Common situations: Endorsement plugin loaded via a custom factory that drops the peer's mgmt dependencies; Fabric upgrade changed how core services are registered into plugin instances; unit tests constructing DefaultEndorsement directly without Init.

Related errors


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