{"record":{"id":"b0739c148133ed5a","repo":"XTLS/Xray-core","slug":"vless-fallbacks-please-fill-in-a-valid-value-for","errorCode":null,"errorMessage":"VLESS fallbacks: please fill in a valid value for every \"dest\"","messagePattern":"VLESS fallbacks: please fill in a valid value for every \"dest\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/vless.go","lineNumber":207,"sourceCode":"\t\t\t\tfb.Type = \"serve\"\n\t\t\t} else if filepath.IsAbs(fb.Dest) || fb.Dest[0] == '@' {\n\t\t\t\tfb.Type = \"unix\"\n\t\t\t\tif strings.HasPrefix(fb.Dest, \"@@\") && (runtime.GOOS == \"linux\" || runtime.GOOS == \"android\") {\n\t\t\t\t\tfullAddr := make([]byte, len(syscall.RawSockaddrUnix{}.Path)) // may need padding to work with haproxy\n\t\t\t\t\tcopy(fullAddr, fb.Dest[1:])\n\t\t\t\t\tfb.Dest = string(fullAddr)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif _, err := strconv.Atoi(fb.Dest); err == nil {\n\t\t\t\t\tfb.Dest = \"localhost:\" + fb.Dest\n\t\t\t\t}\n\t\t\t\tif _, _, err := net.SplitHostPort(fb.Dest); err == nil {\n\t\t\t\t\tfb.Type = \"tcp\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif fb.Type == \"\" {\n\t\t\treturn nil, errors.New(`VLESS fallbacks: please fill in a valid value for every \"dest\"`)\n\t\t}\n\t\tif fb.Xver > 2 {\n\t\t\treturn nil, errors.New(`VLESS fallbacks: invalid PROXY protocol version, \"xver\" only accepts 0, 1, 2`)\n\t\t}\n\t}\n\n\treturn config, nil\n}\n\ntype VLessReverseConfig struct {\n\tTag      string          `json:\"tag\"`\n\tSniffing *SniffingConfig `json:\"sniffing\"`\n}\n\nfunc (c *VLessReverseConfig) Build() (*vless.Reverse, error) {\n\tif c.Tag == \"\" {\n\t\treturn nil, errors.New(`VLESS reverse: \"tag\" can't be empty`)\n\t}","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/vless.go#L189-L225","documentation":"Thrown by VLessInboundConfig.Build() when a fallback's \"type\" could not be inferred. If \"type\" is not set explicitly, the builder tries to derive it from \"dest\": \"serve-ws-none\" becomes \"serve\", an absolute filesystem path or a '@'-prefixed string becomes \"unix\", a pure number becomes \"localhost:<port>\", and any valid host:port becomes \"tcp\". If none of these match (e.g. dest is empty, or is a relative string like \"mysite.com:80\" that fails SplitHostPort parsing), Type stays empty and this error is returned.","triggerScenarios":"\"fallbacks\":[{}] with no dest at all; dest like \"example.com 80\" (space instead of colon); dest \"/var/run/x\" on Windows where filepath.IsAbs is false; dest \"8080:\" or other malformed host:port that net.SplitHostPort rejects.","commonSituations":"Minimal fallback configs that omit dest; copy-paste from examples with placeholders; OS-dependent absolute-path behavior (Unix paths on Windows); dest with brackets/schemes like \"http://localhost:80\".","solutions":["Set \"dest\" to a valid \"host:port\" (e.g. \"localhost:80\") or a bare port number (e.g. 80)","Or set \"type\" explicitly to \"tcp\"/\"unix\"/\"serve\" alongside the dest","For Unix sockets use an absolute path (\"/path/sock\") or '@'-prefixed abstract socket","Remove URLs/schemes from dest — only raw addresses are accepted"],"exampleFix":"// before\n\"fallbacks\": [{ \"path\": \"/ws\" }]\n// after\n\"fallbacks\": [{ \"dest\": \"localhost:80\", \"path\": \"/ws\" }]","handlingStrategy":"validation","validationCode":"func validateFallbackDest(fb map[string]any) error {\n\tif t, _ := fb[\"type\"].(string); t != \"\" {\n\t\treturn nil\n\t}\n\tdest, _ := fb[\"dest\"].(string)\n\tif dest == \"serve-ws-none\" || strings.HasPrefix(dest, \"@\") {\n\t\treturn nil\n\t}\n\tif filepath.IsAbs(dest) {\n\t\treturn nil\n\t}\n\tif _, err := strconv.Atoi(dest); err == nil {\n\t\treturn nil\n\t}\n\tif _, _, err := net.SplitHostPort(dest); err == nil {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"fallback dest %q cannot be typed; set dest to host:port, a port number, an absolute path, @sock, or set type explicitly\", dest)\n}","typeGuard":"func fallbackDestValid(dest string) bool {\n\tif dest == \"\" { return false }\n\tif dest == \"serve-ws-none\" || strings.HasPrefix(dest, \"@\") || filepath.IsAbs(dest) { return true }\n\tif _, err := strconv.Atoi(dest); err == nil { return true }\n\t_, _, err := net.SplitHostPort(dest)\n\treturn err == nil\n}","tryCatchPattern":null,"preventionTips":["Always set a concrete \"dest\" in every fallback entry","Prefer host:port form for TCP targets and @-prefixed or absolute paths for sockets","Set \"type\" explicitly when dest could be ambiguous (especially on Windows paths)"],"tags":["vless","config","fallbacks","dest","validation","xray"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}