[GH-ISSUE #1558] 重启报错login to server failed: lookup xxxxxx i/o timeout #1232

Closed
opened 2026-05-05 12:47:23 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @DalekFrog on GitHub (Dec 10, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1558

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

What operating system and processor architecture are you using (go env)?
ubuntu 16.04

Configures you used:
[common]
server_addr = frp.example.com
server_port = 52222
protocol = kcp
use_encryption = true
use_compression = true
login_fail_exit = true

Steps to reproduce the issue:
1.使用systemd管理,按照项目中的frpc.service配置
2.重启

Describe the results you received:

不知道是不是我环境问题,重启基本都能复现,service中也已经有了After=network.target
但是systemctl restart frpc又是可以正常使用的

# systemctl status  frpc
● frpc.service - Frp Client Service
   Loaded: loaded (/usr/lib/systemd/system/frpc.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-12-10 12:20:12 HKT; 3h 25min ago
 Main PID: 1474 (frpc)
    Tasks: 9
   Memory: 9.5M
      CPU: 16ms
   CGroup: /system.slice/frpc.service
           └─1474 /usr/local/bin/frpc -c /etc/frp/frpc.ini

Dec 10 12:20:12 myhostname systemd[1]: Started Frp Client Service.
Dec 10 12:20:22 myhostname frpc[1474]: 2019/12/10 12:20:22 [W] [service.go:97] login to server failed: lookup xxxxxxxxxxx on 10.20.30.5:53: read udp 10.20.111.249:49326->10.20.30.5:53: i/o timeout
# cat /usr/lib/systemd/system/frpc.service
[Unit]
Description=Frp Client Service
After=network.target

[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/local/bin/frpc reload -c /etc/frp/frpc.ini

[Install]
WantedBy=multi-user.target

简单看了下service.go,既然走到了“"login to server failed:”这个warn,应该继续判断有login_fail_exit = true,进而推出,然后可以由systemd重启。

不明白为什么一直在这个warning中没有下文了。重启服务器基本必现,但只要restart一下service就又可以了。有可能是因为network没有启动完全或者什么的原因,但我以为可以利用login_fail_exit = true来迫使systemd重启frpc。

所以不知道问题出在什么地方

Originally created by @DalekFrog on GitHub (Dec 10, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1558 **What version of frp are you using (./frpc -v or ./frps -v)?** 0.30.0 **What operating system and processor architecture are you using (`go env`)?** ubuntu 16.04 **Configures you used:** [common] server_addr = frp.example.com server_port = 52222 protocol = kcp use_encryption = true use_compression = true login_fail_exit = true **Steps to reproduce the issue:** 1.使用systemd管理,按照项目中的frpc.service配置 2.重启 **Describe the results you received:** 不知道是不是我环境问题,重启基本都能复现,service中也已经有了After=network.target 但是systemctl restart frpc又是可以正常使用的 ``` # systemctl status frpc ● frpc.service - Frp Client Service Loaded: loaded (/usr/lib/systemd/system/frpc.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2019-12-10 12:20:12 HKT; 3h 25min ago Main PID: 1474 (frpc) Tasks: 9 Memory: 9.5M CPU: 16ms CGroup: /system.slice/frpc.service └─1474 /usr/local/bin/frpc -c /etc/frp/frpc.ini Dec 10 12:20:12 myhostname systemd[1]: Started Frp Client Service. Dec 10 12:20:22 myhostname frpc[1474]: 2019/12/10 12:20:22 [W] [service.go:97] login to server failed: lookup xxxxxxxxxxx on 10.20.30.5:53: read udp 10.20.111.249:49326->10.20.30.5:53: i/o timeout ``` ``` # cat /usr/lib/systemd/system/frpc.service [Unit] Description=Frp Client Service After=network.target [Service] Type=simple User=nobody Restart=on-failure RestartSec=5s ExecStart=/usr/local/bin/frpc -c /etc/frp/frpc.ini ExecReload=/usr/local/bin/frpc reload -c /etc/frp/frpc.ini [Install] WantedBy=multi-user.target ``` 简单看了下service.go,既然走到了“"login to server failed:”这个warn,应该继续判断有`login_fail_exit = true`,进而推出,然后可以由systemd重启。 不明白为什么一直在这个warning中没有下文了。重启服务器基本必现,但只要restart一下service就又可以了。有可能是因为network没有启动完全或者什么的原因,但我以为可以利用`login_fail_exit = true`来迫使systemd重启frpc。 所以不知道问题出在什么地方
Author
Owner

@fatedier commented on GitHub (Jan 5, 2020):

原因就是 network没有启动完全,从日志可以看出是 DNS 请求超时,至于如何解决,可以再搜索一下。

<!-- gh-comment-id:570850860 --> @fatedier commented on GitHub (Jan 5, 2020): 原因就是 `network没有启动完全`,从日志可以看出是 DNS 请求超时,至于如何解决,可以再搜索一下。
Author
Owner

@DalekFrog commented on GitHub (Jan 7, 2020):

原因就是 network没有启动完全,从日志可以看出是 DNS 请求超时,至于如何解决,可以再搜索一下。

我能加上sleep 30 来解决这个问题。但是想了解一下,为什么不会自动重试或者退出重启

<!-- gh-comment-id:571553301 --> @DalekFrog commented on GitHub (Jan 7, 2020): > > > 原因就是 `network没有启动完全`,从日志可以看出是 DNS 请求超时,至于如何解决,可以再搜索一下。 我能加上sleep 30 来解决这个问题。但是想了解一下,为什么不会自动重试或者退出重启
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#1232
No description provided.