{"record":{"id":"f6e2c607cc8ec7e9","repo":"hyperledger/fabric","slug":"the-required-parameter-version-is-empty-rerun-t","errorCode":null,"errorMessage":"The required parameter 'version' is empty. Rerun the command with -v flag","messagePattern":"The required parameter 'version' is empty\\. Rerun the command with -v flag","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/approveformyorg.go","lineNumber":71,"sourceCode":"\tInitRequired             bool\n\tPeerAddresses            []string\n\tWaitForEvent             bool\n\tWaitForEventTimeout      time.Duration\n\tTxID                     string\n}\n\n// Validate the input for an ApproveChaincodeDefinitionForMyOrg proposal\nfunc (a *ApproveForMyOrgInput) Validate() error {\n\tif a.ChannelID == \"\" {\n\t\treturn errors.New(\"The required parameter 'channelID' is empty. Rerun the command with -C flag\")\n\t}\n\n\tif a.Name == \"\" {\n\t\treturn errors.New(\"The required parameter 'name' is empty. Rerun the command with -n flag\")\n\t}\n\n\tif a.Version == \"\" {\n\t\treturn errors.New(\"The required parameter 'version' is empty. Rerun the command with -v flag\")\n\t}\n\n\tif a.Sequence == 0 {\n\t\treturn errors.New(\"The required parameter 'sequence' is empty. Rerun the command with --sequence flag\")\n\t}\n\n\treturn nil\n}\n\n// ApproveForMyOrgCmd returns the cobra command for chaincode ApproveForMyOrg\nfunc ApproveForMyOrgCmd(a *ApproverForMyOrg, cryptoProvider bccsp.BCCSP) *cobra.Command {\n\tchaincodeApproveForMyOrgCmd := &cobra.Command{\n\t\tUse:   \"approveformyorg\",\n\t\tShort: \"Approve the chaincode definition for my org.\",\n\t\tLong:  \"Approve the chaincode definition for my organization.\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif a == nil {\n\t\t\t\t// set input from CLI flags","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/approveformyorg.go#L53-L89","documentation":"Input validation in ApproveForMyOrgInput.Validate: the -v (version) flag is empty. Approving a definition requires the chaincode version to be pinned; without it the proposal would be ambiguous and is rejected up front.","triggerScenarios":"Thrown at internal/peer/lifecycle/chaincode/approveformyorg.go:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rerun the command adding -v <version>, matching the version used in the package label/install step","Set the Version field programmatically on ApproveForMyOrgInput","Verify the installed package's label/version via `peer lifecycle chaincode queryinstalled`"],"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"}