hyperledger/fabric · error
Must supply channel ID
Error message
Must supply channel ID
What it means
The `peer node pause` command pauses a channel on an offline peer, but it requires the channel ID via --channelID (or -c). If the channelID flag is unset (the UndefinedParamValue sentinel), RunE returns this error and the channel is not paused.
Source
Thrown at internal/peer/node/pause.go:30
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
func pauseCmd() *cobra.Command {
pauseChannelCmd.ResetFlags()
flags := pauseChannelCmd.Flags()
flags.StringVarP(&channelID, "channelID", "c", common.UndefinedParamValue, "Channel to pause.")
return pauseChannelCmd
}
var pauseChannelCmd = &cobra.Command{
Use: "pause",
Short: "Pauses a channel on the peer.",
Long: `Pauses a channel on the peer. When the command is executed, the peer must be offline. When the peer starts after pause, it will not receive blocks for the paused channel.`,
RunE: func(cmd *cobra.Command, args []string) error {
if channelID == common.UndefinedParamValue {
return errors.New("Must supply channel ID")
}
config := ledgerConfig()
return kvledger.PauseChannel(config.RootFSPath, channelID)
},
}
View on GitHub (pinned to 2736b63f8f)
Solutions
- Re-run with the channel: `peer node pause -c <channelID>` (peer must be offline).
- Verify the flag is spelled `--channelID` (case-sensitive) so it binds to channelID.
- Check your script/env var actually contains the channel name, not an empty string.
Example fix
// before peer node pause // after peer node pause -c mychannel
Defensive patterns
Strategy: validation
Validate before calling
if [ -z "$CHANNEL" ]; then echo "usage: peer node pause -c <channelID>" >&2; exit 1; fi peer node pause -c "$CHANNEL"
Try / catch
if err := runPause(); err != nil && err.Error() == "Must supply channel ID" {
return fmt.Errorf("usage: peer node pause -c <channelID>")
} Prevention
- Always pass -c/--channelID explicitly; never rely on defaults.
- Wrap commands in scripts that validate non-empty channel IDs first.
- Note the flag name is case-sensitive: --channelID.
When it happens
Trigger: Running `peer node pause` without providing --channelID / -c.
Common situations: Forgot the -c flag; misspelled flag name so it is not parsed into channelID; scripting the pause of many channels and omitting the variable holding the channel name.
Related errors
- Must supply channel ID
- no endorser clients retrieved - this might indicate a bug
- orderer is required, but no ordering endpoint or endorser cl
- cannot create proposal, due to %s
- cannot create signed proposal, due to %s
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/f3d23d05e9733c58.
Report an issue: GitHub.