{"record":{"id":"0ed0a7ad58ec9cbb","repo":"hyperledger/fabric","slug":"failed-fetching-signing-identity-v","errorCode":null,"errorMessage":"failed fetching signing identity: %v","messagePattern":"failed fetching signing identity: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/endorsement/plugin/plugin.go","lineNumber":44,"sourceCode":"// New returns an endorsement plugin that behaves as the default endorsement system chaincode\nfunc (*DefaultEndorsementFactory) New() endorsement.Plugin {\n\treturn &DefaultEndorsement{}\n}\n\n// DefaultEndorsement is an endorsement plugin that behaves as the default endorsement system chaincode\ntype DefaultEndorsement struct {\n\tidentities.SigningIdentityFetcher\n}\n\n// Endorse signs the given payload(ProposalResponsePayload bytes), and optionally mutates it.\n// Returns:\n// The Endorsement: A signature over the payload, and an identity that is used to verify the signature\n// The payload that was given as input (could be modified within this function)\n// Or error on failure\nfunc (e *DefaultEndorsement) Endorse(prpBytes []byte, sp *peer.SignedProposal) (*peer.Endorsement, []byte, error) {\n\tsigner, err := e.SigningIdentityForRequest(sp)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed fetching signing identity: %v\", err)\n\t}\n\t// serialize the signing identity\n\tidentityBytes, err := signer.Serialize()\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"could not serialize the signing identity: %v\", err)\n\t}\n\n\t// sign the concatenation of the proposal response and the serialized endorser identity with this endorser's key\n\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 {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/endorsement/plugin/plugin.go#L26-L62","documentation":"The pluggable endorsement framework's DefaultEndorsement (core/handlers/endorsement/plugin) fetches the signing identity for the incoming signed proposal via SigningIdentityForRequest. If that lookup fails it returns 'failed fetching signing identity: %v'. This means no local signing identity can be resolved for the proposal's creator/channel context.","triggerScenarios":"Endorse (called by EndorseWithPlugin or TestEndorsementPlugin) receives a SignedProposal whose creator/identity cannot be mapped to a signing identity, or the SigningIdentityFetcher dependency was never injected, or the channel MSP does not recognize the proposal creator.","commonSituations":"Plugin used before Init populated the fetcher; proposal signed with an identity from an MSP unknown to the peer; client cert expired or revoked so the deserializer cannot build the signer; testing the plugin without registering the fetcher dependency.","solutions":["Confirm the plugin's Init was called with a SigningIdentityFetcher before Endorse","Verify the proposal creator's certificate is issued by an MSP the peer knows (channel/local MSP config)","Check the wrapped error to distinguish missing-fetcher vs unknown-identity and re-register or re-provision accordingly","For tests, inject a mock SigningIdentityFetcher returning a valid SigningIdentity"],"exampleFix":"// before: plugin used without dependency injection\nplugin := &plugin.DefaultEndorsement{}\nendorsement, _, _ := plugin.Endorse(prp, sp) // failed fetching signing identity\n// after\nplugin := &plugin.DefaultEndorsement{}\nerr := plugin.Init([]interface{}{mockSigningIdentityFetcher{}})\nif err != nil { return err }\nendorsement, _, err := plugin.Endorse(prp, sp)","handlingStrategy":"try-catch","validationCode":"plugin := &plugin.DefaultEndorsement{}\nif err := plugin.Init([]interface{}{signerFetcher}); err != nil {\n    return fmt.Errorf(\"endorsement plugin not initialized: %w\", err)\n}","typeGuard":"func readyToEndorse(p *plugin.DefaultEndorsement, f mgmt.SigningIdentityFetcher) bool {\n    return f != nil && p.Init([]interface{}{f}) == nil\n}","tryCatchPattern":"endorsement, prp, err := pl.Endorse(prpBytes, sp)\nif err != nil {\n    if strings.Contains(err.Error(), \"failed fetching signing identity\") {\n        // re-init plugin or check proposal creator MSP\n        return nil, fmt.Errorf(\"identity resolution failed: %w\", err)\n    }\n    return nil, err\n}","preventionTips":["Call Init before Endorse in every plugin host/test","Validate the proposal creator belongs to a known channel MSP","Check certificate expiry of client identities","Log wrapped errors to distinguish fetcher-missing vs unknown-identity"],"tags":["fabric","endorsement-plugin","signing-identity","msp","proposal-endorsement"],"backgroundTag":"signing-identity-fetch-failed","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"}