VaalaCat / frp-panel

a multi node frp webui and for [frp](https://github.com/fatedier/frp) server and client management, which makes this project a Cloudflare Tunnel or Tailscale Funnel open source alternative
GNU General Public License v3.0
441 stars 29 forks source link

服务端异常退出,增加过服务器,服务器启动,增加客户端后异常退出。 #5

Closed oslven closed 5 months ago

oslven commented 5 months ago

[GIN] 2024/02/07 - 23:34:29 | 200 | 55.6105ms | 127.0.0.1 | GET "/api/v1/platform/baseinfo" time="2024-02-07T23:34:29+08:00" level=info msg="finish jwt middleware" func=github.com/VaalaCat/frp-panel/middleware.JWTAuth.func1 file="/home/runner/work/frp-panel/frp-panel/middleware/jwt.go:19" [GIN] 2024/02/07 - 23:34:29 | 200 | 67.856ms | 127.0.0.1 | POST "/api/v1/server/list" time="2024-02-07T23:34:29+08:00" level=info msg="finish jwt middleware" func=github.com/VaalaCat/frp-panel/middleware.JWTAuth.func1 file="/home/runner/work/frp-panel/frp-panel/middleware/jwt.go:19" [GIN] 2024/02/07 - 23:34:29 | 200 | 72.3634ms | 127.0.0.1 | POST "/api/v1/user/get" time="2024-02-07T23:34:30+08:00" level=info msg="start to pull server config, serverID: [default]" func=github.com/VaalaCat/frp-panel/biz/server.PullConfig file="/home/runner/work/frp-panel/frp-panel/biz/server/rpc_pull_config.go:16" time="2024-02-07T23:34:30+08:00" level=info msg="pull server config, req: [base:{server_id:\"default\" server_secret:\"b2acf673-5e0c-4c68-9e5d-59576dab3cdf\"}]" func="github.com/VaalaCat/frp-panel/services/master.(server).PullServerConfig" file="/home/runner/work/frp-panel/frp-panel/services/master/grpc_server.go:51" time="2024-02-07T23:34:30+08:00" level=info msg="server closed" func="github.com/VaalaCat/frp-panel/services/server.(Server).Stop.func1" file="/home/runner/work/frp-panel/frp-panel/services/server/frps_service.go:89" time="2024-02-07T23:34:30+08:00" level=info msg="server closed" func="github.com/VaalaCat/frp-panel/services/server.(Server).Stop.func1" file="/home/runner/work/frp-panel/frp-panel/services/server/frps_service.go:89" time="2024-02-07T23:34:30+08:00" level=info msg="server default config changed, will recreate it" func=github.com/VaalaCat/frp-panel/biz/server.PullConfig file="/home/runner/work/frp-panel/frp-panel/biz/server/rpc_pull_config.go:51" 2024/02/07 23:34:30 [W] [service.go:472] Listener for incoming connections from client closed 2024/02/07 23:34:30 [I] [service.go:181] plugin [multiuser] has been registered time="2024-02-07T23:34:30+08:00" level=panic msg="cannot create server, exit and restart" func=github.com/VaalaCat/frp-panel/services/server.NewServerHandler file="/home/runner/work/frp-panel/frp-panel/services/server/frps_service.go:67" error="create server listener error, listen tcp 0.0.0.0:7000: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted." panic: (logrus.Entry) 0xc0004dbdc0

goroutine 446 [running]: github.com/sirupsen/logrus.(Entry).log(0xc0004dbce0, 0x0, {0xc00003aff0, 0x26}) /home/runner/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/entry.go:260 +0x491 github.com/sirupsen/logrus.(Entry).Log(0xc0004dbce0, 0x0, {0xc007c71328?, 0x1cea100?, 0xc007a812d0?}) /home/runner/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/entry.go:304 +0x48 github.com/sirupsen/logrus.(Entry).Panic(...) /home/runner/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/entry.go:342 github.com/VaalaCat/frp-panel/services/server.NewServerHandler(0xc007a882c0) /home/runner/work/frp-panel/frp-panel/services/server/frps_service.go:67 +0x1b7 github.com/VaalaCat/frp-panel/biz/server.PullConfig({0xc000461797, 0x7}, {0xc00012f350, 0x24}) /home/runner/work/frp-panel/frp-panel/biz/server/rpc_pull_config.go:57 +0x545 reflect.Value.call({0x1cd6060?, 0x20fb340?, 0x22f62c8e258?}, {0x1efbf6a, 0x4}, {0xc006f6ced0, 0x2, 0x0?}) /opt/hostedtoolcache/go/1.21.6/x64/src/reflect/value.go:596 +0xce7 reflect.Value.Call({0x1cd6060?, 0x20fb340?, 0xc0078a1c7a?time="2024-02-07T23:34:30+08:00" level=info msg="cookie auth success" func=github.com/VaalaCat/frp-panel/middleware.JWTAuth file="/home/runner/work/frp-panel/frp-panel/middleware/jwt.go:49" time="2024-02-07T23:34:30+08:00" level=info msg="jwt not going to expire, continue to use old one" func=github.com/VaalaCat/frp-panel/middleware.resignAndPatchCtxJWT file="/home/runner/work/frp-panel/frp-panel/middleware/jwt.go:97" }, {0xc006f6ced0?, 0x2f1d270108?, 0xc0000c6d20?}) /opt/hostedtoolcache/go/1.21.6/x64/src/reflect/value.go:380 +0xb9 github.com/go-co-op/gocron/v2.callJobFuncWithParams({0x1cd6060?, 0x20fb340?}, {0xc00012d300, 0x2, 0xc0078a1c80?}) /home/runner/go/pkg/mod/github.com/go-co-op/gocron/v2@v2.1.2/util.go:29 +0x1ec github.com/go-co-op/gocron/v2.(executor).runJob(_, {{0x22a20c0, 0xc0000e1040}, 0xc0002aa120, {0x51, 0xd, 0x6d, 0x5, 0x5e, 0xb8, ...}, ...}, ...) /home/runner/go/pkg/mod/github.com/go-co-op/gocron/v2@v2.1.2/executor.go:353 +0x34a github.com/go-co-op/gocron/v2.(executor).start.func1.1({{0x22a20c0, 0xc0000e1040}, 0xc0002aa120, {0x51, 0xd, 0x6d, 0x5, 0x5e, 0xb8, 0x4c, ...}, ...}) /home/runner/go/pkg/mod/github.com/go-co-op/gocron/v2@v2.1.2/executor.go:199 +0x5e created by github.com/go-co-op/gocron/v2.(executor).start.func1 in goroutine 445 /home/runner/go/pkg/mod/github.com/go-co-op/gocron/v2@v2.1.2/executor.go:198 +0x5f3

VaalaCat commented 5 months ago

@oslven 现目前修改frps配置需要重启frps,但是frps重载配置端口也会持续占用,因此强制异常退出了,这里符合预期,最好用systemd或者docker管理起来自动恢复

这个问题我会继续研究frp的更新看看能不能解决