[GH-ISSUE #3628] 日志文件显示的时间与linux系统时间不一致 #2894

Closed
opened 2026-05-05 13:52:11 -06:00 by gitea-mirror · 10 comments
Owner

Originally created by @caiwenmin on GitHub (Sep 23, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3628

Bug Description

frpc日志文件输出的时间比系统时间早8小时整,,导致连接不上frps服务端(服务端机器时间与客户端机器时间一致)

frpc Version

0.51.3

frps Version

0.51.3

System Architecture

linux/amd64

Configurations

就正常的配置

Logs

2023/09/23 11:50:06 [W] [service.go:133] login to server failed: EOF

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 @caiwenmin on GitHub (Sep 23, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3628 ### Bug Description frpc日志文件输出的时间比系统时间早8小时整,,导致连接不上frps服务端(服务端机器时间与客户端机器时间一致) ### frpc Version 0.51.3 ### frps Version 0.51.3 ### System Architecture linux/amd64 ### Configurations 就正常的配置 ### Logs 2023/09/23 11:50:06 [W] [service.go:133] login to server failed: EOF ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [X] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
gitea-mirror 2026-05-05 13:52:11 -06:00
Author
Owner

@caiwenmin commented on GitHub (Sep 25, 2023):

查了一下问题,应该是time.Now()获取的默认是UTC时间的时区,代码中未做时区转换,这就导致了时间一直是UTC时区

<!-- gh-comment-id:1732825131 --> @caiwenmin commented on GitHub (Sep 25, 2023): 查了一下问题,应该是time.Now()获取的默认是UTC时间的时区,代码中未做时区转换,这就导致了时间一直是UTC时区
Author
Owner

@superzjg commented on GitHub (Sep 25, 2023):

曾在openwrt上安装zoneinfo-asia解决此问题,实际上就是补全了/usr/share/zoneinfo/Asia/Shanghai文件。但在华硕路由器的官改固件上,因为/zoneinfo/Asia/Shanghai文件不在/usr/share目录下,且无法修改,frpc日志时间就差8小时(但是可以与上述openwrt的frps正常连接使用)。以上都是linux内核系统,供参考。

<!-- gh-comment-id:1732838350 --> @superzjg commented on GitHub (Sep 25, 2023): 曾在openwrt上安装zoneinfo-asia解决此问题,实际上就是补全了/usr/share/zoneinfo/Asia/Shanghai文件。但在华硕路由器的官改固件上,因为/zoneinfo/Asia/Shanghai文件不在/usr/share目录下,且无法修改,frpc日志时间就差8小时(但是可以与上述openwrt的frps正常连接使用)。以上都是linux内核系统,供参考。
Author
Owner

@caiwenmin commented on GitHub (Sep 25, 2023):

frpc按照你的方法可以解决日志时间不对的问题,,frps也存在同样的问题要怎么做呀

<!-- gh-comment-id:1733494396 --> @caiwenmin commented on GitHub (Sep 25, 2023): frpc按照你的方法可以解决日志时间不对的问题,,frps也存在同样的问题要怎么做呀
Author
Owner

@superzjg commented on GitHub (Sep 25, 2023):

frpc按照你的方法可以解决日志时间不对的问题,,frps也存在同样的问题要怎么做呀

方法一样的,重启一下系统。

<!-- gh-comment-id:1733675996 --> @superzjg commented on GitHub (Sep 25, 2023): > frpc按照你的方法可以解决日志时间不对的问题,,frps也存在同样的问题要怎么做呀 方法一样的,重启一下系统。
Author
Owner

@caiwenmin commented on GitHub (Sep 26, 2023):

frps是在debian 11系统上docker启动的,,时区还是和宿主机时区不一致,,设置了TZ也不生效

<!-- gh-comment-id:1734719843 --> @caiwenmin commented on GitHub (Sep 26, 2023): frps是在debian 11系统上docker启动的,,时区还是和宿主机时区不一致,,设置了TZ也不生效
Author
Owner

@superzjg commented on GitHub (Sep 26, 2023):

frps是在debian 11系统上docker启动的,,时区还是和宿主机时区不一致,,设置了TZ也不生效

我刚测试不影响使用:frps 0.47的日志(差8小时),可以接受frpc0.51.3(时间正确)的连接:
2023/09/26 02:18:33 [I] [root.go:206] frps uses config file: /tmp/upload/.frps.ini
2023/09/26 02:18:46 [I] [service.go:200] frps tcp listen on 0.0.0.0:7000
2023/09/26 02:18:46 [I] [service.go:226] frps quic listen on quic 0.0.0.0:7000
2023/09/26 02:18:46 [I] [root.go:215] frps started successfully
2023/09/26 02:20:06 [I] [service.go:500] [5023f2c901278dbd] client login info: ip [[240e:xxx:xxx:xxxx::1]:57962] version [0.51.3] hostname [] os [linux] arch [arm64]
2023/09/26 02:20:06 [I] [tcp.go:66] [5023f2c901278dbd] [smb] tcp proxy listen port [12345]
2023/09/26 02:20:06 [I] [control.go:464] [5023f2c901278dbd] new proxy [smb] type [tcp] success

<!-- gh-comment-id:1734728791 --> @superzjg commented on GitHub (Sep 26, 2023): > frps是在debian 11系统上docker启动的,,时区还是和宿主机时区不一致,,设置了TZ也不生效 我刚测试不影响使用:frps 0.47的日志(差8小时),可以接受frpc0.51.3(时间正确)的连接: 2023/09/26 02:18:33 [I] [root.go:206] frps uses config file: /tmp/upload/.frps.ini 2023/09/26 02:18:46 [I] [service.go:200] frps tcp listen on 0.0.0.0:7000 2023/09/26 02:18:46 [I] [service.go:226] frps quic listen on quic 0.0.0.0:7000 2023/09/26 02:18:46 [I] [root.go:215] frps started successfully 2023/09/26 02:20:06 [I] [service.go:500] [5023f2c901278dbd] client login info: ip [[240e:xxx:xxx:xxxx::1]:57962] version [0.51.3] hostname [] os [linux] arch [arm64] 2023/09/26 02:20:06 [I] [tcp.go:66] [5023f2c901278dbd] [smb] tcp proxy listen port [12345] 2023/09/26 02:20:06 [I] [control.go:464] [5023f2c901278dbd] new proxy [smb] type [tcp] success
Author
Owner

@caiwenmin commented on GitHub (Sep 26, 2023):

我frps 0.51.3(日志差8小时),frpc0.51.3(时间正确)
但是服务端接收不到客户端的连接

客户端日志
2023/09/26 19:03:01 [I] [root.go:220] start frpc service for config file [/var/etc/frp/frpc.conf]

服务端无任何日志

<!-- gh-comment-id:1735316323 --> @caiwenmin commented on GitHub (Sep 26, 2023): 我frps 0.51.3(日志差8小时),frpc0.51.3(时间正确) 但是服务端接收不到客户端的连接 客户端日志 2023/09/26 19:03:01 [I] [root.go:220] start frpc service for config file [/var/etc/frp/frpc.conf] 服务端无任何日志
Author
Owner

@superzjg commented on GitHub (Sep 26, 2023):

我frps 0.51.3(日志差8小时),frpc0.51.3(时间正确) 但是服务端接收不到客户端的连接

客户端日志 2023/09/26 19:03:01 [I] [root.go:220] start frpc service for config file [/var/etc/frp/frpc.conf]

服务端无任何日志

那就是配置文件问题,或者防火墙没打通,仔细检查,应该跟时间没关系

<!-- gh-comment-id:1735424741 --> @superzjg commented on GitHub (Sep 26, 2023): > 我frps 0.51.3(日志差8小时),frpc0.51.3(时间正确) 但是服务端接收不到客户端的连接 > > 客户端日志 2023/09/26 19:03:01 [I] [root.go:220] start frpc service for config file [/var/etc/frp/frpc.conf] > > 服务端无任何日志 那就是配置文件问题,或者防火墙没打通,仔细检查,应该跟时间没关系
Author
Owner

@caiwenmin commented on GitHub (Sep 26, 2023):

宝塔对应的端口都放开了呀,,唉,折腾好几天了

<!-- gh-comment-id:1735434342 --> @caiwenmin commented on GitHub (Sep 26, 2023): 宝塔对应的端口都放开了呀,,唉,折腾好几天了
Author
Owner

@github-actions[bot] commented on GitHub (Oct 27, 2023):

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

<!-- gh-comment-id:1782116666 --> @github-actions[bot] commented on GitHub (Oct 27, 2023): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
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#2894
No description provided.