[GH-ISSUE #1267] KCP 模式下出现 login to server failed: i/o deadline reached #1004

Closed
opened 2026-05-05 12:38:54 -06:00 by gitea-mirror · 15 comments
Owner

Originally created by @Milokita on GitHub (May 29, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1267

最近发现KCP模式不稳定的情况,前一个月均正常

What version of frp are you using (./frpc -v or ./frps -v)?
0.26.0

What operating system and processor architecture are you using (go env)?
Debian 9, AMD64

Configures you used:
防火墙端口均打开
#frps [common] bind_port = 1234 token = REMOVED vhost_https_port = 443 vhost_http_port = 80 subdomain_host = 242c.cc kcp_bind_port = 9643
#FRPC
`
[common]
server_addr = REMOVED
server_port = 1234
token = REMOVED
protocol = kcp

[https]
type = https
local_ip = 127.0.0.1
local_port = 443
use_encryption = false
use_compression = false
proxy_protocol_version = v2
custom_domains = REMOVED
subdomain = www

[http]
type = http
local_ip = 127.0.0.1
local_port = 80
use_encryption = false
use_compression = false
proxy_protocol_version = v2
custom_domains = REMOVED
subdomain = www
`

Describe the results you received:
FRPC日志显示相关错误
2019/05/27 00:53:52 [W] [service.go:130] reconnect to server error: i/o deadline reached

FRPS显示相关错误
[vhost.go:154] http request for host [REMOVED] path [] not found
Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):
最近出现,远端服务器在日本,客户端在中国

Can you point out what caused this issue (optional)
最新一次测试过程中保持原配置情况下 重启服务器和客户端无法连接。关闭KCP就恢复正常。恢复KCP后连接无法建立
强制结束FRPC后有下列提示:
`
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x81a372]

goroutine 21 [running]:
github.com/fatedier/frp/client.(*Control).Close(0x0, 0x0, 0x2)
/home/wcl/go_projects/src/github.com/fatedier/frp/client/control.go:149 +0x22
github.com/fatedier/frp/client.(*Service).Close(...)
/home/wcl/go_projects/src/github.com/fatedier/frp/client/service.go:236
github.com/fatedier/frp/cmd/frpc/sub.handleSignal(0xc0001029a0)
/home/wcl/go_projects/src/github.com/fatedier/frp/cmd/frpc/sub/root.go:111 +0xd1
created by github.com/fatedier/frp/cmd/frpc/sub.startService
/home/wcl/go_projects/src/github.com/fatedier/frp/cmd/frpc/sub/root.go:216 +0x186
`

Originally created by @Milokita on GitHub (May 29, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1267 <!-- Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST --> 最近发现KCP模式不稳定的情况,前一个月均正常 **What version of frp are you using (./frpc -v or ./frps -v)?** 0.26.0 **What operating system and processor architecture are you using (`go env`)?** Debian 9, AMD64 **Configures you used:** 防火墙端口均打开 ` #frps [common] bind_port = 1234 token = REMOVED vhost_https_port = 443 vhost_http_port = 80 subdomain_host = 242c.cc kcp_bind_port = 9643 ` #FRPC ` [common] server_addr = REMOVED server_port = 1234 token = REMOVED protocol = kcp [https] type = https local_ip = 127.0.0.1 local_port = 443 use_encryption = false use_compression = false proxy_protocol_version = v2 custom_domains = REMOVED subdomain = www [http] type = http local_ip = 127.0.0.1 local_port = 80 use_encryption = false use_compression = false proxy_protocol_version = v2 custom_domains = REMOVED subdomain = www ` **Describe the results you received:** FRPC日志显示相关错误 `2019/05/27 00:53:52 [W] [service.go:130] reconnect to server error: i/o deadline reached` FRPS显示相关错误 `[vhost.go:154] http request for host [REMOVED] path [] not found` **Describe the results you expected:** **Additional information you deem important (e.g. issue happens only occasionally):** 最近出现,远端服务器在日本,客户端在中国 **Can you point out what caused this issue (optional)** 最新一次测试过程中保持原配置情况下 重启服务器和客户端无法连接。关闭KCP就恢复正常。恢复KCP后连接无法建立 强制结束FRPC后有下列提示: ` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x81a372] goroutine 21 [running]: github.com/fatedier/frp/client.(*Control).Close(0x0, 0x0, 0x2) /home/wcl/go_projects/src/github.com/fatedier/frp/client/control.go:149 +0x22 github.com/fatedier/frp/client.(*Service).Close(...) /home/wcl/go_projects/src/github.com/fatedier/frp/client/service.go:236 github.com/fatedier/frp/cmd/frpc/sub.handleSignal(0xc0001029a0) /home/wcl/go_projects/src/github.com/fatedier/frp/cmd/frpc/sub/root.go:111 +0xd1 created by github.com/fatedier/frp/cmd/frpc/sub.startService /home/wcl/go_projects/src/github.com/fatedier/frp/cmd/frpc/sub/root.go:216 +0x186 `
gitea-mirror 2026-05-05 12:38:54 -06:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@fatedier commented on GitHub (Jun 4, 2019):

暂时没有定位到原因,需要排查。

<!-- gh-comment-id:498514334 --> @fatedier commented on GitHub (Jun 4, 2019): 暂时没有定位到原因,需要排查。
Author
Owner

@befantasy commented on GitHub (Jun 5, 2019):

感觉和GFW有一定关系.之前偶尔遇到这种情况. VPS换到日本之后尤为频繁, 日本是GFW关注的重灾区. 把协议从KCP改到TCP以后暂时正常. 现在GFW是宁可错杀,绝不放过. SSH这种正常流量都经常被干扰, 会不会是KCP流量无法被GFW识别, 就被归为了可疑流量进行了干扰?

<!-- gh-comment-id:498936200 --> @befantasy commented on GitHub (Jun 5, 2019): 感觉和GFW有一定关系.之前偶尔遇到这种情况. VPS换到日本之后尤为频繁, 日本是GFW关注的重灾区. 把协议从KCP改到TCP以后暂时正常. 现在GFW是宁可错杀,绝不放过. SSH这种正常流量都经常被干扰, 会不会是KCP流量无法被GFW识别, 就被归为了可疑流量进行了干扰?
Author
Owner

@Milokita commented on GitHub (Jun 5, 2019):

感觉和GFW有一定关系.之前偶尔遇到这种情况. VPS换到日本之后尤为频繁, 日本是GFW关注的重灾区. 把协议从KCP改到TCP以后暂时正常. 现在GFW是宁可错杀,绝不放过. SSH这种正常流量都经常被干扰, 会不会是KCP流量无法被GFW识别, 就被归为了可疑流量进行了干扰?

我后来拿另外一个在日本的客户端(208.182.X.X)做测试,连接在同在日本的服务器(45.32.X.X) frpc.ini配置与之前相同,在开启了KCP的情况下依旧报错,可能不是国家防火墙的原因
@fatedier

<!-- gh-comment-id:499110107 --> @Milokita commented on GitHub (Jun 5, 2019): > > > 感觉和GFW有一定关系.之前偶尔遇到这种情况. VPS换到日本之后尤为频繁, 日本是GFW关注的重灾区. 把协议从KCP改到TCP以后暂时正常. 现在GFW是宁可错杀,绝不放过. SSH这种正常流量都经常被干扰, 会不会是KCP流量无法被GFW识别, 就被归为了可疑流量进行了干扰? 我后来拿另外一个在日本的客户端(208.182.X.X)做测试,连接在同在日本的服务器(45.32.X.X) frpc.ini配置与之前相同,在开启了KCP的情况下依旧报错,可能不是国家防火墙的原因 @fatedier
Author
Owner

@woall commented on GitHub (Jun 13, 2019):

23.3版本也是这样的,换tcp后重开进程就好了。

<!-- gh-comment-id:501540291 --> @woall commented on GitHub (Jun 13, 2019): 23.3版本也是这样的,换tcp后重开进程就好了。
Author
Owner

@xqiushi commented on GitHub (Jun 16, 2019):

版本0.27.局网内windows可以正常KCP.而MacOS却报错.而两种OS下TCP没有任何问题.

<!-- gh-comment-id:502409245 --> @xqiushi commented on GitHub (Jun 16, 2019): 版本0.27.局网内windows可以正常KCP.而MacOS却报错.而两种OS下TCP没有任何问题.
Author
Owner

@Milokita commented on GitHub (Jun 16, 2019):

版本0.27.局网内windows可以正常KCP.而MacOS却报错.而两种OS下TCP没有任何问题.

所以我认为应该是代码的问题

<!-- gh-comment-id:502417497 --> @Milokita commented on GitHub (Jun 16, 2019): > > > 版本0.27.局网内windows可以正常KCP.而MacOS却报错.而两种OS下TCP没有任何问题. 所以我认为应该是代码的问题
Author
Owner

@xqiushi commented on GitHub (Jun 17, 2019):

版本0.27.局网内windows可以正常KCP.而MacOS却报错.而两种OS下TCP没有任何问题.

所以我认为应该是代码的问题

我重启一下服务器端,结果所有客户端又双叒叕正常了

<!-- gh-comment-id:502671201 --> @xqiushi commented on GitHub (Jun 17, 2019): > > 版本0.27.局网内windows可以正常KCP.而MacOS却报错.而两种OS下TCP没有任何问题. > > 所以我认为应该是代码的问题 我重启一下服务器端,结果所有客户端又双叒叕正常了
Author
Owner

@asd1614 commented on GitHub (Jul 8, 2019):

我的情况是只要有一个客户端网络被中断后(类似电信宽带光猫重启),所有的客户端都登录不了服务端建立连接

<!-- gh-comment-id:509047550 --> @asd1614 commented on GitHub (Jul 8, 2019): 我的情况是只要有一个客户端网络被中断后(类似电信宽带光猫重启),所有的客户端都登录不了服务端建立连接
Author
Owner

@zbigbird commented on GitHub (Jul 16, 2019):

今天frpc突然出现这个提示,不知道是什么原因? [W] [service.go:82] login to server failed: i/o deadline reached
有大佬能指点一下吗?

<!-- gh-comment-id:511624030 --> @zbigbird commented on GitHub (Jul 16, 2019): 今天frpc突然出现这个提示,不知道是什么原因? [W] [service.go:82] login to server failed: i/o deadline reached 有大佬能指点一下吗?
Author
Owner

@san3Xian commented on GitHub (Jul 16, 2019):

要不试试在server tcpdump看看?我有个类似情况,server显示收到client报文的,但是frps没有做出反应

<!-- gh-comment-id:511841032 --> @san3Xian commented on GitHub (Jul 16, 2019): 要不试试在server tcpdump看看?我有个类似情况,server显示收到client报文的,但是frps没有做出反应
Author
Owner

@chen23188 commented on GitHub (Jul 17, 2019):

同样的问题,版本0.27,在服务端重启一次frps,frpc就能正常连接了。

<!-- gh-comment-id:512183100 --> @chen23188 commented on GitHub (Jul 17, 2019): 同样的问题,版本0.27,在服务端重启一次frps,frpc就能正常连接了。
Author
Owner

@Milokita commented on GitHub (Jul 17, 2019):

重启之后过一会儿还是会掉------------------ 原始邮件 ------------------
发件人: "c23188"notifications@github.com
发送时间: 2019年7月17日(星期三) 下午5:45
收件人: "fatedier/frp"frp@noreply.github.com;
抄送: "XNG"flipwing@qq.com;"Author"author@noreply.github.com;
主题: Re: [fatedier/frp] KCP 模式下出现 login to server failed: i/o deadline reached (#1267)

同样的问题,版本0.27,在服务端重启一次frps,frpc就能正常连接了。


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<!-- gh-comment-id:512186555 --> @Milokita commented on GitHub (Jul 17, 2019): 重启之后过一会儿还是会掉------------------ 原始邮件 ------------------ 发件人: "c23188"<notifications@github.com> 发送时间: 2019年7月17日(星期三) 下午5:45 收件人: "fatedier/frp"<frp@noreply.github.com>; 抄送: "XNG"<flipwing@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [fatedier/frp] KCP 模式下出现 login to server failed: i/o deadline reached (#1267) 同样的问题,版本0.27,在&#x670D;务端重启一次frps,frpc就能正常连接了。 &mdash; You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

@linfangrong commented on GitHub (Jul 24, 2019):

同样问题,frps在腾讯云。版本0.27.0
2019/07/24 21:58:55 [W] [service.go:82] login to server failed: i/o deadline reached

感觉是只能存在一个kcp的连接,多个之后会出现这个问题。

<!-- gh-comment-id:514645658 --> @linfangrong commented on GitHub (Jul 24, 2019): 同样问题,frps在腾讯云。版本0.27.0 2019/07/24 21:58:55 [W] [service.go:82] login to server failed: i/o deadline reached 感觉是只能存在一个kcp的连接,多个之后会出现这个问题。
Author
Owner

@ntkernel commented on GitHub (Nov 23, 2019):

0.29.1重启frps(深圳阿里)后frpc(广州移动)可以连接,关了frpc之后在开一次frpc就出错,在阿里开frpc(深圳)可以运行(frpc的server addr = 公网ip)

当我填错kcp端口时也会出现这个问题

<!-- gh-comment-id:557807647 --> @ntkernel commented on GitHub (Nov 23, 2019): 0.29.1重启frps(深圳阿里)后frpc(广州移动)可以连接,关了frpc之后在开一次frpc就出错,在阿里开frpc(深圳)可以运行(frpc的server addr = 公网ip) 当我填错kcp端口时也会出现这个问题
Author
Owner

@ntkernel commented on GitHub (Nov 23, 2019):

经测试,广州移动无法kcp连接深圳阿里
美国hostens服务器2.56.175.x可以kcp连接至深圳阿里
估计是网络环境问题,移动封了udp
到时候到学校进行测试

<!-- gh-comment-id:557810610 --> @ntkernel commented on GitHub (Nov 23, 2019): 经测试,广州移动无法kcp连接深圳阿里 美国hostens服务器2.56.175.x可以kcp连接至深圳阿里 估计是网络环境问题,移动封了udp 到时候到学校进行测试
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1004
No description provided.