cloudflare/cloudflared · error
there should only be 1 non-deleted virtual network named %s
Error message
there should only be 1 non-deleted virtual network named %s
What it means
getVnetId resolves a virtual network name to its UUID by listing virtual networks filtered by name. The API contract expects exactly one non-deleted virtual network per name; when the list returns anything other than exactly one entry, cloudflared cannot resolve the name and raises this error.
Source
Thrown at cmd/cloudflared/tunnel/vnets_subcommands.go:273
}
func getVnetId(sc *subcommandContext, input string) (uuid.UUID, error) {
val, err := uuid.Parse(input)
if err == nil {
return val, nil
}
filter := cfapi.NewVnetFilter()
filter.WithDeleted(false)
filter.ByName(input)
vnets, err := sc.listVirtualNetworks(filter)
if err != nil {
return uuid.Nil, err
}
if len(vnets) != 1 {
return uuid.Nil, fmt.Errorf("there should only be 1 non-deleted virtual network named %s", input)
}
return vnets[0].ID, nil
}
func formatAndPrintVnetsList(vnets []*cfapi.VirtualNetwork) {
const (
minWidth = 0
tabWidth = 8
padding = 1
padChar = ' '
flags = 0
)
writer := tabwriter.NewWriter(os.Stdout, minWidth, tabWidth, padding, padChar, flags)
defer writer.Flush()
_, _ = fmt.Fprintln(writer, "ID\tNAME\tIS DEFAULT\tCOMMENT\tCREATED\tDELETED\t")View on GitHub (pinned to 2253eeeb25)
Solutions
- List virtual networks with `cloudflared tunnel network list` and use the exact existing name (or its UUID).
- Delete or rename duplicates so each name is unique among non-deleted vnets.
- Create the vnet first with `cloudflared tunnel network add <name>` if none exists.
Example fix
// before cloudflared tunnel route ip add 10.0.0.0/24 vnet-prod-typo // after cloudflared tunnel network list cloudflared tunnel route ip add 10.0.0.0/24 vnet-prod
Defensive patterns
Strategy: validation
Validate before calling
out, _ := exec.Command("cloudflared", "tunnel", "network", "list").Output()
if !strings.Contains(string(out), vnetName) {
return fmt.Errorf("virtual network %q does not exist", vnetName)
} Prevention
- Run `cloudflared tunnel network list` before route commands to confirm names.
- Keep virtual network names unique per account.
- Create the vnet before adding routes that reference it.
When it happens
Trigger: Running route/vnet subcommands (`cloudflared tunnel route ip add/delete`, `cloudflared tunnel network add/delete/update` path via getVnetId callers) with a vnet name that matches zero non-deleted virtual networks or is duplicated.
Common situations: Typo in the virtual network name; vnet was deleted; duplicate vnet names created in the account; operating against an account different from where the vnet lives.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- there should only be 1 non-deleted Tunnel named %s
- You must supply at least 1 argument, the name of the virtual
- You must supply exactly one argument, either the ID or name
- You must supply exactly one argument, either the ID or (cur
- %s is neither the ID nor the name of any of your tunnels
AI-assisted analysis of cloudflare/cloudflared@2253eeeb25 (2026-09-06).
Data as JSON: /api/errors/a5a04df5564ecbf1.
Report an issue: GitHub.