{"record":{"id":"1f576bb2658efc87","repo":"XTLS/Xray-core","slug":"vless-vnext-address-is-not-set","errorCode":null,"errorMessage":"VLESS vnext: \"address\" is not set","messagePattern":"VLESS vnext: \"address\" is not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/vless.go","lineNumber":277,"sourceCode":"\n// Build implements Buildable\nfunc (c *VLessOutboundConfig) Build() (proto.Message, error) {\n\tconfig := new(outbound.Config)\n\tif c.Address != nil {\n\t\tc.Vnext = []*VLessOutboundVnext{\n\t\t\t{\n\t\t\t\tAddress: c.Address,\n\t\t\t\tPort:    c.Port,\n\t\t\t\tUsers:   []json.RawMessage{{}},\n\t\t\t},\n\t\t}\n\t}\n\tif len(c.Vnext) != 1 {\n\t\treturn nil, errors.New(`VLESS settings: \"vnext\" should have one and only one member. Multiple endpoints in \"vnext\" should use multiple VLESS outbounds and routing balancer instead`)\n\t}\n\tfor _, rec := range c.Vnext {\n\t\tif rec.Address == nil {\n\t\t\treturn nil, errors.New(`VLESS vnext: \"address\" is not set`)\n\t\t}\n\t\tif len(rec.Users) != 1 {\n\t\t\treturn nil, errors.New(`VLESS vnext: \"users\" should have one and only one member. Multiple members in \"users\" should use multiple VLESS outbounds and routing balancer instead`)\n\t\t}\n\t\tspec := &protocol.ServerEndpoint{\n\t\t\tAddress: rec.Address.Build(),\n\t\t\tPort:    uint32(rec.Port),\n\t\t}\n\t\tfor _, rawUser := range rec.Users {\n\t\t\tuser := new(protocol.User)\n\t\t\tif c.Address != nil {\n\t\t\t\tuser.Level = c.Level\n\t\t\t\tuser.Email = c.Email\n\t\t\t} else {\n\t\t\t\tif err := json.Unmarshal(rawUser, user); err != nil {\n\t\t\t\t\treturn nil, errors.New(`VLESS users: invalid user`).Base(err)\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/vless.go#L259-L295","documentation":"Thrown by VLessOutboundConfig.Build() while iterating the single vnext entry when its \"address\" field is missing. Address is the only required field of a vnext object (port defaults to 0, users is checked separately), and a nil Address makes the endpoint unbuildable.","triggerScenarios":"\"vnext\":[{\"port\":443,\"users\":[...]}] with no \"address\" key; address misspelled (\"server\", \"host\", \"add\"); address set to null in JSON.","commonSituations":"Renaming fields when converting between share-link formats and raw JSON; partial hand-editing; generators that emit an empty object as a placeholder.","solutions":["Add \"address\":\"your.server.example\" to the vnext object","Verify the key is exactly \"address\" and the value is a non-empty string or address object","Prefer the simplified outbound style (\"address\"/\"port\" at top level) to reduce nesting mistakes"],"exampleFix":"// before\n\"vnext\": [{ \"port\": 443, \"users\": [{ \"id\": \"...\", \"encryption\": \"none\" }] }]\n// after\n\"vnext\": [{ \"address\": \"server.example\", \"port\": 443, \"users\": [{ \"id\": \"...\", \"encryption\": \"none\" }] }]","handlingStrategy":"validation","validationCode":"func validateVnextAddress(cfg map[string]any) error {\n\toutbounds, _ := cfg[\"outbounds\"].([]any)\n\tfor _, ob := range outbounds {\n\t\tm, _ := ob.(map[string]any)\n\t\tif p, _ := m[\"protocol\"].(string); p != \"vless\" { continue }\n\t\tsettings, _ := m[\"settings\"].(map[string]any)\n\t\tvnext, _ := settings[\"vnext\"].([]any)\n\t\tfor _, v := range vnext {\n\t\t\tep, _ := v.(map[string]any)\n\t\t\tif addr, ok := ep[\"address\"].(string); !ok || addr == \"\" {\n\t\t\t\treturn fmt.Errorf(\"outbound %v: vnext entry missing address\", m[\"tag\"])\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}","typeGuard":"func vnextHasAddress(ep map[string]any) bool {\n\ta, ok := ep[\"address\"]\n\tif s, isStr := a.(string); isStr { return s != \"\" }\n\t_, isObj := a.(map[string]any)\n\treturn ok && isObj\n}","tryCatchPattern":null,"preventionTips":["Use the exact key \"address\" — not server/host/add","Reject empty placeholder vnext objects in generated configs","Validate address presence before deploy with a small lint script"],"tags":["vless","outbound","vnext","address","config","validation","xray"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}