{"record":{"id":"df8f00d436af10be","repo":"cloudflare/cloudflared","slug":"you-must-supply-exactly-one-argument-either-the","errorCode":null,"errorMessage":" You must supply exactly one argument, either the ID or (current) name of the virtual network to update","messagePattern":" You must supply exactly one argument, either the ID or \\(current\\) name of the virtual network to update","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/vnets_subcommands.go","lineNumber":226,"sourceCode":"\tforceDelete := false\n\tif c.IsSet(vnetForceDeleteFlag.Name) {\n\t\tforceDelete = c.Bool(vnetForceDeleteFlag.Name)\n\t}\n\n\tif err := sc.deleteVirtualNetwork(vnetId, forceDelete); err != nil {\n\t\treturn errors.Wrap(err, \"API error\")\n\t}\n\tfmt.Printf(\"Successfully deleted virtual network '%s'\\n\", input)\n\treturn nil\n}\n\nfunc updateVirtualNetworkCommand(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, either the ID or (current) name of the virtual network to update\")\n\t}\n\n\tinput := c.Args().Get(0)\n\tvnetId, err := getVnetId(sc, input)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tupdates := cfapi.UpdateVirtualNetwork{}\n\n\tif c.IsSet(newNameFlag.Name) {\n\t\tnewName := c.String(newNameFlag.Name)\n\t\tupdates.Name = &newName\n\t}\n\tif c.IsSet(newCommentFlag.Name) {\n\t\tnewComment := c.String(newCommentFlag.Name)\n\t\tupdates.Comment = &newComment\n\t}","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/vnets_subcommands.go#L208-L244","documentation":"`cloudflared tunnel vnet update` requires exactly one positional argument identifying the virtual network (its ID or current name). updateVirtualNetworkCommand returns this error when the argument count is not exactly 1.","triggerScenarios":"Running `cloudflared tunnel vnet update` with zero arguments or with two or more positional arguments (e.g. passing both old and new names positionally instead of using --name).","commonSituations":"Passing the new name as a second positional argument instead of the --name flag; forgetting the identifier entirely; unquoted names with spaces creating multiple arguments.","solutions":["Supply exactly one identifier and use flags for changes: `cloudflared tunnel vnet update my-vnet --name new-name`","Quote vnet names containing spaces: `cloudflared tunnel vnet update \"my vnet\" --name \"new name\"`","Check `cloudflared tunnel vnet update --help` to confirm which mutations are flag-driven"],"exampleFix":"// before\n$ cloudflared tunnel vnet update old-name new-name\n// error: You must supply exactly one argument...\n// after\n$ cloudflared tunnel vnet update old-name --name new-name","handlingStrategy":"validation","validationCode":"# exactly one identifier; changes go through flags\n[ $# -eq 1 ] || { echo \"usage: cloudflared tunnel vnet update <ID|NAME> [--name NEW]\"; exit 1; }\ncloudflared tunnel vnet update \"$1\" --name \"$NEW_NAME\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass the new name via --name flag, never as a second positional argument","Quote names with spaces so they count as one argument","Check `--help` to see which mutations are flag-driven"],"tags":["cli","cloudflared","virtual-network"],"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-14T00:17:10.932Z"}