{"record":{"id":"52cbf089b38cced5","repo":"hyperledger/fabric","slug":"the-required-parameter-channelid-is-empty-rerun-52cbf0","errorCode":null,"errorMessage":"the required parameter 'channelID' is empty. Rerun the command with -c flag","messagePattern":"the required parameter 'channelID' is empty\\. Rerun the command with -c flag","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/snapshot/listpending.go","lineNumber":81,"sourceCode":"\t\tChannelId:       channelID,\n\t}\n\tsignedRequest, err := signSnapshotRequest(cl.signer, query)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresp, err := cl.snapshotClient.QueryPendings(context.Background(), signedRequest)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to list pending requests\")\n\t}\n\n\tfmt.Fprintf(cl.writer, \"Successfully got pending snapshot requests: %v\\n\", resp.BlockNumbers)\n\treturn nil\n}\n\nfunc validateListPending() error {\n\tif channelID == \"\" {\n\t\treturn errors.New(\"the required parameter 'channelID' is empty. Rerun the command with -c flag\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":63,"sourceCodeEnd":85,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/snapshot/listpending.go#L63-L85","documentation":"The peer snapshot listpending command queries the peer for all pending snapshot requests on a channel, which is identified by the mandatory -c/--channelID flag. validateListPending returns this error when channelID is empty, preventing an ambiguous channel-scoped gRPC call.","triggerScenarios":"Running 'peer snapshot listpending' without -c/--channelID, or with an empty string value.","commonSituations":"Automation scripts where the channel variable was unset; running the command outside a script that normally exports CHANNEL; omitting the flag because other peer commands default the channel.","solutions":["Rerun with: peer snapshot listpending -c <channelID>.","Export/verify the channel variable in scripts before invoking: echo \"$CHANNEL\".","Add [ -n \"$CHANNEL\" ] || exit 1 guards in shell automation."],"exampleFix":"// before\npeer snapshot listpending\n// after\npeer snapshot listpending -c mychannel","handlingStrategy":"validation","validationCode":"if [ -z \"$CHANNEL\" ]; then echo \"channelID required\"; exit 1; fi\npeer snapshot listpending -c \"$CHANNEL\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Export the channel ID once per script/session","Check [ -n \"$CHANNEL\" ] before channel-scoped commands","Note: unlike some peer commands, snapshot subcommands have no channel default"],"tags":["cli","snapshot","missing-flag","fabric"],"backgroundTag":"missing-required-flag","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"}