{"record":{"id":"331755dbcfe44996","repo":"hyperledger/fabric","slug":"chaincode-install-package-must-be-provided-331755","errorCode":null,"errorMessage":"chaincode install package must be provided","messagePattern":"chaincode install package must be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/install.go","lineNumber":49,"sourceCode":"type Installer struct {\n\tCommand        *cobra.Command\n\tEndorserClient EndorserClient\n\tInput          *InstallInput\n\tReader         Reader\n\tSigner         Signer\n}\n\n// InstallInput holds the input parameters for installing\n// a chaincode.\ntype InstallInput struct {\n\tPackageFile string\n}\n\n// Validate checks that the required install parameters\n// are provided.\nfunc (i *InstallInput) Validate() error {\n\tif i.PackageFile == \"\" {\n\t\treturn errors.New(\"chaincode install package must be provided\")\n\t}\n\n\treturn nil\n}\n\n// InstallCmd returns the cobra command for chaincode install.\nfunc InstallCmd(i *Installer, cryptoProvider bccsp.BCCSP) *cobra.Command {\n\tchaincodeInstallCmd := &cobra.Command{\n\t\tUse:       \"install [packageFile]\",\n\t\tShort:     \"Install a chaincode.\",\n\t\tLong:      \"Install a chaincode on a peer.\",\n\t\tValidArgs: []string{\"1\"},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif i == nil {\n\t\t\t\tccInput := &ClientConnectionsInput{\n\t\t\t\t\tCommandName:           cmd.Name(),\n\t\t\t\t\tEndorserRequired:      true,\n\t\t\t\t\tPeerAddresses:         peerAddresses,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/install.go#L31-L67","documentation":"InstallInput.Validate() requires a chaincode package file path; the --package-type install flow was invoked without one. This is a pure client-side input validation error raised before any network call is made.","triggerScenarios":"Running `peer lifecycle chaincode install` without the --path/-p... more precisely without providing the package file flag (i.PackageFile empty), e.g. missing the path to a packaged chaincode tar.gz produced by `package`.","commonSituations":"Forgetting the required flag in CI scripts; flag renamed/moved between Fabric versions causing it to be dropped; copy-pasted command missing arguments.","solutions":["Pass the package file, e.g. `peer lifecycle chaincode install --path ./archive.tgz` (or the flag your version uses, e.g. a packaged chaincode .tar.gz).","Run `peer lifecycle chaincode package` first to create the package, then install it.","Review `peer lifecycle chaincode install --help` for the exact flag name in your Fabric version.","Fix CI scripts/env files so the package path variable is set."],"exampleFix":"// before\npeer lifecycle chaincode install\n// after\npeer lifecycle chaincode install --path ./mycc.tar.gz","handlingStrategy":"validation","validationCode":"if pkgFile == \"\" {\n    return errors.New(\"--package file path is required\")\n}\nif st, err := os.Stat(pkgFile); err != nil || st.IsDir() {\n    return fmt.Errorf(\"package file %s not found\", pkgFile)\n}","typeGuard":null,"tryCatchPattern":"if err := installCmd.Run(); err != nil {\n    if strings.Contains(err.Error(), \"must be provided\") {\n        // fix script to pass the package path\n    }\n    return err\n}","preventionTips":["Always pass the package path flag","Run `chaincode package` before `install`","Check --help for your Fabric version's flag name","Assert required env/args in CI scripts"],"tags":["fabric","cli","validation","missing-argument"],"backgroundTag":"missing-required-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"}