Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@DarienRaymond 断流现象依然存在(游戏掉线),局域网测试也断流! #1151

Closed
ak47for opened this issue Jun 19, 2018 · 31 comments

Comments

@ak47for
Copy link

ak47for commented Jun 19, 2018

Please skip to the English section below if you don't write Chinese.

中文:
提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。

  1. 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
    最新版本3.27

  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    客户端和服务器跑的mkcp协议,服务器outboud是freedom

  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    断流,游戏突然中断,下载失败

  4. 你期待看到的正确表现是怎样的?
    正常游戏

  5. 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

    服务器端配置:

    // 在这里附上服务器端配置文件
客户端配置:
    // 在这里附上客户端配置
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

    服务器端错误日志:

    // 在这里附上服务器端日志
2018/06/15 17:32:39 [Debug] Transport|Internet|mKCP: #12094 entering state 1 at 1541735
2018/06/15 17:32:39 [Info] Transport|Internet|mKCP: #12094 closing connection to 218.241.251.155:31033
2018/06/15 17:32:39 [Debug] Transport|Internet|mKCP: #12094 entering state 3 at 1541735
2018/06/15 17:32:39 [Info] [2105705622] App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: connection ends > io: read/write on closed pipe
2018/06/15 17:32:39 [Info] [2105705622] App|Proxyman|Inbound: failed to close connection > Transport|Internet|mKCP: Connection closed.
2018/06/15 17:32:39 [Info] [2105705622] App|Proxyman|Outbound: failed to process outbound traffic > Proxy|Freedom: connection ends > context canceled
客户端错误日志:
    // 在这里附上客户端日志

  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    // 在这里附上服务器端日志
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

请预览一下你填的内容再提交。

如果你已经填完上面的问卷,请把下面的英文部份删除,再提交 Issue。
Please remove the Chinese section above.

English:
Please read the instruction and answer the following questions before submitting your issue. Thank you.
Please answer all the questions with enough information. All issues not following this template will be closed immediately.

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?

  2. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.

  3. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)

  4. What's your expectation?

  5. Please attach your configuration file (Mask IP addresses before submit this issue).

    Server configuration:

    // Please attach your server configuration here.
Client configuration:
    // Please attach your client configuration here.
  1. Please attach error logs, especially the bottom lines if the file is large. Error log file is usually at /var/log/v2ray/error.log on Linux.

    Server error log:

    // Please attach your server error log here.
Client error log:
    // Please attach your client error log here.
  1. Please attach access log. Access log is usually at '/var/log/v2ray/access.log' on Linux.
    // Please attach your server access log here.

Please review your issue before submitting.

  1. Other configurations (such as Nginx) and logs.

  2. If V2Ray doesn't run, please attach output from --test.

The command is usually /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json, but may vary according to your scenario.

  1. If V2Ray service doesn't run, please attach journal log.

Usual command is journalctl -u v2ray.

@silent-x
Copy link

个人感觉3.22断流现象不明显 但是有内存泄露 3.26断流比较明显 无论是单server 3.26 单client 3.26 server client都3.26 都有断流现象

@ak47for
Copy link
Author

ak47for commented Jun 21, 2018

@silent-x 您在3.22是怎么配置v2ray的,另外,是通过什么方式测试断流的?
看之前有人说可能是运营商Qos导致的,我通过debug感觉是因为v2ray vmess执行process的时候出错导致的
,日志如下:
2018/06/15 17:32:39 [Info] [2105705622] App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: connection ends > io: read/write on closed pipe

@silent-x
Copy link

@Dragonzhi 最简单的配置 加个TLS

写个脚本去wget 同一时刻同一服务器SSR不断 v2ray断 基本可以断定是v2ray的问题

还有一点就是开了mux几率大点 不开mux就不太会断 但是速度就和SSR差不多了

@ak47for
Copy link
Author

ak47for commented Jun 21, 2018

@silent-x 嗯,我这边客户端和服务端通过kcp协议进行通信,没有开mux,对速度没有要求,
就是玩网游偶尔掉线,我也觉得是v2ray的问题,感觉是v2ray server内部读写数据的时候出错了

@imhun
Copy link

imhun commented Jun 21, 2018

开了v2ray,vmess+kcp,一个vps一周时间,昨天ip被封了,之前的ss虽然偶然有丢包的情况,但是从来没有被封过ip,真是蛋疼啊,还是老实用ss了,虽然慢点,但是有保障啊

@silent-x
Copy link

@huwsun host在哪个主机商?v2ray应该没有特征吧

@ak47for ak47for changed the title 断流现象依然存在 断流现象依然存在(游戏掉线) Jun 21, 2018
@ak47for
Copy link
Author

ak47for commented Jun 21, 2018

又测试了一次,大概跑了两个半小时复现了,还是同样读写错误,这次发生在客户端,进一步证明应该和运营商没关系,就是v2ray本身代码的问题
客户端日志:
2018/06/21 15:52:35 [Debug] Transport|Internet|mKCP: #21810 entering state 1 at 9194185
2018/06/21 15:52:35 [Info] Transport|Internet|mKCP: #21810 closing connection to xxx:xxxx
2018/06/21 15:52:35 [Debug] Transport|Internet|mKCP: #21810 entering state 3 at 9194185
2018/06/21 15:52:35 [Info] [2173365823] App|Proxyman|Outbound: failed to process outbound traffic > Proxy|VMess|Outbound: connection ends > io: read/write on closed pipe
2018/06/21 15:52:35 [Info] [2173365823] App|Proxyman|Inbound: connection ends > Proxy|Socks: connection ends > Proxy|Socks: failed to transport all TCP request > io: read/write on closed pipe

@imhun
Copy link

imhun commented Jun 21, 2018

@silent-x linode的美国主机,翻墙好几年了,布了一回v2ray,ip就挂了。。。

@TanNang
Copy link

TanNang commented Jun 22, 2018

#748

@ak47for
Copy link
Author

ak47for commented Jun 22, 2018

@TanNang

#748 我也看了,但是好像也没得出确定的结论,只是说有可能是运营商的问题,我今天打算在局域网里进行测试,如果还能复现,那就不是运营商的问题了。测试完了,会把结果更新。

@ak47for
Copy link
Author

ak47for commented Jun 22, 2018

局域网内测试依然会断流,以固定大小速率发送数据包,现象一模一样,而且也是跑了大概两个半小时左右就断了,证明和运营商没有关系。
2018/06/22 15:57:40 [Debug] Transport|Internet|mKCP: #39924 entering state 1 at 9326857
2018/06/22 15:57:40 [Info] Transport|Internet|mKCP: #39924 closing connection to 192.168.15.183:16823
2018/06/22 15:57:40 [Debug] Transport|Internet|mKCP: #39924 entering state 3 at 9326857
2018/06/22 15:57:40 [Debug] Transport|Internet|mKCP: #39924 sending terminating cmd.
2018/06/22 15:57:40 [Debug] Transport|Internet|mKCP: #39924 entering state 5 at 9326857
2018/06/22 15:57:40 [Info] Transport|Internet|mKCP: #39924 terminating connection to 192.168.15.183:16823
2018/06/22 15:57:40 [Info] [2003657591] App|Proxyman|Outbound: failed to process outbound traffic > Proxy|VMess|Outbound: connection ends > io: read/write on closed pipe
2018/06/22 15:57:40 [Info] [2003657591] App|Proxyman|Inbound: connection ends > Proxy|Socks: connection ends > Proxy|Socks: failed to transport all TCP request > io: read/write on closed pipe

@k79e
Copy link

k79e commented Jun 23, 2018

@Dragonzhi
我lan测试也是那样
而且我找到了问题根源
我服务器kcp是在全局设置里面有点改动
客户端如果在全局设置里 配置kcp 那么下载文件会断流
我的配置文件https://pastebin.com/1cBGj9he

client

curl: (18) transfer closed with 103828653 bytes remaining to read
server

2018/06/23 20:09:17 [Info] [3576647992] Transport|Internet|TCP: dialing TCP to tcp:127.0.0.1:80
2018/06/23 20:09:19 [Info] [3576647992] App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: connection ends > io: read/write on closed pipe
2018/06/23 20:09:19 [Info] Transport|Internet|mKCP: #54791 closing connection to 192.168.1.2:61412
2018/06/23 20:09:19 [Info] Transport|Internet|mKCP: #54791 terminating connection to 192.168.1.2:61412

客户端 如果不配置kcp全局设置 那就没问题.
我怀疑这是bug.

而且这个代理也是rtt高了 速度上不去. 默认发送缓存怎么也随意3MBps了 但是测试反而就1.5M速度差不多..
怪事了 怎么和kcptun一模一样....

建议你改下标题 改成Lan测试断流.
反正你lan也断了么 这问题看起来好严重的.

2018-06-23 20:27:03
都用默认设置了 照样还断流!!!
cli工具下载文件的时候打断一下 然后重新下载 更容易触发...
正常下载100MB测试文件 第一次不断的话 多下几次肯定断.....

我用的curl下载的 要不然你也试试 下载个测试文件 然后ctrl+c 然后重新下载.
说不定当场就断.

连断11次
Imgur

@winds365
Copy link

winds365 commented Jun 23, 2018

一开始用的kcp也是各种断流,之后改成WebSocket+TLS+Web,从3.22版本到3.26基本没断过

@k79e
Copy link

k79e commented Jun 23, 2018

@winds365 那肯定的 这个断线只跟kcp有关.

@ak47for
Copy link
Author

ak47for commented Jun 25, 2018

@kxmp
感谢回复!
我下载测试文件也断流。
我看你回复里开始说不配置kcp全局设置就没问题了,后来又划掉了,最后还是有问题吗?
我在标题里加上局域网也断流了。
后续有进展我会更新在这里,大家多交流。
另外,有没有项目维护者帮忙关注下这个问题呢?这个不解决kcp没法用。

@ak47for ak47for changed the title 断流现象依然存在(游戏掉线) 断流现象依然存在(游戏掉线),局域网测试也断流! Jun 25, 2018
@k79e
Copy link

k79e commented Jun 25, 2018

@Dragonzhi

不配置kcp全局设置就没问题了,后来又划掉了

肯定是有问题啊.

@ak47for
Copy link
Author

ak47for commented Jun 25, 2018

哎,这个问题看到很久之前就有了,一直没解决。。。

@k79e
Copy link

k79e commented Jun 25, 2018

我发现了点奇怪的地方
完整日志

srvlog
2018/06/25 13:52:32 [Info] Transport|Internet|mKCP: #46299 creating connection to 192.168.1.2:59022
2018/06/25 13:52:32 192.168.1.2:59022 accepted tcp:127.0.0.1:80
2018/06/25 13:52:32 [Info] [1903452515] Proxy|VMess|Inbound: received request for tcp:127.0.0.1:80
2018/06/25 13:52:32 [Info] [1903452515] App|Dispatcher: default route for tcp:127.0.0.1:80
2018/06/25 13:52:32 [Info] [1903452515] Proxy|Freedom: opening connection to tcp:127.0.0.1:80
2018/06/25 13:52:33 [Info] [1903452515] Transport|Internet|TCP: dialing TCP to tcp:127.0.0.1:80
2018/06/25 13:52:33 [Debug] Transport|Internet|mKCP: #46299 entering state 4 at 400
2018/06/25 13:52:33 [Info] [1903452515] App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: connection ends > io: read/write on closed pipe
2018/06/25 13:52:33 [Debug] Transport|Internet|mKCP: #46299 entering state 5 at 402
2018/06/25 13:52:33 [Info] Transport|Internet|mKCP: #46299 closing connection to 192.168.1.2:59022
2018/06/25 13:52:33 [Info] Transport|Internet|mKCP: #46299 terminating connection to 192.168.1.2:59022
2018/06/25 13:52:33 [Info] [1903452515] App|Proxyman|Outbound: failed to process outbound traffic > Proxy|Freedom: connection ends > context canceled

client log
2018/06/25 13:52:32 tcp:127.0.0.1:60700 accepted tcp:127.0.0.1:80
2018/06/25 13:52:32 [Info] [822311719] Proxy|Socks: TCP Connect request to tcp:1
27.0.0.1:80
2018/06/25 13:52:32 [Info] [822311719] App|Dispatcher: default route for tcp:127
.0.0.1:80
2018/06/25 13:52:32 [Info] Transport|Internet|mKCP: dialing mKCP to udp:192.168.
1.4:8889
2018/06/25 13:52:32 [Info] Transport|Internet|mKCP: #46299 creating connection t
o 192.168.1.4:8889
2018/06/25 13:52:32 [Info] [822311719] Proxy|VMess|Outbound: tunneling request t
o tcp:127.0.0.1:80 via tcp:192.168.1.4:8889
2018/06/25 13:52:33 [Debug] Transport|Internet|mKCP: #46299 entering state 1 at
359
2018/06/25 13:52:33 [Info] Transport|Internet|mKCP: #46299 closing connection to
192.168.1.4:8889
2018/06/25 13:52:33 [Info] [822311719] App|Proxyman|Outbound: failed to process
outbound traffic > Proxy|VMess|Outbound: connection ends > cipher: message authe
ntication failed
2018/06/25 13:52:33 [Info] [822311719] App|Proxyman|Inbound: connection ends > P
roxy|Socks: connection ends > context canceled
2018/06/25 13:52:33 [Debug] Transport|Internet|mKCP: #46299 entering state 3 at
402
2018/06/25 13:52:33 [Debug] Transport|Internet|mKCP: #46299 sending terminating
cmd.
2018/06/25 13:52:37 [Debug] Transport|Internet|mKCP: #46299 sending terminating
cmd.
2018/06/25 13:52:42 [Debug] Transport|Internet|mKCP: #46299 sending terminating
cmd.
2018/06/25 13:52:42 [Debug] Transport|Internet|mKCP: #46299 entering state 5 at
10001
2018/06/25 13:52:42 [Info] Transport|Internet|mKCP: #46299 terminating connectio
n to 192.168.1.4:8889

我发现正常传输都是 服务器端日志 transport下面是 进入状态1 3 5
然后下载大文件直接断线的 却是 4 5

然后虽然大文件断线率100% 如果再去突然下载小文件却没事....

@ak47for
Copy link
Author

ak47for commented Jun 25, 2018

@kxmp
服务器和客户端都可能会引起断流,1 3 5证明是主动断开连接的一方,4 5是被动断开的,我从日志看服务器和客户端都可能主动断开连接。

@k79e
Copy link

k79e commented Jun 25, 2018

@Dragonzhi
我一生气又测了下
咋下载都不断流了....
用的win的服务器和win的客户端.......
难不成是win的客户端连接linux服务器有问题么!!!!!

这么说是win客户端移植出了问题么?!!

@k79e
Copy link

k79e commented Jun 25, 2018

我靠我用linux 服务端和linux客户端测了下
结果有那个问题.... 也是一模一样.... 100%掉线...
要不然就是速度启动不了 半天没速度 或者一开始有速度然后掉到0 (没模拟rtt好不好 0.0xms的rtt都这样!!! 太可怕了太可怕了太可怕了)

2018-06-25 16:20:50
8连断
Imgur

@TanNang
Copy link

TanNang commented Jun 25, 2018

服务器和客户端都可能会引起断流,1 3 5证明是主动断开连接的一方,4 5是被动断开的,我从日志看服务器和客户端都可能主动断开连接。

@Dragonzhi

根据开发者的注释:

StateActive          State = 0 // Connection is active
StateReadyToClose    State = 1 // Connection is closed locally
StatePeerClosed      State = 2 // Connection is closed on remote
StateTerminating     State = 3 // Connection is ready to be destroyed locally
StatePeerTerminating State = 4 // Connection is ready to be destroyed on remote
StateTerminated      State = 5 // Connection is destroyed.

1, 3 是本地关闭,2,4 是远端关闭

@ak47for
Copy link
Author

ak47for commented Jun 25, 2018

@TanNang
是啊,主动关闭一方,会依次进入1-->3--> 5 状态,被动关闭一方,会依次进入4-->5状态,现在这个断流的问题是:客户端和服务端都会突然主动关闭连接,主动关闭的一端进入1-->3-->5,然后另一端进入4-->5,现在我的疑问就是不知道为啥会有一端突然关闭连接进入1-->3-->5,查看了代码没有找到可疑的地方。

@ak47for
Copy link
Author

ak47for commented Jun 25, 2018

@kxmp
哈哈,不用生气,这个就是几率性的断流,我跑流量一般两三个小时才出现一次,习惯了。一起看看代码研究下吧,只是测试是解决不了问题的。

@ak47for ak47for changed the title 断流现象依然存在(游戏掉线),局域网测试也断流! @DarienRaymond 断流现象依然存在(游戏掉线),局域网测试也断流! Jun 25, 2018
@ak47for
Copy link
Author

ak47for commented Jun 28, 2018

试了一下v3.6,貌似比现在的版本稳定点,但是跑了两三天,v2ray server居然收不到包了,进程还在,监听端口还在,抓包看收不到包,进入一种僵死状态。
看来这个软件挺不稳定的。

@k79e
Copy link

k79e commented Jun 28, 2018

@Dragonzhi
收不到包是你被封了吧. 不开端口照样也能抓到包啊..

你用的什么模式啊. 是vmess么?

@ak47for
Copy link
Author

ak47for commented Jul 2, 2018

@kxmp 也有可能是被封了,但是上次也出现过,好像重启下v2ray就能抓到包了,很诡异。

@ak47for
Copy link
Author

ak47for commented Jul 11, 2018

加了一些日志发现,是服务器突然不往客户端发数据了(但是这时候游戏服务器是有数据发往v2ray服务器的),超过了客户度kcp的30ms最长收包间隔,所以连接断开了,导致游戏掉线,暂时不清楚为啥v2ray服务器突然不发数据了。

@VictoriaRaymond
Copy link
Member

请升级到最新版。如果还有kcp相关问题,请重新提交issue,并附上使用场景,比如下载文件的大小,并发连接数量等。

@k79e
Copy link

k79e commented Jul 27, 2018

v3.32还是那样
123

设置都默认的..
linux+win测试的.

配置文件
https://pastebin.com/7at8PaXQ

2018-07-27 21:02:06
浏览器测试照样失败

@ak47for
Copy link
Author

ak47for commented Aug 1, 2018

@kxmp 我起了个新issue,有兴趣可以关注
#1218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants