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
This error is thrown by CommitReadinessCheckInput.Validate() when the chaincode 'name' field is empty. The checkcommitreadiness command builds a proposal to query a peer for the approval status of a chaincode definition, and 'name' is a mandatory field of that definition. The library fails fast client-side before any network call, telling the user to re-run with the -n flag.
Source
Thrown at internal/peer/lifecycle/chaincode/checkcommitreadiness.go:70
EndorsementPlugin string
ValidationPlugin string
ValidationParameterBytes []byte
CollectionConfigPackage *pb.CollectionConfigPackage
InitRequired bool
PeerAddresses []string
TxID string
OutputFormat string
InspectionEnabled bool
}
// Validate the input for a CheckCommitReadiness proposal
func (c *CommitReadinessCheckInput) Validate() error {
if c.ChannelID == "" {
return errors.New("The required parameter 'channelID' is empty. Rerun the command with -C flag")
}
if c.Name == "" {
return errors.New("The required parameter 'name' is empty. Rerun the command with -n flag")
}
if c.Version == "" {
return errors.New("The required parameter 'version' is empty. Rerun the command with -v flag")
}
if c.Sequence == 0 {
return errors.New("The required parameter 'sequence' is empty. Rerun the command with --sequence flag")
}
return nil
}
// CheckCommitReadinessCmd returns the cobra command for the
// CheckCommitReadiness lifecycle operation
func CheckCommitReadinessCmd(c *CommitReadinessChecker, cryptoProvider bccsp.BCCSP) *cobra.Command {
chaincodeCheckCommitReadinessCmd := &cobra.Command{
Use: "checkcommitreadiness",View on GitHub (pinned to 2736b63f8f)
Solutions
- Re-run the command with the -n flag, e.g. 'peer lifecycle chaincode checkcommitreadiness -C mychannel -n mycc -v 1.0 -s 1'
- In Go, set the Name field on CommitReadinessCheckInput before calling Validate/ReadinessCheck
- Fix the script/env variable that supplies the chaincode name so it is non-empty
Example fix
// before
c := &client.CommitReadinessCheckInput{ChannelID: "mychannel"}
c.Validate() // error: required parameter 'name' is empty
// after
c := &client.CommitReadinessCheckInput{ChannelID: "mychannel", Name: "mycc", Version: "1.0", Sequence: 1}
c.Validate() // nil Defensive patterns
Strategy: validation
Validate before calling
func validate(input *CommitReadinessCheckInput) error {
if input.Name == "" {
return fmt.Errorf("-n/--name is required: pass the chaincode name")
}
return nil
} Try / catch
if err := input.Validate(); err != nil {
if strings.Contains(err.Error(), "'name' is empty") {
// prompt/fix the name flag and re-run
}
return err
} Prevention
- Always pass -n <chaincode-name> when running checkcommitreadiness
- In Go, construct CommitReadinessCheckInput with all fields set via a constructor/helper that asserts non-empty Name
- Validate CLI/env inputs in scripts before invoking the command
When it happens
Trigger: Calling ReadinessCheck (or running 'peer lifecycle chaincode checkcommitreadiness') with a CommitReadinessCheckInput whose Name field is the empty string, e.g. because the --name/-n flag was omitted or bound from an empty variable.
Common situations: Scripted CI pipelines where the chaincode name variable is unset; copying example commands that omit -n; Go programs constructing CommitReadinessCheckInput{} without setting Name.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- The required parameter 'version' is empty. Rerun the command
- The required parameter 'sequence' is empty. Rerun the comman
- non-empty JSON chaincode parameters must contain the followi
- empty JSON chaincode parameters must contain the following k
- The required parameter 'channelID' is empty. Rerun the comma
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/460ba5bd6c51f323.
Report an issue: GitHub.