v2ray-core icon indicating copy to clipboard operation
v2ray-core copied to clipboard

rejected common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found

Open zhang-ray opened this issue 3 years ago • 15 comments

你正在使用哪个版本的 V2Ray?

V2Ray 4.44.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.17.3 linux/amd64)

你的使用场景是什么?

翻阅内部防火墙

你看到的异常现象是什么?

服务端出现rejected common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found , 并且客户端无法连接网络

你期待看到的正常表现是怎样的?

不出现错误日志,并且客户端可以正常使用网络

请附上你的配置

服务端配置:

// 在这里附上服务器端配置文件
{
  "log": {
    "loglevel": "debug"
  },
  "inbounds": [
    {
        "port": 16823, // 服务器监听端口
        "protocol": "vmess",    // 主传入协议
        "settings": {
          "clients": [
            {
              "id": "b831381d-6324-4d53-ad4f-8cda48b30811",  // 用户 ID,客户端与服务器必须相同
              "alterId": 0
            }
          ]
        }
      }
  ],
  "outbounds": [
     {
      "protocol": "freedom",  // 主传出协议
      "settings": {}
      }
    ],

"dns": {
"servers": [
"114.114.114.114",
"localhost"
]
 }

}

客户端配置:

// 在这里附上客户端配置
{
    "log": {
        "loglevel": "debug",
        "access": "/var/log/v2ray/access.log", // ~Y~X Linux ~Z~D路~D
        "error": "/var/log/v2ray/error.log"
    },
    "inbounds": [
        {
            "tag": "transparent",
            "port": 12345,
            "protocol": "dokodemo-door",
            "settings": {
                "network": "tcp,udp",
                "followRedirect": true
            },
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http",
                    "tls"
                ]
            },
            "streamSettings": {
                "sockopt": {
                    "tproxy": "tproxy", // ~@~O~X~N代~P~F使~T TPROXY ~V~O
                    "mark": 255
                }
            }
        }
    ],
"outbounds": [
        {
            "protocol": "vmess", // 出口协议
            "settings": {
                "vnext": [
                    {
                        "address": "192.168.51.131", // 服务器地址,请修改为你自己的服务器 IP 或域名
                        "port": 16823, // 服务器端口
                        "users": [
                            {
                                "id": "b831381d-6324-4d53-ad4f-8cda48b30811", // 用户 ID,必须与服务器端配置相同
                                "alterId": 0 // 此处的值也应当与服务器相同
                            }
                        ]
                    }
                ]
            }
        }
    ],
    "dns": {
        "servers": [
            {
                "address": "192.168.1.1", //中国大陆域名使用 114 的 DNS (备用)
                "port": 53,
                "domains": [
                    "geosite:cn",
                    "ntp.org", // NTP 服务器
                    "$myserver.address" // 此处改为你 VPS 的域名
                ]
            },
{
                "address": "8.8.8.8", //非中国大陆域名使用 Google 的 DNS
                "port": 53,
                "domains": [
                    "geosite:geolocation-!cn"
                ]
            },
            {
                "address": "1.1.1.1", //非中国大陆域名使用 Cloudflare 的 DNS
                "port": 53,
                "domains": [
                    "geosite:geolocation-!cn"
                ]
            }
        ]
    }
}

请附上出错时软件输出的错误日志

服务器端错误日志:

// 在这里附上服务器端日志
2022/02/14 18:05:53 172.20.122.189:35832 rejected  common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
2022/02/14 18:05:53 [Info] [2337968776] app/proxyman/inbound: connection ends > proxy/vmess/inbound: invalid request from 172.20.122.189:35832 > common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
2022/02/14 18:05:53 172.20.122.189:35830 rejected  common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
2022/02/14 18:05:53 [Info] [1121610257] app/proxyman/inbound: connection ends > proxy/vmess/inbound: invalid request from 172.20.122.189:35830 > common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
2022/02/14 18:05:53 172.20.122.189:35840 rejected  common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
2022/02/14 18:05:53 [Info] [449892505] app/proxyman/inbound: connection ends > proxy/vmess/inbound: invalid request from 172.20.122.189:35840 > common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
2022/02/14 18:05:53 172.20.122.189:35838 rejected  common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
2022/02/14 18:05:53 [Info] [117733608] app/proxyman/inbound: connection ends > proxy/vmess/inbound: invalid request from 172.20.122.189:35838 > common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
2022/02/14 18:05:53 172.20.122.189:35846 rejected  common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
2022/02/14 18:05:53 [Info] [4227250692] app/proxyman/inbound: connection ends > proxy/vmess/inbound: invalid request from 172.20.122.189:35846 > common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found
^C2022/02/14 18:05:56 [Debug] app/log: Logger closing

客户端错误日志:

// 在这里附上客户端日志

请附上访问日志

// 在这里附上服务器端日志

其它相关的配置文件(如 Nginx)和相关日志

如果 V2Ray 无法启动,请附上 --test 命令的输出

如果 V2Ray 服务运行异常,请附上 journal 日志

zhang-ray avatar Feb 14 '22 10:02 zhang-ray

这个问题是偶发出现的。 客户端和服务端的 v2ray 重启后,不一定会复现

zhang-ray avatar Feb 14 '22 10:02 zhang-ray

You don't have to worry about this, it may be the replay attacks from GFW.

AkinoKaede avatar Feb 14 '22 13:02 AkinoKaede

You don't have to worry about this, it may be the replay attacks from GFW.

关键这不涉及到 GFW, VMESS协议只跨越一个局域网

zhang-ray avatar Feb 14 '22 14:02 zhang-ray

You don't have to worry about this, it may be the replay attacks from GFW.

关键这不涉及到 GFW, VMESS协议只跨越一个局域网

Sorry, I didn't read it carefully.

Generally, this is caused by inaccurate system time.

AkinoKaede avatar Feb 14 '22 15:02 AkinoKaede

You don't have to worry about this, it may be the replay attacks from GFW.

关键这不涉及到 GFW, VMESS协议只跨越一个局域网

Sorry, I didn't read it carefully.

Generally, this is caused by inaccurate system time.

我试过了,把client和server的时区和时钟都校准了,还是会出现。

zhang-ray avatar Feb 14 '22 15:02 zhang-ray

Hmm, by design, this doesn't happen when the ID is correct and the system time is accurate.

AkinoKaede avatar Feb 14 '22 15:02 AkinoKaede

我也遇到了同样的问题, ip id port 全都对应上了

hujesse83 avatar Mar 08 '22 06:03 hujesse83

4.43也遇到了同样的问题。uuid和时间检查了没问题,也能看到connection established,但就是无法连接。

ziqizh avatar Apr 17 '22 19:04 ziqizh

4.44遇到这个问题,一直回退到4.39还是有同样问题

huangjiahua avatar May 01 '22 06:05 huangjiahua

同样的问题+1, 客户端没法翻墙

bruce2233 avatar May 21 '22 11:05 bruce2233

服务端客户端协议不匹配也会出现这个报错

xinxin8816 avatar Jun 15 '22 17:06 xinxin8816

There are errors in access.log:

rejected common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user: VMessAEAD is enforced and a non VMessAEAD connection is received. You can still disable this security feature with environment variable v2ray.vmess.aead.forced = false. You will not be able to enable legacy header workaround in the future.

When entering v2ray log:

rejected common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found

And I can't browse google.

This problem was solved when I switched the protocol from QUIC to TCP both in server and client config.

zhweiGuo avatar Jun 22 '22 03:06 zhweiGuo

如果您使用的linux发行版为debian

不妨执行如下命令:

apt-get install -y ntp && /lib/systemd/systemd-sysv-install enable ntp

当我执行这串命令,再次重启程序,客户端可以进行连接,希望能够帮到你!

Feng1440 avatar Aug 13 '22 13:08 Feng1440

遇到同样的问题,分析日志感觉大部分ip是正常的,只有个别比如112.79开头的ip就报错,比如:112.79.141.168:39219 rejected common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found

ynhj123 avatar Sep 28 '22 09:09 ynhj123

关闭VMessAEAD。。。v2ray.vmess.aead.forced = false

tacy avatar Nov 02 '22 11:11 tacy

遇到同样的问题,我的客户端时钟是准确的,但是服务器运行太久了,时钟快了2分钟。。。

GOKORURI007 avatar Feb 13 '23 02:02 GOKORURI007

As same as me. I fix it after adjust my client time.

vinqin avatar Feb 23 '23 08:02 vinqin

可能是客户端与服务器 alterId 不匹配, 不知道服务器设置的话把客户端的设为0就好了

adwinwhite avatar Feb 23 '23 09:02 adwinwhite

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Jun 24 '23 02:06 github-actions[bot]

I faced this issue too. Windows client works fine, but android client shows 'pipe closed', and server logs shows 'vmess user not found'.

Fix: Just syn date. (e.g: $/timedatectl set-ntp true)

ArtoriaZhang avatar Aug 28 '23 03:08 ArtoriaZhang

My server time already synced this error happened when using ws protocol with dynamic ports but once changed the protocol type into tcp, this error was gone

HelloLingC avatar Oct 28 '23 11:10 HelloLingC

access.log中存在错误:

拒绝的公共/排水:公共/排水:无法排水连接> EOF > proxy/vmess/encoding:无效用户:强制执行VMessAEAD并接收非VMessAEAD连接。您仍然可以使用环境变量v2ray.vmess.aead.forced = false禁用此安全功能。未来您将无法启用遗留标题变通办法。

输入v2ray log时:

拒绝的普通/排水:普通/排水:无法排水连接> EOF>代理/vmess/编码:无效用户>代理/vmess:未找到

而且我无法浏览谷歌。

当我在服务器和客户端配置中将协议从QUIC切换到TCP时,这个问题得到了解决。

There are errors in access.log:

rejected common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user: VMessAEAD is enforced and a non VMessAEAD connection is received. You can still disable this security feature with environment variable v2ray.vmess.aead.forced = false. You will not be able to enable legacy header workaround in the future.

When entering v2ray log:

rejected common/drain: common/drain: unable to drain connection > EOF > proxy/vmess/encoding: invalid user > proxy/vmess: Not Found

And I can't browse google.

This problem was solved when I switched the protocol from QUIC to TCP both in server and client config.

更换协议为tcp也解决了这个问题 感谢!

adminKKi avatar Oct 30 '23 02:10 adminKKi

客户端时间不准会出现该问题

marioplus avatar Feb 17 '24 09:02 marioplus