{"record":{"id":"1e6990b0357e0b9d","repo":"hyperledger/fabric","slug":"the-required-parameter-name-is-empty-rerun-the","errorCode":null,"errorMessage":"The required parameter 'name' is empty. Rerun the command with -n flag","messagePattern":"The required parameter 'name' is empty\\. Rerun the command with -n flag","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/approveformyorg.go","lineNumber":67,"sourceCode":"\tEndorsementPlugin        string\n\tValidationPlugin         string\n\tValidationParameterBytes []byte\n\tCollectionConfigPackage  *pb.CollectionConfigPackage\n\tInitRequired             bool\n\tPeerAddresses            []string\n\tWaitForEvent             bool\n\tWaitForEventTimeout      time.Duration\n\tTxID                     string\n}\n\n// Validate the input for an ApproveChaincodeDefinitionForMyOrg proposal\nfunc (a *ApproveForMyOrgInput) Validate() error {\n\tif a.ChannelID == \"\" {\n\t\treturn errors.New(\"The required parameter 'channelID' is empty. Rerun the command with -C flag\")\n\t}\n\n\tif a.Name == \"\" {\n\t\treturn errors.New(\"The required parameter 'name' is empty. Rerun the command with -n flag\")\n\t}\n\n\tif a.Version == \"\" {\n\t\treturn errors.New(\"The required parameter 'version' is empty. Rerun the command with -v flag\")\n\t}\n\n\tif a.Sequence == 0 {\n\t\treturn errors.New(\"The required parameter 'sequence' is empty. Rerun the command with --sequence flag\")\n\t}\n\n\treturn nil\n}\n\n// ApproveForMyOrgCmd returns the cobra command for chaincode ApproveForMyOrg\nfunc ApproveForMyOrgCmd(a *ApproverForMyOrg, cryptoProvider bccsp.BCCSP) *cobra.Command {\n\tchaincodeApproveForMyOrgCmd := &cobra.Command{\n\t\tUse:   \"approveformyorg\",\n\t\tShort: \"Approve the chaincode definition for my org.\",","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/approveformyorg.go#L49-L85","documentation":"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.","triggerScenarios":"Thrown at internal/peer/lifecycle/chaincode/approveformyorg.go:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rerun the command adding -n <chaincode-name>","Set the Name field programmatically when constructing ApproveForMyOrgInput","Use the package label or `peer lifecycle chaincode calculatepackageid` to confirm the correct chaincode name"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}