mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1230] 服务端检测到超时后,关闭连接。此时只能重启服务端才能重新使用 #969
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#969
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @va3rrw on GitHub (May 4, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1230
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
What version of frp are you using (./frpc -v or ./frps -v)?
两端都是 0.27.0
What operating system and processor architecture are you using (
go env)?服务端:CentOS 6.4
客户端: CentOS 6.5
Configures you used:
======================
frps:
======================
[common]
bind_port = 7000
bind_udp_port = 7001
kcp_bind_port = 7000
vhost_http_port = 7080
heartbeat_timeout = 120
dashboard_addr = 0.0.0.0
dashboard_port = 7500
dashboard_user = xxxxx
dashboard_pwd = xxxxxxxx
token = xxxxxxxxx
allow_ports = 2000-3000,3001,3003,4000-8000
log_file = /var/log/frps.log
log_level = debug
======================
frpc.ini
======================
[common]
token = xxxxxxxx
server_addr = 198.199.xxx.xxx
server_port = 7000
login_fail_exit = false
tls_enable = true
admin_addr = 192.168.123.71
admin_port = 7500
admin_user = xxxxx
admin_pwd = xxxxxxxx
log_file = /var/log/frpc.log
log_level = debug
[p2p_ssh_tb]
type = stcp
sk = xxxxxxxx
local_ip = 127.0.0.1
local_port = 22
use_encryption = true
use_compression = true
[tb-web]
type = http
local_ip = 192.168.123.71
local_port = 80
use_compression = true
custom_domains = web.xxxxxxx.com
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
服务器应该不关闭连接,等待客户端重连
Additional information you deem important (e.g. issue happens only occasionally):
log:
2019/05/04 09:35:14 [I] [http.go:72] [881af55c7c4289cf] [tb-web] http proxy listen for host [web.tuo-bang.cn] location []
2019/05/04 09:35:14 [I] [control.go:398] [881af55c7c4289cf] new proxy [tb-web] success
2019/05/04 09:35:14 [I] [stcp.go:34] [881af55c7c4289cf] [p2p_ssh_tb] stcp proxy custom listen success
2019/05/04 09:35:14 [I] [control.go:398] [881af55c7c4289cf] new proxy [p2p_ssh_tb] success
2019/05/04 09:35:41 [D] [control.go:410] [8f0f2d3aa06c9c1b] receive heartbeat
2019/05/04 09:35:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:36:11 [D] [control.go:410] [8f0f2d3aa06c9c1b] receive heartbeat
2019/05/04 09:36:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:36:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:37:01 [D] [service.go:325] Accept new mux stream error: keepalive timeout
2019/05/04 09:37:01 [D] [control.go:300] [8f0f2d3aa06c9c1b] control connection closed
2019/05/04 09:37:01 [I] [control.go:274] [8f0f2d3aa06c9c1b] control writer is closing
2019/05/04 09:37:01 [I] [control.go:350] [8f0f2d3aa06c9c1b] client exit success
2019/05/04 09:37:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:37:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:38:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:38:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:39:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:39:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:40:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:40:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:41:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:41:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:42:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:42:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:43:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:43:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:44:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:44:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:45:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:45:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:46:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:46:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:47:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:47:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:48:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:48:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:49:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:49:44 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:50:14 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/04 09:50:33 [D] [service.go:325] Accept new mux stream error: keepalive timeout
2019/05/04 09:50:33 [D] [control.go:300] [881af55c7c4289cf] control connection closed
2019/05/04 09:50:33 [I] [control.go:274] [881af55c7c4289cf] control writer is closing
2019/05/04 09:50:33 [I] [proxy.go:69] [881af55c7c4289cf] [tb-web] proxy closing
2019/05/04 09:50:33 [I] [proxy.go:69] [881af55c7c4289cf] [p2p_ssh_tb] proxy closing
2019/05/04 09:50:33 [I] [control.go:350] [881af55c7c4289cf] client exit success
2019/05/04 09:50:33 [I] [proxy.go:135] [881af55c7c4289cf] [p2p_ssh_tb] listener is closed
此时所有连接均被关闭。
Can you point out what caused this issue (optional)
@fatedier commented on GitHub (May 5, 2019):
重连是默认行为,可以在同一台机器上尝试你的操作步骤做验证。
@va3rrw commented on GitHub (May 5, 2019):
补充log
2019/05/05 05:28:22 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
2019/05/05 05:28:35 [D] [control.go:410] [8f0f2d3aa06c9c1b] receive heartbeat
2019/05/05 05:28:36 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/05 05:28:52 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
2019/05/05 05:29:05 [D] [control.go:410] [8f0f2d3aa06c9c1b] receive heartbeat
2019/05/05 05:29:06 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/05 05:29:22 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
2019/05/05 05:29:30 [D] [service.go:325] Accept new mux stream error: keepalive timeout
2019/05/05 05:29:30 [D] [control.go:300] [8f0f2d3aa06c9c1b] control connection closed
2019/05/05 05:29:30 [I] [control.go:274] [8f0f2d3aa06c9c1b] control writer is closing
2019/05/05 05:29:30 [I] [control.go:350] [8f0f2d3aa06c9c1b] client exit success <---- 连接9c1b断开
2019/05/05 05:29:36 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/05 05:29:52 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
2019/05/05 05:30:06 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/05 05:30:22 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
..................................省略
2019/05/05 05:36:06 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/05 05:36:22 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
2019/05/05 05:36:36 [D] [control.go:410] [881af55c7c4289cf] receive heartbeat
2019/05/05 05:36:52 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
2019/05/05 05:37:07 [D] [service.go:325] Accept new mux stream error: keepalive timeout
2019/05/05 05:37:07 [D] [control.go:300] [881af55c7c4289cf] control connection closed
2019/05/05 05:37:07 [I] [control.go:274] [881af55c7c4289cf] control writer is closing
2019/05/05 05:37:07 [I] [proxy.go:69] [881af55c7c4289cf] [tb-web] proxy closing
2019/05/05 05:37:07 [I] [proxy.go:69] [881af55c7c4289cf] [p2p_ssh_tb] proxy closing
2019/05/05 05:37:07 [I] [control.go:350] [881af55c7c4289cf] client exit success <---- 连接89cf断开
2019/05/05 05:37:07 [I] [proxy.go:135] [881af55c7c4289cf] [p2p_ssh_tb] listener is closed
2019/05/05 05:37:22 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
2019/05/05 05:37:52 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
2019/05/05 05:38:22 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
..................................省略
2019/05/05 06:06:52 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
2019/05/05 06:07:22 [D] [control.go:410] [fb55325067d6ed53] receive heartbeat
超过30分钟后,断开的两个连接也没有恢复.
@fatedier commented on GitHub (May 5, 2019):
先在同一台机器上尝试你的操作步骤做验证,看是否有异常。
@va3rrw commented on GitHub (May 7, 2019):
在服务端服务器上开了一个frpc进程,30分钟后连接还在。
@fatedier commented on GitHub (May 7, 2019):
所以如果重连连接不上可能还是网络问题。可以看客户端的日志是什么原因重连失败。
@keeno1982 commented on GitHub (May 7, 2019):
这个问题从0.25.0这个版本开始就一直有这个问题,本地的frpc不会断线,从公网连接的半小时左右必断。我已经退回0.24.1连续不断线1个多星期了 @va3rrw 。希望能看看 @fatedier
@va3rrw commented on GitHub (May 8, 2019):
@keeno1982 谢谢. 我也退回去试试。
@va3rrw commented on GitHub (May 8, 2019):
@fatedier 客户端报的失败原因如下:
2019/05/05 14:11:01 [I] [service.go:221] login to server success, get run id [881af55c7c4289cf], server udp port [7001]
2019/05/05 14:11:01 [I] [proxy_manager.go:137] [881af55c7c4289cf] proxy added: [p2p_ssh_tb tb-web]
2019/05/05 14:11:02 [I] [control.go:144] [tb-web] start proxy success
2019/05/05 14:11:02 [I] [control.go:144] [p2p_ssh_tb] start proxy success
2019/05/05 14:31:19 [E] [control.go:127] work connection closed, EOF
2019/05/05 14:31:19 [I] [control.go:228] control writer is closing
2019/05/05 14:31:19 [I] [service.go:127] try to reconnect to server...
2019/05/05 14:31:29 [W] [service.go:130] reconnect to server error: connection write timeout
2019/05/05 14:31:30 [I] [service.go:127] try to reconnect to server...
2019/05/05 14:31:40 [W] [service.go:130] reconnect to server error: connection write timeout
2019/05/05 14:31:42 [I] [service.go:127] try to reconnect to server...
退回到0.24.1后, 注意到0.27.0的log中不记录心跳信号。 下面的0.24.1的log:
2019/05/08 10:10:14 [I] [service.go:214] login to server success, get run id [d013f4808f84f378], server udp port [7001]
2019/05/08 10:10:14 [I] [proxy_manager.go:137] [d013f4808f84f378] proxy added: [p2p_ssh_tb tb-web]
2019/05/08 10:10:14 [I] [service.go:108] admin server listen on 192.168.123.71:7500
2019/05/08 10:10:14 [I] [control.go:143] [p2p_ssh_tb] start proxy success
2019/05/08 10:10:14 [I] [control.go:143] [tb-web] start proxy success
2019/05/08 10:10:44 [D] [control.go:249] send heartbeat to server
2019/05/08 10:10:44 [D] [control.go:270] receive heartbeat from server
2019/05/08 10:11:14 [D] [control.go:249] send heartbeat to server
2019/05/08 10:11:14 [D] [control.go:270] receive heartbeat from server
2019/05/08 10:11:44 [D] [control.go:249] send heartbeat to server
2019/05/08 10:11:44 [D] [control.go:270] receive heartbeat from server
@fatedier commented on GitHub (May 8, 2019):
需要定位下原因,可能和 tls 的启用相关。
@va3rrw commented on GitHub (May 8, 2019):
@fatedier @keeno1982 使用0.24.1已经8个小时, 目前正常. 中间也发生过连接中断, 但客户端很快就重连回来了.
2019/05/08 08:38:05 [D] [control.go:409] [3f2c3bcc26d380a6] receive heartbeat
2019/05/08 08:38:05 [D] [control.go:409] [d013f4808f84f378] receive heartbeat
2019/05/08 08:38:35 [D] [control.go:409] [3f2c3bcc26d380a6] receive heartbeat
2019/05/08 08:38:35 [D] [control.go:409] [d013f4808f84f378] receive heartbeat
2019/05/08 08:38:38 [D] [service.go:302] Accept new mux stream error: keepalive timeout
2019/05/08 08:38:38 [D] [control.go:300] [d013f4808f84f378] control connection closed
2019/05/08 08:38:38 [I] [control.go:274] [d013f4808f84f378] control writer is closing
2019/05/08 08:38:38 [I] [proxy.go:67] [d013f4808f84f378] [tb-web] proxy closing
2019/05/08 08:38:38 [I] [proxy.go:67] [d013f4808f84f378] [p2p_ssh_tb] proxy closing
2019/05/08 08:38:38 [I] [control.go:349] [d013f4808f84f378] client exit success
2019/05/08 08:38:38 [I] [proxy.go:112] [d013f4808f84f378] [p2p_ssh_tb] listener is closed
2019/05/08 08:38:42 [I] [service.go:317] client login info: ip [180.114.106.245:39552] version [0.24.1] hostname [] os [linux] arch [amd64]
2019/05/08 08:38:42 [I] [http.go:67] [d013f4808f84f378] [tb-web] http proxy listen for host [web.tuo-bang.cn] location []
2019/05/08 08:38:42 [I] [control.go:397] [d013f4808f84f378] new proxy [tb-web] success
2019/05/08 08:38:42 [I] [stcp.go:34] [d013f4808f84f378] [p2p_ssh_tb] stcp proxy custom listen success
2019/05/08 08:38:42 [I] [control.go:397] [d013f4808f84f378] new proxy [p2p_ssh_tb] success
2019/05/08 08:38:43 [D] [control.go:189] [d013f4808f84f378] new work connection registered
2019/05/08 08:39:05 [D] [control.go:409] [3f2c3bcc26d380a6] receive heartbeat
2019/05/08 08:39:12 [D] [control.go:409] [d013f4808f84f378] receive heartbeat
@keeno1982 commented on GitHub (May 9, 2019):
@va3rrw 是吧,我的配置文件没改,从0.25.0开始,每个版本都试过全部会自动断线并且无法恢复,只要一换回0.24.1立马稳如狗。看来是要等大神 @fatedier 修复了。
@ssdphp commented on GitHub (May 11, 2019):
我也是和这位兄弟一样的问题。其实就是 内网用的电信,内网平均3天会被电信强制换ip断网,过程持续3-10分钟。然后,frps版本大于24就要鸡鸡。显示客户端不在线。必须要重启服务端才可以生效,目前我也是退回到23版本解决的这个问题。
@takhello commented on GitHub (Jul 14, 2022):
2022了 问题依然在