hyperledger/fabric · error

The required parameter 'name' is empty. Rerun the command wi

Error message

The required parameter 'name' is empty. Rerun the command with -n flag

What it means

Input validation in ApproveForMyOrgInput.Validate: the -n (name) flag is empty, so the chaincode whose definition is being approved is unspecified. A pure CLI usage guard fired before proposal creation.

Source

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

	EndorsementPlugin        string
	ValidationPlugin         string
	ValidationParameterBytes []byte
	CollectionConfigPackage  *pb.CollectionConfigPackage
	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.",

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Rerun the command adding -n <chaincode-name>
  2. Set the Name field programmatically when constructing ApproveForMyOrgInput
  3. Use the package label or `peer lifecycle chaincode calculatepackageid` to confirm the correct chaincode name
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/peer/lifecycle/chaincode/approveformyorg.go:67 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/1e6990b0357e0b9d. Report an issue: GitHub.