{"record":{"id":"f3a6e98b3b06caa5","repo":"hyperledger/fabric","slug":"could-not-find-signingidentityfetcher-in-dependenc-f3a6e9","errorCode":null,"errorMessage":"could not find SigningIdentityFetcher in dependencies","messagePattern":"could not find SigningIdentityFetcher in dependencies","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/endorsement/plugin/plugin.go","lineNumber":71,"sourceCode":"\tsignature, err := signer.Sign(append(prpBytes, identityBytes...))\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"could not sign the proposal response payload: %v\", err)\n\t}\n\tendorsement := &peer.Endorsement{Signature: signature, Endorser: identityBytes}\n\treturn endorsement, prpBytes, nil\n}\n\n// Init injects dependencies into the instance of the Plugin\nfunc (e *DefaultEndorsement) Init(dependencies ...endorsement.Dependency) error {\n\tfor _, dep := range dependencies {\n\t\tsIDFetcher, isSigningIdentityFetcher := dep.(identities.SigningIdentityFetcher)\n\t\tif !isSigningIdentityFetcher {\n\t\t\tcontinue\n\t\t}\n\t\te.SigningIdentityFetcher = sIDFetcher\n\t\treturn nil\n\t}\n\treturn errors.New(\"could not find SigningIdentityFetcher in dependencies\")\n}\n\n// NewPluginFactory is the function ran by the plugin infrastructure to create an endorsement plugin factory.\nfunc NewPluginFactory() endorsement.PluginFactory {\n\treturn &DefaultEndorsementFactory{}\n}\n","sourceCodeStart":53,"sourceCodeEnd":78,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/endorsement/plugin/plugin.go#L53-L78","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Register the peer's signing identity service (mgmt.GetLocalSignerService) into the dependencies passed to Init","Mirror the builtin factory's dependency construction when writing a custom NewPluginFactory","Verify with the current Fabric version's core handlers registry that dependencies are appended before plugin.Init runs"],"exampleFix":"// before: dependencies missing the fetcher\nerr := plugin.Init([]interface{}{myOtherDep})\n// after: include a SigningIdentityFetcher implementation\nerr := plugin.Init([]interface{}{myOtherDep, mgmt.GetLocalSignerService()})","handlingStrategy":"validation","validationCode":"deps := buildDependencies(peerServices) // must include mgmt signer service\nfor _, d := range deps {\n    if _, ok := d.(mgmt.SigningIdentityFetcher); ok {\n        return plugin.Init(deps)\n    }\n}\nreturn errors.New(\"refusing Init: no SigningIdentityFetcher in deps\")","typeGuard":"func includesFetcher(deps []interface{}) (mgmt.SigningIdentityFetcher, bool) {\n    for _, d := range deps {\n        if f, ok := d.(mgmt.SigningIdentityFetcher); ok { return f, true }\n    }\n    return nil, false\n}","tryCatchPattern":"if err := pl.Init(deps); err != nil {\n    return nil, fmt.Errorf(\"cannot start endorsement plugin: %w\", err)\n}","preventionTips":["Use the plugin factory pattern so the peer injects its services","Keep custom factories in sync with builtin dependency lists per Fabric release","Unit-test Init with the real dependency set","Fail fast at startup, not at first Endorse"],"tags":["fabric","endorsement-plugin","dependency-injection","plugin-init","wiring"],"backgroundTag":"missing-dependency-injection","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}