{"record":{"id":"66cae7d4a4abf6ab","repo":"XTLS/Xray-core","slug":"shadowsocks-server-address-is-not-set","errorCode":null,"errorMessage":"Shadowsocks server address is not set.","messagePattern":"Shadowsocks server address is not set\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/shadowsocks.go","lineNumber":221,"sourceCode":"\t\t\t{\n\t\t\t\tAddress:  v.Address,\n\t\t\t\tPort:     v.Port,\n\t\t\t\tLevel:    v.Level,\n\t\t\t\tEmail:    v.Email,\n\t\t\t\tCipher:   v.Cipher,\n\t\t\t\tPassword: v.Password,\n\t\t\t},\n\t\t}\n\t}\n\tif len(v.Servers) != 1 {\n\t\treturn nil, errors.New(`Shadowsocks settings: \"servers\" should have one and only one member. Multiple endpoints in \"servers\" should use multiple Shadowsocks outbounds and routing balancer instead`)\n\t}\n\n\tif len(v.Servers) == 1 {\n\t\tserver := v.Servers[0]\n\t\tif C.Contains(shadowaead_2022.List, server.Cipher) {\n\t\t\tif server.Address == nil {\n\t\t\t\treturn nil, errors.New(\"Shadowsocks server address is not set.\")\n\t\t\t}\n\t\t\tif server.Port == 0 {\n\t\t\t\treturn nil, errors.New(\"Invalid Shadowsocks port.\")\n\t\t\t}\n\t\t\tif server.Password == \"\" {\n\t\t\t\treturn nil, errors.New(\"Shadowsocks password is not specified.\")\n\t\t\t}\n\n\t\t\tconfig := new(shadowsocks_2022.ClientConfig)\n\t\t\tconfig.Address = server.Address.Build()\n\t\t\tconfig.Port = uint32(server.Port)\n\t\t\tconfig.Method = server.Cipher\n\t\t\tconfig.Key = server.Password\n\t\t\treturn config, nil\n\t\t}\n\t}\n\n\tconfig := new(shadowsocks.ClientConfig)","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/shadowsocks.go#L203-L239","documentation":"When the outbound's single server uses a Shadowsocks-2022 cipher (from shadowaead_2022.List), the client config requires a destination address. This check fires when the chosen server's 'address' field is nil before building the 2022 ClientConfig.","triggerScenarios":"A Shadowsocks outbound with a 2022 method (e.g. 2022-blake3-aes-256-gcm) where the servers[0] entry omits 'address': {\"port\": 443, \"method\": \"2022-blake3-aes-256-gcm\", \"password\": \"...\"}.","commonSituations":"Copy-paste from a classic example and deleting address; templating that injects the server host from an unset variable; domain field named 'server' instead of 'address'.","solutions":["Add the 'address' field (IP or domain) to the servers entry.","Verify templated variables for address are non-empty at render time.","Use the field name 'address', not 'server'/'host'."],"exampleFix":"// before\n{\"method\": \"2022-blake3-aes-256-gcm\", \"port\": 443, \"password\": \"...\"}\n\n// after\n{\"address\": \"example.com\", \"method\": \"2022-blake3-aes-256-gcm\", \"port\": 443, \"password\": \"...\"}","handlingStrategy":"validation","validationCode":"func valid2022Server(s map[string]any) bool {\n    _, hasAddr := s[\"address\"]\n    return hasAddr\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check templated address variables resolve non-empty before deploy"],"tags":["shadowsocks-2022","outbound","address","config"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}