hyperledger/fabric · error

The required parameter 'version' is empty. Rerun the command

Error message

The required parameter 'version' is empty. Rerun the command with -v flag

What it means

Input validation in ApproveForMyOrgInput.Validate: the -v (version) flag is empty. Approving a definition requires the chaincode version to be pinned; without it the proposal would be ambiguous and is rejected up front.

Source

Thrown at internal/peer/lifecycle/chaincode/approveformyorg.go:71

	InitRequired             bool
	PeerAddresses            []string
	WaitForEvent             bool
	WaitForEventTimeout      time.Duration
	TxID                     string
}

// Validate the input for an ApproveChaincodeDefinitionForMyOrg proposal
func (a *ApproveForMyOrgInput) Validate() error {
	if a.ChannelID == "" {
		return errors.New("The required parameter 'channelID' is empty. Rerun the command with -C flag")
	}

	if a.Name == "" {
		return errors.New("The required parameter 'name' is empty. Rerun the command with -n flag")
	}

	if a.Version == "" {
		return errors.New("The required parameter 'version' is empty. Rerun the command with -v flag")
	}

	if a.Sequence == 0 {
		return errors.New("The required parameter 'sequence' is empty. Rerun the command with --sequence flag")
	}

	return nil
}

// ApproveForMyOrgCmd returns the cobra command for chaincode ApproveForMyOrg
func ApproveForMyOrgCmd(a *ApproverForMyOrg, cryptoProvider bccsp.BCCSP) *cobra.Command {
	chaincodeApproveForMyOrgCmd := &cobra.Command{
		Use:   "approveformyorg",
		Short: "Approve the chaincode definition for my org.",
		Long:  "Approve the chaincode definition for my organization.",
		RunE: func(cmd *cobra.Command, args []string) error {
			if a == nil {
				// set input from CLI flags

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Rerun the command adding -v <version>, matching the version used in the package label/install step
  2. Set the Version field programmatically on ApproveForMyOrgInput
  3. Verify the installed package's label/version via `peer lifecycle chaincode queryinstalled`
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/peer/lifecycle/chaincode/approveformyorg.go:71 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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