fatedier / frp

A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
Apache License 2.0
86.97k stars 13.41k forks source link

frpc will crash about every 3 days #4516

Closed Hanmo123 closed 8 hours ago

Hanmo123 commented 1 month ago

Bug Description

I have an frpc instance that proxies about 100 ports and another instance that proxies only `22, the latter is stable but the former has crashed for serveral times

frpc Version

0.60.0

frps Version

0.60.0

System Architecture

linux/amd64

Configurations

serverAddr = ""
serverPort = 7000

[auth]
method = "token"
token = ""

[[proxies]]
name = "ikuai"
type = "tcp"
localIP = "172.16.0.2"
localPort = 80
remotePort = 8067

{{- range $_, $v := parseNumberRangePair "10000-10099" "10000-10099" }}
[[proxies]]
name = "ikuai-{{ $v.First }}"
type = "tcp"
localIP = "172.16.0.2"
localPort = {{ $v.First }}
remotePort = {{ $v.Second }}
{{- end }}

Logs

fatal error: all goroutines are asleep - deadlock!                                                               

goroutine 1 [chan receive, 693 minutes]:                                                                         
github.com/fatedier/frp/client.(*Service).Run(0xc0003187e0, {0xd5b980?, 0x12336c0?})                             
        github.com/fatedier/frp/client/service.go:191 +0x1bf                                                     
github.com/fatedier/frp/cmd/frpc/sub.startService(0xc00030b8c8, {0xc00019d608, 0x65, 0x8f}, {0x12336c0, 0x0, 0x0}
, {0x7ffc3ec09e0d, 0xe})                                                                                         
        github.com/fatedier/frp/cmd/frpc/sub/root.go:160 +0x357                                                  
github.com/fatedier/frp/cmd/frpc/sub.runClient({0x7ffc3ec09e0d, 0xe})                                            
        github.com/fatedier/frp/cmd/frpc/sub/root.go:130 +0x185                                                  
github.com/fatedier/frp/cmd/frpc/sub.init.func2(0xc0001dda00?, {0xba70b6?, 0x4?, 0xba70ba?})                     
        github.com/fatedier/frp/cmd/frpc/sub/root.go:69 +0x3e                                                    
github.com/spf13/cobra.(*Command).execute(0x11c78e0, {0xc000034130, 0x2, 0x2})                                   
        github.com/spf13/cobra@v1.8.0/command.go:983 +0xaca                                                      
github.com/spf13/cobra.(*Command).ExecuteC(0x11c78e0)                                                            
        github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff                                                     
github.com/spf13/cobra.(*Command).Execute(...)                                                                   
        github.com/spf13/cobra@v1.8.0/command.go:1039                                                            
github.com/fatedier/frp/cmd/frpc/sub.Execute()                                                                   
        github.com/fatedier/frp/cmd/frpc/sub/root.go:101 +0x31                                                   
main.main()                                                                                                      
        github.com/fatedier/frp/cmd/frpc/main.go:25 +0xf                                                         

goroutine 6 [select, 693 minutes]:                                                                               
github.com/xtaci/kcp-go/v5.(*TimedSched).sched(0xc0000ee5a0)                                                     
        github.com/xtaci/kcp-go/v5@v5.6.13/timedsched.go:90 +0x109                                               
created by github.com/xtaci/kcp-go/v5.NewTimedSched in goroutine 1                                               
        github.com/xtaci/kcp-go/v5@v5.6.13/timedsched.go:78 +0xeb                                                

...

goroutine 56 [chan send]:                                                                                        
github.com/fatedier/frp/pkg/transport.(*transporterImpl).Send.func1()                          
        github.com/fatedier/frp/pkg/transport/message.go:57 +0x1e
github.com/fatedier/golib/errors.PanicToError(0x410130?)                                      
        github.com/fatedier/golib@v0.5.0/errors/errors.go:28 +0x57     
github.com/fatedier/frp/pkg/transport.(*transporterImpl).Send(0x0?, {0xa9b800?, 0xc0004166a0?})
        github.com/fatedier/frp/pkg/transport/message.go:56 +0x49
github.com/fatedier/frp/client/proxy.(*Manager).HandleEvent(0x10?, {0xaa05c0?, 0xc000486330?})
        github.com/fatedier/frp/client/proxy/proxy_manager.go:110 +0x7a 
github.com/fatedier/frp/client/proxy.(*Wrapper).close(...)         
        github.com/fatedier/frp/client/proxy/proxy_wrapper.go:177     
github.com/fatedier/frp/client/proxy.(*Wrapper).Stop(0xc000552ea0)
        github.com/fatedier/frp/client/proxy/proxy_wrapper.go:173 +0x151
github.com/fatedier/frp/client/proxy.(*Manager).Close(0xc00046f440)    
        github.com/fatedier/frp/client/proxy/proxy_manager.go:83 +0xbf
github.com/fatedier/frp/client.(*Control).worker(0xc00046f200)
        github.com/fatedier/frp/client/control.go:281 +0xd3
created by github.com/fatedier/frp/client.(*Control).Run in goroutine 1      
        github.com/fatedier/frp/client/control.go:108 +0x76

goroutine 190 [chan receive, 693 minutes]:                                                                       
github.com/fatedier/frp/client.(*Service).keepControllerWorking(0xc0003187e0)
        github.com/fatedier/frp/client/service.go:197 +0x34
created by github.com/fatedier/frp/client.(*Service).Run in goroutine 1
        github.com/fatedier/frp/client/service.go:189 +0x19f

Steps to reproduce

I am not sure. In my server, i need just wait...

Affected area

fatedier commented 1 month ago

Can you test it without KCP enabled?

Hanmo123 commented 1 month ago

I did not enable KCP manually in my server(and i dont know how to disable it, i tried the method below but it does not work), the OS is ProxmoxVE-8.0.3(based on debian 11).

image

fatedier commented 1 month ago

Search in your frp configuration file?

fatedier commented 1 month ago

Maybe it's not relevant, just ignore it for now.

fatedier commented 1 month ago

Is there a log before the fatal error? Were there any changes to the system, network, etc. before the crash?

Hanmo123 commented 1 month ago

It's my first time I've used frp in this server. But as i mentioned in the issue body, i started another frpc instance, which is stable:

serverAddr = ""
serverPort = 7000

[auth]
method = "token"
token = ""

[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 2222

[[proxies]]
name = "pve"
type = "tcp"
localIP = "127.0.0.1"
localPort = 8006
remotePort = 8066

(both instances use the same frps)

github-actions[bot] commented 1 week ago

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