gravitl / netmaker

Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.
https://netmaker.io
Other
9.4k stars 547 forks source link

[Bug]: Required key not available error #2390

Closed Tivin-i closed 1 year ago

Tivin-i commented 1 year ago

Contact Details

ilia@lockedjar.com

What happened?

Expected: Able to ping hosts. What happened: From 10.121.11.1 icmp_seq=1 Destination Host Unreachable ping: sendmsg: Required key not available

Network Interfaces tab is empty; netconfiguration is with netplan.

Added a third host to try with that, PrivateKey is empty, tried refresh keys and no change.

Reinstalled client, tried pull, remove network and hosts then re-add, no change.

OS: Ubuntu 22.04, public IP, ufw disabled.

Version

v0.20.1

What OS are you using?

Linux

Relevant log output

Ping:

PING 10.121.11.2 (10.121.11.2) 56(84) bytes of data.
From 10.121.11.1 icmp_seq=1 Destination Host Unreachable
ping: sendmsg: Required key not available
From 10.121.11.1 icmp_seq=2 Destination Host Unreachable
ping: sendmsg: Required key not available
From 10.121.11.1 icmp_seq=3 Destination Host Unreachable
ping: sendmsg: Required key not available

Netmaker:

 __   __     ______     ______   __    __     ______     __  __     ______     ______    
/\ "-.\ \   /\  ___\   /\__  _\ /\ "-./  \   /\  __ \   /\ \/ /    /\  ___\   /\  == \   
\ \ \-.  \  \ \  __\   \/_/\ \/ \ \ \-./\ \  \ \  __ \  \ \  _"-.  \ \  __\   \ \  __<   
 \ \_\\"\_\  \ \_____\    \ \_\  \ \_\ \ \_\  \ \_\ \_\  \ \_\ \_\  \ \_____\  \ \_\ \_\ 
  \/_/ \/_/   \/_____/     \/_/   \/_/  \/_/   \/_/\/_/   \/_/\/_/   \/_____/   \/_/ /_/ 

[netmaker] 2023-06-11 05:48:47 connecting to postgres 
[netmaker] 2023-06-11 05:48:47 database successfully connected 
[netmaker] 2023-06-11 05:48:47 no OAuth provider found or not configured, continuing without OAuth 
[netmaker] 2023-06-11 05:48:47 could not update user XXXX 
[netmaker] 2023-06-11 05:48:47 netmaker-stun listening on 0.0.0.0:3478 via udp 
[netmaker] 2023-06-11 05:48:47 REST Server successfully started on port  8081  (REST) 
[netmaker] 2023-06-11 05:48:48 connecting to mq broker at ws://mq:1883 
[netmaker] 2023-06-11 05:48:48 connected to MQ Broker 
[netmaker] 2023-06-11 05:49:53 received registration attempt with token XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
2023/06/11 05:49:54 checking default proxy {true false}
2023/06/11 05:49:55 set proxy enabled to  false
[netmaker] 2023-06-11 05:49:55 SG-XXX de1ae35c-36b3-4463-840e-95d4c4bdb010 registered with Netmaker 
[netmaker] 2023-06-11 05:49:55 peer update for host de1ae35c-36b3-4463-840e-95d4c4bdb010 
[netmaker] 2023-06-11 05:50:00 received registration attempt with token XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
2023/06/11 05:50:00 checking default proxy {true false}
2023/06/11 05:50:01 set proxy enabled to  false
[netmaker] 2023-06-11 05:50:02 SG-XXX-1 465c5dfc-5711-4644-9686-61beacc20ed4 registered with Netmaker 
[netmaker] 2023-06-11 05:50:02 peer update for host 465c5dfc-5711-4644-9686-61beacc20ed4 
[netmaker] 2023-06-11 05:50:02 peer update for host de1ae35c-36b3-4463-840e-95d4c4bdb010 
[netmaker] 2023-06-11 05:50:18 peer update for host de1ae35c-36b3-4463-840e-95d4c4bdb010 
[netmaker] 2023-06-11 05:50:18 peer update for host 465c5dfc-5711-4644-9686-61beacc20ed4 
[netmaker] 2023-06-11 05:50:25 peer update for host 465c5dfc-5711-4644-9686-61beacc20ed4 
[netmaker] 2023-06-11 05:50:25 peer update for host de1ae35c-36b3-4463-840e-95d4c4bdb010 
[netmaker] 2023-06-11 05:51:36 XXXX created network quick 
[netmaker] 2023-06-11 05:51:44 added new node e7f60b33-dbfc-4fcf-95b6-aef4945b0a81 to host SG-XXX-1 
[netmaker] 2023-06-11 05:51:44 peer update for host 465c5dfc-5711-4644-9686-61beacc20ed4 
[netmaker] 2023-06-11 05:51:44 error retrieving extclients could not find any records 
[netmaker] 2023-06-11 05:51:44 error retrieving custom dns entries could not find any records 
[netmaker] 2023-06-11 05:51:47 added new node 45f39c07-9b85-407b-a549-0e14d6ef19e0 to host SG-XXX 
[netmaker] 2023-06-11 05:51:47 peer update for host de1ae35c-36b3-4463-840e-95d4c4bdb010 
[netmaker] 2023-06-11 05:51:47 error retrieving extclients could not find any records 
[netmaker] 2023-06-11 05:51:47 error retrieving custom dns entries could not find any records 
[netmaker] 2023-06-11 05:52:29 peer update for host 465c5dfc-5711-4644-9686-61beacc20ed4 
[netmaker] 2023-06-11 05:52:29 peer update for host de1ae35c-36b3-4463-840e-95d4c4bdb010 
[netmaker] 2023-06-11 05:53:48 peer update for host 465c5dfc-5711-4644-9686-61beacc20ed4 
[netmaker] 2023-06-11 05:53:48 peer update for host de1ae35c-36b3-4463-840e-95d4c4bdb010 

ip a output SG-XXX-1:

31: netmaker: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none 
    inet 10.121.11.1/24 brd 10.121.11.255 scope global netmaker
       valid_lft forever preferred_lft forever

wireguard showconf netmaker SG-XXX-1:
root@SG-XXX-1:~# wg showconf netmaker
[Interface]
ListenPort = 51822
PrivateKey = XXXXXXXXXXXXXXXXXXXXXXXXHU4=

ip a output SG-XXX:
27: netmaker: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none 
    inet 10.121.11.2/24 brd 10.121.11.255 scope global netmaker
       valid_lft forever preferred_lft forever

root@SG-XXX:~# wg showconf netmaker
[Interface]
ListenPort = 51821
PrivateKey = XXXXXXXXXXXXXXXXXXXXXXXX22ng=

Contributing guidelines

remcolouter commented 1 year ago

Same here

Tivin-i commented 1 year ago

As mentioned earlier to @mattkasun , I am unable to reproduce this on the same hosts anymore.

remcolouter commented 1 year ago

Since I had upgraded everything from v0.20.1 to v0.20.2, this issue was gone. Finally was able to ping every node again.

Tivin-i commented 1 year ago

I think I may have managed to get this one replicated. This happens when a new network created and the hosts are added through "add existing host". I have tried to create a network with a key that is attached to two networks.

Once I remove the machines, and add them again to the same network - this is where the "Required key not available" shows up - BUT, in this version it seems to push the key and it fixes it after a few seconds.

I do not have this issue any longer in version 0.20.3

jasondalycanpk commented 8 months ago

I'm having this issue with removed and re-added hosts in v0.22.0