{"record":{"id":"78a644343e897657","repo":"cloudflare/cloudflared","slug":"you-must-supply-exactly-one-argument-an-ip-whose","errorCode":null,"errorMessage":"You must supply exactly one argument, an IP whose route will be queried (e.g. 1.2.3.4 or 2001:0db8:::7334)","messagePattern":"You must supply exactly one argument, an IP whose route will be queried \\(e\\.g\\. 1\\.2\\.3\\.4 or 2001:0db8:::7334\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/teamnet_subcommands.go","lineNumber":229,"sourceCode":"\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := sc.deleteRoute(routeId); err != nil {\n\t\treturn errors.Wrap(err, \"API error\")\n\t}\n\tfmt.Printf(\"Successfully deleted route with ID %s\\n\", routeId)\n\treturn nil\n}\n\nfunc getRouteByIPCommand(c *cli.Context) error {\n\tsc, err := newSubcommandContext(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif c.NArg() != 1 {\n\t\treturn errors.New(\"You must supply exactly one argument, an IP whose route will be queried (e.g. 1.2.3.4 or 2001:0db8:::7334)\")\n\t}\n\n\tipInput := c.Args().First()\n\tip := net.ParseIP(ipInput)\n\tif ip == nil {\n\t\treturn fmt.Errorf(\"Invalid IP %s\", ipInput)\n\t}\n\n\tparams := cfapi.GetRouteByIpParams{\n\t\tIp: ip,\n\t}\n\n\tif c.IsSet(vnetFlag.Name) {\n\t\tvnetId, err := getVnetId(sc, c.String(vnetFlag.Name))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparams.VNetID = &vnetId","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/teamnet_subcommands.go#L211-L247","documentation":"Argument-count guard in the `cloudflared tunnel route ip get` subcommand. It fires when the user supplies zero or more than one CLI argument; the command requires exactly one argument, the IP whose route should be queried, before it will call the Tunnelstore API.","triggerScenarios":"Running `cloudflared tunnel route ip get` with zero arguments, or with more than one argument (extra tokens, e.g. an unquoted IPv6 with colons being split by the shell).","commonSituations":"Forgetting the IP entirely; passing both an IP and a tunnel ID (not needed for lookup); shell splitting an unquoted IPv6 address.","solutions":["Run with exactly one IP argument: `cloudflared tunnel route ip get 1.2.3.4`","Quote IPv6 addresses: `cloudflared tunnel route ip get \"2001:0db8::7334\"`","Remove extra arguments; the lookup needs only the IP"],"exampleFix":"// before\n$ cloudflared tunnel route ip get 1.2.3.4 my-tunnel\n// error: You must supply exactly one argument...\n// after\n$ cloudflared tunnel route ip get 1.2.3.4","handlingStrategy":"validation","validationCode":"# exactly one IP argument, quoted\n[ $# -eq 1 ] || { echo \"usage: cloudflared tunnel route ip get <IP>\"; exit 1; }\ncloudflared tunnel route ip get \"$1\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass exactly one argument — no tunnel ID needed for lookup","Quote IPv6 addresses so colons aren't split by the shell","Validate with `ipcalc` or `python3 -c \"import ipaddress,sys; ipaddress.ip_address(sys.argv[1])\"`"],"tags":["cli","cloudflared","arguments"],"backgroundTag":"missing-cli-argument","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}