cloudflare/cloudflared · error
You must supply exactly one argument, an IP whose route…
Error message
You must supply exactly one argument, an IP whose route will be queried (e.g. 1.2.3.4 or 2001:0db8:::7334)
What it means
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.
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
Example fix
// before $ cloudflared tunnel route ip get 1.2.3.4 my-tunnel // error: You must supply exactly one argument... // after $ cloudflared tunnel route ip get 1.2.3.4
Defensive patterns
Strategy: validation
Validate before calling
# exactly one IP argument, quoted
[ $# -eq 1 ] || { echo "usage: cloudflared tunnel route ip get <IP>"; exit 1; }
cloudflared tunnel route ip get "$1" Prevention
- 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])"`
When it happens
Trigger: 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).
Common situations: Forgetting the IP entirely; passing both an IP and a tunnel ID (not needed for lookup); shell splitting an unquoted IPv6 address.
Understand the failure class
Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.
Related errors
- You must supply at least 2 arguments, first the network you…
- Couldn't parse UUID from
- error parsing tunnel ID
- error setting up logger
- failed to create tunnel
AI-assisted analysis of cloudflare/cloudflared@2253eeeb25 (2026-09-06).
Data as JSON: /api/errors/78a644343e897657.
Report an issue: GitHub.
Appendix: source
Thrown at cmd/cloudflared/tunnel/teamnet_subcommands.go:229
if err != nil {
return err
}
}
if err := sc.deleteRoute(routeId); err != nil {
return errors.Wrap(err, "API error")
}
fmt.Printf("Successfully deleted route with ID %s\n", routeId)
return nil
}
func getRouteByIPCommand(c *cli.Context) error {
sc, err := newSubcommandContext(c)
if err != nil {
return err
}
if c.NArg() != 1 {
return 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)")
}
ipInput := c.Args().First()
ip := net.ParseIP(ipInput)
if ip == nil {
return fmt.Errorf("Invalid IP %s", ipInput)
}
params := cfapi.GetRouteByIpParams{
Ip: ip,
}
if c.IsSet(vnetFlag.Name) {
vnetId, err := getVnetId(sc, c.String(vnetFlag.Name))
if err != nil {
return err
}
params.VNetID = &vnetIdView on GitHub (pinned to 2253eeeb25)