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

  1. Re-run with the channel: `peer node pause -c <channelID>` (peer must be offline).
  2. Verify the flag is spelled `--channelID` (case-sensitive) so it binds to channelID.
  3. 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

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


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/f3d23d05e9733c58. Report an issue: GitHub.