Open dharapvj opened 3 weeks ago
2024-04-25 00:11:03.177 [W] [client/control.go:168] [3dede59ef6706e74] [web] start error: port unavailable
You are not using the same configuration?
You need to check the error messages in the frps log.
I think it was late in night and I pasted wrong logs.. I recreated the scenario again. I also removed ssh proxy so that logs can be simple to look at.
Here is config: ipv4 server
[common]
bind_port = 2333
ipv6 server
bindAddr = "::"
bindPort = 2333
log.level = "debug"
local client config
serverAddr = "<IPv6_address>"
# serverAddr = "<IPv4_Address>"
serverPort = 2333
log.level = "trace"
[[proxies]]
name = "web"
type = "tcp"
localIp = "127.0.0.1"
localPort = 80
remotePort = 80
Here are logs: Connecting to ipv4 machine:
❯ frpc -c /etc/frp/frpc.toml
2024-04-25 22:37:43.498 [I] [sub/root.go:142] start frpc service for config file [/etc/frp/frpc.toml]
2024-04-25 22:37:43.498 [I] [client/service.go:294] try to connect to server...
2024-04-25 22:37:43.521 [I] [client/service.go:286] [a280a2e63b59f284] login to server success, get run id [a280a2e63b59f284]
2024-04-25 22:37:43.521 [I] [proxy/proxy_manager.go:173] [a280a2e63b59f284] proxy added: [web]
2024-04-25 22:37:43.521 [T] [proxy/proxy_wrapper.go:200] [a280a2e63b59f284] [web] change status from [new] to [wait start]
2024-04-25 22:37:43.521 [D] [client/control.go:244] [a280a2e63b59f284] send heartbeat to server
2024-04-25 22:37:43.527 [I] [client/control.go:170] [a280a2e63b59f284] [web] start proxy success
2024-04-25 22:37:43.527 [D] [client/control.go:195] [a280a2e63b59f284] receive heartbeat from server
^C
Connecting to ipv6 machine
❯ frpc -c /etc/frp/frpc.toml
2024-04-25 23:00:17.651 [I] [sub/root.go:142] start frpc service for config file [/etc/frp/frpc.toml]
2024-04-25 23:00:17.651 [I] [client/service.go:294] try to connect to server...
2024-04-25 23:00:17.684 [I] [client/service.go:286] [791c87b2fe506ae9] login to server success, get run id [791c87b2fe506ae9]
2024-04-25 23:00:17.684 [I] [proxy/proxy_manager.go:173] [791c87b2fe506ae9] proxy added: [web]
2024-04-25 23:00:17.684 [T] [proxy/proxy_wrapper.go:200] [791c87b2fe506ae9] [web] change status from [new] to [wait start]
2024-04-25 23:00:17.685 [D] [client/control.go:244] [791c87b2fe506ae9] send heartbeat to server
2024-04-25 23:00:17.690 [W] [client/control.go:168] [791c87b2fe506ae9] [web] start error: port unavailable
2024-04-25 23:00:17.690 [D] [client/control.go:195] [791c87b2fe506ae9] receive heartbeat from server
^C
Corresponding ipv6 server logs:
2024-04-25 17:30:13.847 [I] [frps/root.go:105] frps uses config file: frps.toml
2024-04-25 17:30:14.872 [I] [server/service.go:237] frps tcp listen on [::]:2333
2024-04-25 17:30:14.872 [I] [frps/root.go:114] frps started successfully
2024-04-25 17:30:17.680 [I] [server/service.go:575] [791c87b2fe506ae9] client login info: ip [[2402:b00:e:f009:1059:f37a:5f71:155f]:60050] version [0.57.0] hostname [] os [linux] arch [amd64]
2024-04-25 17:30:17.686 [W] [server/control.go:396] [791c87b2fe506ae9] new proxy [web] type [tcp] error: port unavailable
2024-04-25 17:30:17.687 [D] [server/control.go:432] [791c87b2fe506ae9] receive heartbeat
2024-04-25 17:30:17.687 [D] [server/control.go:243] [791c87b2fe506ae9] new work connection registered
2024-04-25 17:30:21.480 [D] [server/service.go:524] Accept new mux stream error: EOF
2024-04-25 17:30:21.480 [I] [server/control.go:359] [791c87b2fe506ae9] client exit success
The service is available locally
❯ curl -I 127.0.0.1
HTTP/1.1 200 OK
Server: openresty
Date: Thu, 25 Apr 2024 17:10:36 GMT
Content-Type: text/html
Content-Length: 1033
Last-Modified: Wed, 28 Feb 2024 22:25:56 GMT
Connection: keep-alive
ETag: "65dfb2f4-409"
Accept-Ranges: bytes
看起来 frps 所在的服务器,80 端口被其他进程占用
使用 ss -tlnp sport 80
找到占用 80 端口的进程
另外
bindAddr = "::"
不是必须的
@dharapvj You can refer to the comments above to confirm if port 80 has been occupied and try removing bindAddr.
I just request you to try out such a scenario once. I have given detailed information and logs so that it could be easier for you to try and reproduce. Can you please try reproducing the issue once?
You cannot expect everyone to have the same environment as you do, there are tests related to IPv6 in end-to-end testing, and obvious errors will be directly detected.
If possible, please conduct more tests, try more ports or other configuration adjustments. Otherwise, I won't be able to provide much help.
Bug Description
If frpc connects to frps server via IPv6 - I cannot connect to local services exposed via container e.g. nginx docker container. But same frpc connects to frps via IPv4, same local service can get connected.
More details can be found in the reproduction steps.
frpc Version
0.57.0
frps Version
0.57.0
System Architecture
linux/amd (client) linux/arm64 (server)
Configurations
Logs
Logs:
Logs when connected to IPv4 Server:
Steps to reproduce
podman run -p 9000:9000 -p 9001:9001 quay.io/minio/minio server /data --console-address ":9001"
But anything else like nginx will also do. I can access service viacurl -v localhost:9000
on the local machine host.Affected area