{"record":{"id":"08b1fd15758bc32f","repo":"cloudflare/cloudflared","slug":"unable-to-find-route-for-provided-network-and-vnet","errorCode":null,"errorMessage":"unable to find route for provided network and vnet","messagePattern":"unable to find route for provided network and vnet","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/subcommand_context_teamnet.go","lineNumber":62,"sourceCode":"}\n\nfunc (sc *subcommandContext) getRouteId(network net.IPNet, vnetId *uuid.UUID) (uuid.UUID, error) {\n\tfilters := cfapi.NewIPRouteFilter()\n\tfilters.NotDeleted()\n\tfilters.NetworkIsSubsetOf(network)\n\tfilters.NetworkIsSupersetOf(network)\n\n\tif vnetId != nil {\n\t\tfilters.VNetID(*vnetId)\n\t}\n\n\tresult, err := sc.listRoutes(filters)\n\tif err != nil {\n\t\treturn uuid.Nil, err\n\t}\n\n\tif len(result) != 1 {\n\t\treturn uuid.Nil, errors.New(\"unable to find route for provided network and vnet\")\n\t}\n\n\treturn result[0].ID, nil\n}\n","sourceCodeStart":44,"sourceCodeEnd":67,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/subcommand_context_teamnet.go#L44-L67","documentation":"getRouteId lists WARP routing (teamnet) routes filtered by network CIDR and virtual network, and expects exactly one match. If the filtered result count is not 1 (route absent, duplicated, or listing failed to narrow results), it returns \"unable to find route for provided network and vnet\".","triggerScenarios":"Calling `cloudflared tunnel route ip delete <cidr>` (or similar) where no route exists for the given CIDR+vnet, or more than one route matches the filter (e.g. same CIDR on different vnets without --vnet specified).","commonSituations":"Typo in CIDR or vnet name/ID; route was already deleted; route exists under a different virtual network; ambiguous routes across multiple vnets.","solutions":["Run `cloudflared tunnel route ip show` to list existing routes and verify the exact CIDR and vnet.","Pass --vnet with the correct virtual network ID or name.","Confirm the route still exists; recreate it with `cloudflared tunnel route ip add <cidr> <tunnel>` if missing."],"exampleFix":"// before\ncloudflared tunnel route ip delete 10.0.0.0/8\n// after\ncloudflared tunnel route ip delete 10.0.0.0/8 --vnet default","handlingStrategy":"validation","validationCode":"_, _, err := net.ParseCIDR(cidr)\nif err != nil {\n    return fmt.Errorf(\"invalid CIDR %q: %w\", cidr, err)\n}\n// then: cloudflared tunnel route ip show, and confirm exactly one matching row exists","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List routes with `route ip show` and copy the exact CIDR/ID.","Always specify --vnet when multiple virtual networks exist.","Validate CIDR syntax before invoking delete commands."],"tags":["routing","warp","vnet","lookup"],"backgroundTag":"resource-not-found","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"}