netbirdio / netbird

Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
11.3k stars 518 forks source link

`address already in use` for no apparent reason #566

Closed nazarewk closed 2 years ago

nazarewk commented 2 years ago

I am trying to set up Netbird on NixOS, but i'm getting following errors:

Nov 16 11:26:46 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:46+01:00" level=debug msg="conecting to the Management service api.wiretrustee.com:443" file="connect.go:82"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=debug msg="connected to the Management service api.wiretrustee.com:443" file="connect.go:87"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=debug msg="connected to Signal Service: signal2.wiretrustee.com:443" file="grpc.go:78"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=info msg="using kernel WireGuard" file="iface_linux.go:21"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=debug msg="adding device: wt0" file="iface_linux.go:57"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=debug msg="adding address 100.79.239.233/16 to interface: wt0" file="iface_linux.go:108"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=debug msg="setting MTU: 1280 interface: wt0" file="iface_linux.go:73"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=debug msg="bringing up interface: wt0" file="iface_linux.go:80"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=debug msg="configuring Wireguard interface wt0" file="configuration.go:46"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=debug msg="adding Wireguard private key" file="configuration.go:48"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=debug msg="got Wireguard device wt0" file="configuration.go:35"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=error msg="failed configuring Wireguard interface [wt0]: received error \"address already in use\" while configuring interface wt0 with port 51820" file="engine.go:239"
Nov 16 11:26:47 nazarewk-krul netbird[2744208]: time="2022-11-16T11:26:47+01:00" level=error msg="error while starting Netbird Connection Engine: received error \"address already in use\" while configuring interface wt0 with port 51820" file="connect.go:149"
mlsmaycon commented 2 years ago

Hello @nazarewk can you check if there is any other application running that is using port 51280, you can do that with:

sudo ss -lnup
# or
sudo netstat -lnup

If that is the case and you can not stop the other process, you can use a custom port by updating the /etc/netbird/config.json and changing the WgPort value.

nazarewk commented 2 years ago

I don't have anything listening on 51280

typo on the port

# ss -lnup | grep 51820
UNCONN 0      0             0.0.0.0:51820      0.0.0.0:*                                               
UNCONN 0      0                [::]:51820         [::]:* 
nazarewk commented 2 years ago

closing this, it's caused by #546 , editing port in config.json helped

mlsmaycon commented 2 years ago

Thanks, @nazarewk, sorry for the typo. I'm working with it every day, and still not doing this 😄