{"record":{"id":"310ce105587d1874","repo":"hyperledger/fabric","slug":"expect-utmost-1-endorsement-from-a-owner","errorCode":null,"errorMessage":"expect utmost 1 endorsement from a owner","messagePattern":"expect utmost 1 endorsement from a owner","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/common/ccpackage/ccpackage.go","lineNumber":62,"sourceCode":"// package workflow. In particular\n//     OwnerCreateSignedCCDepSpec - each owner creates signs the package using the same deploy\n//     CreateSignedCCDepSpecForInstall - an admin or owner creates the package to be installed\n//                                       using the packages from OwnerCreateSignedCCDepSpec\n\n// ValidateCip validate the endorsed package against the base package\nfunc ValidateCip(baseCip, otherCip *peer.SignedChaincodeDeploymentSpec) error {\n\tif baseCip == nil || otherCip == nil {\n\t\tpanic(\"do not call with nil parameters\")\n\t}\n\n\tif (baseCip.OwnerEndorsements == nil && otherCip.OwnerEndorsements != nil) || (baseCip.OwnerEndorsements != nil && otherCip.OwnerEndorsements == nil) {\n\t\treturn errors.New(\"endorsements should either be both nil or not nil\")\n\t}\n\n\tbN := len(baseCip.OwnerEndorsements)\n\toN := len(otherCip.OwnerEndorsements)\n\tif bN > 1 || oN > 1 {\n\t\treturn errors.New(\"expect utmost 1 endorsement from a owner\")\n\t}\n\n\tif bN != oN {\n\t\treturn fmt.Errorf(\"Rule-all packages should be endorsed or none should be endorsed failed for (%d, %d)\", bN, oN)\n\t}\n\n\tif !bytes.Equal(baseCip.ChaincodeDeploymentSpec, otherCip.ChaincodeDeploymentSpec) {\n\t\treturn fmt.Errorf(\"Rule-all deployment specs should match(%d, %d)\", len(baseCip.ChaincodeDeploymentSpec), len(otherCip.ChaincodeDeploymentSpec))\n\t}\n\n\tif !bytes.Equal(baseCip.InstantiationPolicy, otherCip.InstantiationPolicy) {\n\t\treturn fmt.Errorf(\"Rule-all instantiation policies should match(%d, %d)\", len(baseCip.InstantiationPolicy), len(otherCip.InstantiationPolicy))\n\t}\n\n\treturn nil\n}\n\nfunc createSignedCCDepSpec(cdsbytes []byte, instpolicybytes []byte, endorsements []*peer.Endorsement) (*common.Envelope, error) {","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/common/ccpackage/ccpackage.go#L44-L80","documentation":"ValidateCip detected more than one OwnerEndorsement in a single package. Each owner package may carry at most one endorsement (its own), so multiple endorsements indicate a duplicated or tampered package.","triggerScenarios":"Thrown at core/common/ccpackage/ccpackage.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Have each owner produce a package containing only their own single endorsement","Rebuild the package set using OwnerCreateSignedCCDepSpec per owner"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}