{"record":{"id":"bf2576698878f81b","repo":"cloudflare/cloudflared","slug":"invalid-value-for-edge-ip-version-s","errorCode":null,"errorMessage":"invalid value for edge-ip-version: %s","messagePattern":"invalid value for edge-ip-version: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/configuration.go","lineNumber":306,"sourceCode":"\t}\n\treturn period, nil\n}\n\nfunc isRunningFromTerminal() bool {\n\treturn term.IsTerminal(int(os.Stdout.Fd())) // nolint:gosec\n}\n\n// ParseConfigIPVersion returns the IP version from possible expected values from config\nfunc parseConfigIPVersion(version string) (v allregions.ConfigIPVersion, err error) {\n\tswitch version {\n\tcase \"4\":\n\t\tv = allregions.IPv4Only\n\tcase \"6\":\n\t\tv = allregions.IPv6Only\n\tcase \"auto\":\n\t\tv = allregions.Auto\n\tdefault: // unspecified or invalid\n\t\terr = fmt.Errorf(\"invalid value for edge-ip-version: %s\", version)\n\t}\n\treturn\n}\n\nfunc parseConfigBindAddress(ipstr string) (net.IP, error) {\n\t// Unspecified - it's fine\n\tif ipstr == \"\" {\n\t\treturn nil, nil\n\t}\n\tip := net.ParseIP(ipstr)\n\tif ip == nil {\n\t\treturn nil, fmt.Errorf(\"invalid value for edge-bind-address: %s\", ipstr)\n\t}\n\treturn ip, nil\n}\n\nfunc testIPBindable(ip net.IP) error {\n\t// \"Unspecified\" = let OS choose, so always bindable","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/configuration.go#L288-L324","documentation":"parseConfigIPVersion maps the `edge-ip-version` setting to one of IPv4Only/IPv6Only/Auto; any value outside {\"4\",\"6\",\"auto\"} (including an empty string) is invalid, so runPrechecks/prepareTunnelConfig fail before connecting.","triggerScenarios":"Setting `--edge-ip-version` (or config `edge-ip-version:`) to values like \"ipv4\", \"v4\", \"both\", or leaving an empty value that still reaches the parser (e.g. `edge-ip-version: \"\"` in config).","commonSituations":"Guessing the accepted values from documentation wording; YAML config retaining an empty key after editing; automation templating an unset variable into the flag.","solutions":["Set edge-ip-version to exactly `4`, `6`, or `auto`.","Remove the empty/invalid key from the config file or drop the flag to default to auto behavior where applicable.","In templated deployments, guard so an empty variable omits the flag rather than passing an empty string."],"exampleFix":"// before\nedge-ip-version: ipv4\n// after\nedge-ip-version: 4","handlingStrategy":"validation","validationCode":"// shell: accept only 4, 6, auto\nv=\"${EDGE_IP_VERSION:-auto}\"\n[[ \"$v\" =~ ^(4|6|auto)$ ]] || { echo \"edge-ip-version must be 4|6|auto\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Memorize the accepted set: 4, 6, auto — not ipv4/v4.","Avoid emitting the flag when the template variable is empty.","Validate config files with a schema check before deploy."],"tags":["cli","configuration","ip-version"],"backgroundTag":"invalid-enum-value","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"}