{"record":{"id":"ed83e75a33c3ffe9","repo":"hyperledger/fabric","slug":"the-required-parameter-sequence-is-empty-rerun","errorCode":null,"errorMessage":"The required parameter 'sequence' is empty. Rerun the command with --sequence flag","messagePattern":"The required parameter 'sequence' is empty\\. Rerun the command with --sequence flag","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/approveformyorg.go","lineNumber":75,"sourceCode":"\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\n\t\t\t\tinput, err := a.createInput()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/approveformyorg.go#L57-L93","documentation":"Input validation in ApproveForMyOrgInput.Validate: the --sequence flag is zero (unset), but approving a definition requires the definition sequence number to be provided. The guard prevents submitting an approval that lacks its position in the definition lifecycle.","triggerScenarios":"Thrown at internal/peer/lifecycle/chaincode/approveformyorg.go:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rerun the command adding --sequence <n>; use `peer lifecycle chaincode queryapproved` or check the committed definition to pick the next sequence","Set the Sequence field programmatically on ApproveForMyOrgInput","For a first approval the sequence is typically 1"],"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"}