{"record":{"id":"e502a7b7d115504e","repo":"hyperledger/fabric","slug":"the-required-parameter-sequence-is-empty-rerun-e502a7","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/checkcommitreadiness.go","lineNumber":78,"sourceCode":"\tInspectionEnabled        bool\n}\n\n// Validate the input for a CheckCommitReadiness proposal\nfunc (c *CommitReadinessCheckInput) Validate() error {\n\tif c.ChannelID == \"\" {\n\t\treturn errors.New(\"The required parameter 'channelID' is empty. Rerun the command with -C flag\")\n\t}\n\n\tif c.Name == \"\" {\n\t\treturn errors.New(\"The required parameter 'name' is empty. Rerun the command with -n flag\")\n\t}\n\n\tif c.Version == \"\" {\n\t\treturn errors.New(\"The required parameter 'version' is empty. Rerun the command with -v flag\")\n\t}\n\n\tif c.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// CheckCommitReadinessCmd returns the cobra command for the\n// CheckCommitReadiness lifecycle operation\nfunc CheckCommitReadinessCmd(c *CommitReadinessChecker, cryptoProvider bccsp.BCCSP) *cobra.Command {\n\tchaincodeCheckCommitReadinessCmd := &cobra.Command{\n\t\tUse:   \"checkcommitreadiness\",\n\t\tShort: \"Check whether a chaincode definition is ready to be committed on a channel.\",\n\t\tLong:  \"Check whether a chaincode definition is ready to be committed on a channel.\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif c == nil {\n\t\t\t\t// set input from CLI flags\n\t\t\t\tinput, err := c.createInput()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/checkcommitreadiness.go#L60-L96","documentation":"This error is thrown by CommitReadinessCheckInput.Validate() when the 'sequence' field is 0. Sequence is a mandatory monotonically increasing integer in a chaincode definition, and the zero value of the Go uint64 field is treated as 'not provided'. The message points to the --sequence CLI flag.","triggerScenarios":"Calling ReadinessCheck with CommitReadinessCheckInput.Sequence == 0, e.g. running the CLI without --sequence, or passing 0 because the caller assumed sequence starts at 0 (it starts at 1).","commonSituations":"First deployment where developers guess sequence 0; forgotten --sequence flag in scripts; a Go caller leaving Sequence at its zero value.","solutions":["Re-run with --sequence set to the next definition number (1 for the first), e.g. 'peer lifecycle chaincode checkcommitreadiness -C mychannel -n mycc -v 1.0 --sequence 1'","In Go, set Sequence: 1 (or the next incremented value) on CommitReadinessCheckInput","Track the current committed sequence with 'peer lifecycle chaincode querycommitted' and increment it"],"exampleFix":"// before\nc := &client.CommitReadinessCheckInput{ChannelID: \"mychannel\", Name: \"mycc\", Version: \"1.0\"}\n// Sequence is 0 -> error\n// after\nc := &client.CommitReadinessCheckInput{ChannelID: \"mychannel\", Name: \"mycc\", Version: \"1.0\", Sequence: 1}","handlingStrategy":"validation","validationCode":"func validate(input *CommitReadinessCheckInput) error {\n    if input.Sequence == 0 {\n        return fmt.Errorf(\"--sequence is required and must be >= 1 (first definition uses 1)\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := input.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"'sequence' is empty\") {\n        // default to committed sequence + 1 and retry\n    }\n    return err\n}","preventionTips":["Remember sequence starts at 1, never 0","Query the committed sequence with 'peer lifecycle chaincode querycommitted -C mychannel' and increment for upgrades","Always include --sequence in checkcommitreadiness scripts"],"tags":["hyperledger-fabric","chaincode","input-validation","cli"],"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"}