{"record":{"id":"0677b6f377cf5d00","repo":"cloudflare/cloudflared","slug":"s-is-not-a-valid-virtual-network-id","errorCode":null,"errorMessage":"%s is not a valid virtual network ID","messagePattern":"(.+?) is not a valid virtual network ID","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cfapi/virtual_network_filter.go","lineNumber":79,"sourceCode":"\tf.queryParams.Set(\"is_deleted\", strconv.FormatBool(isDeleted))\n}\n\nfunc (f *VnetFilter) MaxFetchSize(max uint) {\n\tf.queryParams.Set(\"per_page\", strconv.Itoa(int(max)))\n}\n\nfunc (f VnetFilter) Encode() string {\n\treturn f.queryParams.Encode()\n}\n\n// NewFromCLI parses CLI flags to discover which filters should get applied to list virtual networks.\nfunc NewFromCLI(c *cli.Context) (*VnetFilter, error) {\n\tf := NewVnetFilter()\n\n\tif id := c.String(\"id\"); id != \"\" {\n\t\tvnetId, err := uuid.Parse(id)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"%s is not a valid virtual network ID\", id)\n\t\t}\n\t\tf.ById(vnetId)\n\t}\n\n\tif name := c.String(\"name\"); name != \"\" {\n\t\tf.ByName(name)\n\t}\n\n\tif c.IsSet(\"is-default\") {\n\t\tf.ByDefaultStatus(c.Bool(\"is-default\"))\n\t}\n\n\tf.WithDeleted(c.Bool(\"show-deleted\"))\n\n\tif maxFetch := c.Int(\"max-fetch-size\"); maxFetch > 0 {\n\t\tf.MaxFetchSize(uint(maxFetch))\n\t}\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cfapi/virtual_network_filter.go#L61-L97","documentation":"VnetFilter.NewFromCLI parses the --id flag as a UUID when listing virtual networks. If uuid.Parse fails, the raw string is wrapped as \"<value> is not a valid virtual network ID\". It is pure client-side input validation: the value was never sent to the API.","triggerScenarios":"Running `cloudflared tunnel vnet list --id <value>` where <value> is not a canonical RFC-4122 UUID (e.g., a vnet name passed to --id, truncated ID, or curly-braced UUID).","commonSituations":"Copy-pasting a name or partial ID from the dashboard into --id; scripting that passes $VNET_NAME instead of $VNET_ID; Windows-style {GUID} formatting.","solutions":["Get the exact vnet UUID from `cloudflared tunnel vnet list` (or the dashboard) and pass that to --id.","If you only know the name, use --name <name> instead of --id.","Strip braces/whitespace and ensure the ID is a 36-character hyphenated UUID.","In scripts, validate with uuid.Parse before invoking the command."],"exampleFix":"// before\ncloudflared tunnel vnet list --id my-vnet\n// after\ncloudflared tunnel vnet list --name my-vnet\n# or\ncloudflared tunnel vnet list --id f85e0780-9e67-4e0e-a90d-6b2e1a5f9c11","handlingStrategy":"validation","validationCode":"if _, err := uuid.Parse(vnetID); err != nil {\n\treturn fmt.Errorf(\"%s is not a valid UUID; use --name for names\", vnetID)\n}","typeGuard":null,"tryCatchPattern":"filter, err := cfapi.NewFromCLI(c)\nif err != nil {\n\treturn cli.Exit(fmt.Sprintf(\"invalid filter: %v\", err), 1)\n}","preventionTips":["Always source IDs from `cloudflared tunnel vnet list` output","Use --name when you only know the vnet name","Validate UUID format in scripts before invoking the CLI","Avoid Windows-braced GUID formatting"],"tags":["cli","uuid","validation"],"backgroundTag":"invalid-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"}