{"record":{"id":"985f57cf330b1535","repo":"XTLS/Xray-core","slug":"vmess-vnext-address-is-not-set","errorCode":null,"errorMessage":"VMess vnext: \"address\" is not set","messagePattern":"VMess vnext: \"address\" is not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/vmess.go","lineNumber":144,"sourceCode":"\tconfig := new(outbound.Config)\n\tif c.Address != nil {\n\t\tc.Receivers = []*VMessOutboundTarget{\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.Receivers) != 1 {\n\t\treturn nil, errors.New(`VMess settings: \"vnext\" should have one and only one member. Multiple endpoints in \"vnext\" should use multiple VMess outbounds and routing balancer instead`)\n\t}\n\tfor _, rec := range c.Receivers {\n\t\tif len(rec.Users) != 1 {\n\t\t\treturn nil, errors.New(`VMess vnext: \"users\" should have one and only one member. Multiple members in \"users\" should use multiple VMess outbounds and routing balancer instead`)\n\t\t}\n\t\tif rec.Address == nil {\n\t\t\treturn nil, errors.New(`VMess vnext: \"address\" is not set`)\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(\"invalid VMess user\").Base(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\taccount := new(VMessAccount)\n\t\t\tif c.Address != nil {\n\t\t\t\taccount.ID = c.ID","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/vmess.go#L126-L162","documentation":"Thrown by VMessOutboundConfig.Build() when the single vnext entry has no \"address\" field (nil Address). Address is the required key of a receiver; without it the server endpoint cannot be constructed. Port and users are checked separately, so a missing address alone is enough to abort the build.","triggerScenarios":"\"vnext\":[{\"port\":443,\"users\":[...]}] with the address key absent, null, or misspelled (\"server\", \"host\", \"add\").","commonSituations":"Converting share links (vmess:// base64) to JSON by hand and dropping the add field; template placeholders never filled in; field-name drift between tools.","solutions":["Add \"address\":\"server.example\" to the vnext object","Confirm the key is exactly \"address\" with a non-empty string or {domain/ip} object value","Use the simplified outbound style (\"address\" at settings top level) to reduce nesting errors"],"exampleFix":"// before\n\"vnext\": [{ \"port\": 443, \"users\": [ { \"id\": \"...\", \"alterId\": 0 } ] }]\n// after\n\"vnext\": [{ \"address\": \"server.example\", \"port\": 443, \"users\": [ { \"id\": \"...\", \"alterId\": 0 } ] }]","handlingStrategy":"validation","validationCode":"func validateVMessVnextAddress(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 != \"vmess\" { 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 a, ok := ep[\"address\"].(string); !ok || a == \"\" {\n\t\t\t\treturn fmt.Errorf(\"outbound %v: vmess vnext entry missing address\", m[\"tag\"])\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}","typeGuard":"func vmessVnextHasAddress(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\"; map share-link fields (add -> address) correctly when converting","Fail generator builds on empty address fields rather than emitting placeholders","Consider the simplified outbound style to reduce nesting depth and error surface"],"tags":["vmess","outbound","vnext","address","config","validation","xray"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}