[GH-ISSUE #3556] frpc启动时有个严重BUG #2835

Closed
opened 2026-05-05 13:50:03 -06:00 by gitea-mirror · 8 comments
Owner

Originally created by @gexiaopeng on GitHub (Jul 28, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3556

Bug Description

frpc启动的时候,如果frps服务器连接不上(网络异常,或者服务器停止等),客户端只连接一次,不会再重新连接。这样导致服务器启动以后,客户端无法连接。日志如下:
2023/07/27 17:26:18 [I] [root.go:220] start frpc service for config file [/usr/local/frp/frpc.ini]
2023/07/27 17:26:28 [W] [service.go:133] login to server failed: dial tcp 115.xxx.xxx.xxx:7000: i/o timeout
2023/07/27 17:26:28 [I] [root.go:236] frpc service for config file [/usr/local/frp/frpc.ini] stopped

frpc Version

0.51.0

frps Version

0.51.0

System Architecture

linux(centos stream 9)/amd64

Configurations

[Unit]
Description = frp client
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
ExecStartPre=/bin/sleep 5
ExecStart = /usr/local/frp/frpc -c /usr/local/frp/frpc.ini

[Install]
WantedBy = multi-user.target

Logs

2023/07/27 17:26:18 [I] [root.go:220] start frpc service for config file [/usr/local/frp/frpc.ini]
2023/07/27 17:26:28 [W] [service.go:133] login to server failed: dial tcp 115.xxx.xxx.xxx:7000: i/o timeout
2023/07/27 17:26:28 [I] [root.go:236] frpc service for config file [/usr/local/frp/frpc.ini] stopped

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @gexiaopeng on GitHub (Jul 28, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3556 ### Bug Description frpc启动的时候,如果frps服务器连接不上(网络异常,或者服务器停止等),客户端只连接一次,不会再重新连接。这样导致服务器启动以后,客户端无法连接。日志如下: 2023/07/27 17:26:18 [I] [root.go:220] start frpc service for config file [/usr/local/frp/frpc.ini] 2023/07/27 17:26:28 [W] [service.go:133] login to server failed: dial tcp 115.xxx.xxx.xxx:7000: i/o timeout 2023/07/27 17:26:28 [I] [root.go:236] frpc service for config file [/usr/local/frp/frpc.ini] stopped ### frpc Version 0.51.0 ### frps Version 0.51.0 ### System Architecture linux(centos stream 9)/amd64 ### Configurations [Unit] Description = frp client After = network.target syslog.target Wants = network.target [Service] Type = simple ExecStartPre=/bin/sleep 5 ExecStart = /usr/local/frp/frpc -c /usr/local/frp/frpc.ini [Install] WantedBy = multi-user.target ### Logs 2023/07/27 17:26:18 [I] [root.go:220] start frpc service for config file [/usr/local/frp/frpc.ini] 2023/07/27 17:26:28 [W] [service.go:133] login to server failed: dial tcp 115.xxx.xxx.xxx:7000: i/o timeout 2023/07/27 17:26:28 [I] [root.go:236] frpc service for config file [/usr/local/frp/frpc.ini] stopped ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:50:03 -06:00
Author
Owner

@zlm324 commented on GitHub (Jul 28, 2023):

试试客户端的配置?
[common]
login_fail_exit = false

<!-- gh-comment-id:1655739220 --> @zlm324 commented on GitHub (Jul 28, 2023): 试试客户端的配置? [common] login_fail_exit = false
Author
Owner

@vikii0210 commented on GitHub (Aug 3, 2023):

这个有点搞笑了,楼上说的没错,那个frps or frpc 的full配置好好学习学习

<!-- gh-comment-id:1663503230 --> @vikii0210 commented on GitHub (Aug 3, 2023): 这个有点搞笑了,楼上说的没错,那个frps or frpc 的full配置好好学习学习
Author
Owner

@gexiaopeng commented on GitHub (Aug 4, 2023):

这个有点搞笑了,楼上说的没错,那个frps or frpc 的full配置好好学习学习
就算有这个配置,默认应该是login_fail_exit = false,否则启动的时候经常失败了就停止,有时服务器重启我们也不知道frpc是否启动成功。服务随机器启动以后,虽然可以延迟运行,但有时网络不一定马上能连接上,这样就导致启动失败。

<!-- gh-comment-id:1665285932 --> @gexiaopeng commented on GitHub (Aug 4, 2023): > 这个有点搞笑了,楼上说的没错,那个frps or frpc 的full配置好好学习学习 就算有这个配置,默认应该是login_fail_exit = false,否则启动的时候经常失败了就停止,有时服务器重启我们也不知道frpc是否启动成功。服务随机器启动以后,虽然可以延迟运行,但有时网络不一定马上能连接上,这样就导致启动失败。
Author
Owner

@einsbiao commented on GitHub (Aug 16, 2023):

这个有点搞笑了,楼上说的没错,那个frps or frpc 的full配置好好学习学习
就算有这个配置,默认应该是login_fail_exit = false,否则启动的时候经常失败了就停止,有时服务器重启我们也不知道frpc是否启动成功。服务随机器启动以后,虽然可以延迟运行,但有时网络不一定马上能连接上,这样就导致启动失败。

同意这个观点,为什么默认不自动重连呢

<!-- gh-comment-id:1680210946 --> @einsbiao commented on GitHub (Aug 16, 2023): > > 这个有点搞笑了,楼上说的没错,那个frps or frpc 的full配置好好学习学习 > > 就算有这个配置,默认应该是login_fail_exit = false,否则启动的时候经常失败了就停止,有时服务器重启我们也不知道frpc是否启动成功。服务随机器启动以后,虽然可以延迟运行,但有时网络不一定马上能连接上,这样就导致启动失败。 同意这个观点,为什么默认不自动重连呢
Author
Owner

@ddddavid-he commented on GitHub (Aug 24, 2023):

以上讨论的方法是可行的,但是问题也是客观存在的,而且大概是在0.5x版本更新后才出现的问题,看起来是frpc的默认设置改了。

<!-- gh-comment-id:1692088802 --> @ddddavid-he commented on GitHub (Aug 24, 2023): 以上讨论的方法是可行的,但是问题也是客观存在的,而且大概是在0.5x版本更新后才出现的问题,看起来是frpc的默认设置改了。
Author
Owner

@vikii0210 commented on GitHub (Aug 29, 2023):

我觉得frp的作者是严谨的,当你连接失败就退出这个默认策略,是从安全角度考虑的吧。

<!-- gh-comment-id:1696919911 --> @vikii0210 commented on GitHub (Aug 29, 2023): > 我觉得frp的作者是严谨的,当你连接失败就退出这个默认策略,是从安全角度考虑的吧。
Author
Owner

@github-actions[bot] commented on GitHub (Sep 29, 2023):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1740159335 --> @github-actions[bot] commented on GitHub (Sep 29, 2023): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Author
Owner

@wzm2256 commented on GitHub (Oct 23, 2023):

试试客户端的配置? [common] login_fail_exit = false

而且就算加上两行连不上还是秒退。版本0.52.2

刚才测试0.51版本可行

<!-- gh-comment-id:1775637844 --> @wzm2256 commented on GitHub (Oct 23, 2023): > 试试客户端的配置? [common] login_fail_exit = false 而且就算加上两行连不上还是秒退。版本[0.52.2](https://github.com/fatedier/frp/releases/tag/v0.52.2) 刚才测试0.51版本可行
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#2835
No description provided.