{"record":{"id":"a6344e8c28421470","repo":"hyperledger/fabric","slug":"owner-not-provided","errorCode":null,"errorMessage":"owner not provided","messagePattern":"owner not provided","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/common/ccpackage/ccpackage.go","lineNumber":205,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Could not sign the ccpackage, err %s\", err)\n\t\t}\n\n\t\t// each owner starts off the endorsements with one element. All such endorsed\n\t\t// packages will be collected in a final package by CreateSignedCCDepSpecForInstall\n\t\t// when endorsements will have all the entries\n\t\tendorsements = make([]*peer.Endorsement, 1)\n\n\t\tendorsements[0] = &peer.Endorsement{Signature: signature, Endorser: endorser}\n\t}\n\n\treturn createSignedCCDepSpec(cdsbytes, instpolicybytes, endorsements)\n}\n\n// SignExistingPackage adds a signature to a signed package.\nfunc SignExistingPackage(env *common.Envelope, owner identity.SignerSerializer) (*common.Envelope, error) {\n\tif owner == nil {\n\t\treturn nil, errors.New(\"owner not provided\")\n\t}\n\n\tch, sdepspec, err := ExtractSignedCCDepSpec(env)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif ch == nil {\n\t\treturn nil, errors.New(\"channel header not found in the envelope\")\n\t}\n\n\tif sdepspec == nil || sdepspec.ChaincodeDeploymentSpec == nil || sdepspec.InstantiationPolicy == nil || sdepspec.OwnerEndorsements == nil {\n\t\treturn nil, errors.New(\"invalid signed deployment spec\")\n\t}\n\n\t// serialize the signing identity\n\tendorser, err := owner.Serialize()\n\tif err != nil {","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/common/ccpackage/ccpackage.go#L187-L223","documentation":"SignExistingPackage adds an owner's endorsement to an already-signed chaincode package. It requires a SignerSerializer for the owner; if the owner argument is nil there is no identity to serialize or sign with, so the call fails immediately with this sentinel error.","triggerScenarios":"Calling SignExistingPackage(env, nil) — e.g. the signer lookup (mspmgmt.GetLocalMSP().GetDefaultSigner()) returned nil without error, or a nil variable was passed in a batch-signing loop.","commonSituations":"Tooling that signs packages collected from multiple orgs where one org's signer failed to load; scripts running outside the peer context where no local MSP signer was set; tests passing nil deliberately.","solutions":["Obtain a valid signer before calling: signer, err := mspmgmt.GetLocalMSP().GetDefaultSigner(); handle the error instead of passing nil","If signing is optional, use OwnerCreateSignedCCDepSpec with owner=nil instead of SignExistingPackage (it allows nil owner)","Add a nil check for the signer variable at the call site"],"exampleFix":"// before\nenv, err := ccpackage.SignExistingPackage(env, signer) // signer may be nil\n// after\nif signer == nil {\n    return errors.New(\"no signer available: initialize local MSP first\")\n}\nenv, err := ccpackage.SignExistingPackage(env, signer)","handlingStrategy":"validation","validationCode":"if owner == nil {\n    return errors.New(\"SignExistingPackage requires a signer; initialize local MSP first\")\n}\nenv, err := ccpackage.SignExistingPackage(env, owner)","typeGuard":"func hasSigner(s identity.SignerSerializer) bool { return s != nil }","tryCatchPattern":"env, err := ccpackage.SignExistingPackage(env, owner)\nif err != nil {\n    if err.Error() == \"owner not provided\" {\n        return fmt.Errorf(\"load signer via mspmgmt.GetLocalMSP().GetDefaultSigner(): %w\", err)\n    }\n    return err\n}","preventionTips":["Resolve the signer at startup and fail fast if absent","Do not pass optional/nil signers to SignExistingPackage; use OwnerCreateSignedCCDepSpec for unsigned flows","Log signer identity at debug level to confirm it loaded"],"tags":["hyperledger-fabric","nil-argument","signing","chaincode-package"],"backgroundTag":"nil-argument","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"}