{"record":{"id":"d508ebc859f964b5","repo":"hyperledger/fabric","slug":"s-command-supports-one-peer-d-peers-provided","errorCode":null,"errorMessage":"'%s' command supports one peer. %d peers provided","messagePattern":"'(.+?)' command supports one peer\\. (.+?) peers provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/client_connections.go","lineNumber":131,"sourceCode":"\treturn nil\n}\n\nfunc (c *ClientConnections) validatePeerConnectionParameters(input *ClientConnectionsInput) error {\n\tif input.ConnectionProfilePath != \"\" {\n\t\terr := input.parseConnectionProfile()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// currently only support multiple peer addresses for _lifecycle\n\t// for approveformyorg and commit\n\tmultiplePeersAllowed := map[string]bool{\n\t\t\"approveformyorg\": true,\n\t\t\"commit\":          true,\n\t}\n\tif !multiplePeersAllowed[input.CommandName] && len(input.PeerAddresses) > 1 {\n\t\treturn errors.Errorf(\"'%s' command supports one peer. %d peers provided\", input.CommandName, len(input.PeerAddresses))\n\t}\n\n\tif !input.TLSEnabled {\n\t\tinput.TLSRootCertFiles = nil\n\t\treturn nil\n\t}\n\tif len(input.TLSRootCertFiles) != len(input.PeerAddresses) {\n\t\treturn errors.Errorf(\"number of peer addresses (%d) does not match the number of TLS root cert files (%d)\", len(input.PeerAddresses), len(input.TLSRootCertFiles))\n\t}\n\n\treturn nil\n}\n\nfunc (c *ClientConnectionsInput) parseConnectionProfile() error {\n\tnetworkConfig, err := common.GetConfig(c.ConnectionProfilePath)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/client_connections.go#L113-L149","documentation":"Most lifecycle chaincode subcommands target exactly one endorsing peer. This error fires when the user supplied more than one --peerAddresses value to a command that is not approveformyorg or commit (the two commands that allow multiple peers).","triggerScenarios":"Passing two or more --peerAddresses flags to commands like checkcommitreadiness, package, install, queryinstalled, getinstalledpackage, or approveformyorg/commit are the only multi-peer exceptions.","commonSituations":"Copy-pasting a multi-peer invocation pattern from approveformyorg/commit examples onto another subcommand; scripting loops that always append multiple peer addresses.","solutions":["Use a single --peerAddresses flag for this command","If you truly need multiple peers, use approveformyorg or commit, which allow multiple","Remove extra --peerAddresses/--tlsRootCertFiles pairs from your script for this subcommand"],"exampleFix":"// before\npeer lifecycle chaincode checkcommitreadiness --peerAddresses peer0.org1:7051 --peerAddresses peer0.org2:7051 ...\n// after\npeer lifecycle chaincode checkcommitreadiness --peerAddresses peer0.org1:7051 ...","handlingStrategy":"validation","validationCode":"multiPeerAllowed := map[string]bool{\"approveformyorg\": true, \"commit\": true}\nif len(peerAddresses) > 1 && !multiPeerAllowed[commandName] { return fmt.Errorf(\"%s supports one peer\", commandName) }","typeGuard":null,"tryCatchPattern":"if err := run(cmd); err != nil && strings.Contains(err.Error(), \"supports one peer\") { log.Fatalf(\"drop extra --peerAddresses flags for %s\", cmd) }","preventionTips":["Only repeat --peerAddresses for approveformyorg and commit","Build peer lists per-command in scripts, not globally","Count flags before exec to catch duplicates"],"tags":["fabric","cli-usage","arguments"],"backgroundTag":"too-many-arguments","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"}