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

Netclient node traffic key is nil #835

Closed kylechase closed 2 years ago

kylechase commented 2 years ago

When installing netclient on a vyos router, I am getting the following error

2022/02/23 19:19:51 [netclient] error installing: rpc error: code = Unknown desc = error: node traffic key is nil
2022/02/23 19:19:51 Failed to authenticate: rpc error: code = Unauthenticated desc = Something went wrong with Auto Login: rpc error: code = Unknown desc = no result found
2022/02/23 19:19:51 [netclient] removed thundernet network locally
2022/02/23 19:19:51 [netclient] removed systemd remnants if any existed
2022/02/23 19:19:51 [netclient] removed systemd remnants if any existed

What does "node traffic key is nil" mean? How can I fix this?

0xdcarns commented 2 years ago

It generates a key for encoding/decoding messages for each network you're on during a join to achieve consensus with the network. I would try a ./netclient uninstall and rejoin and see if it persists. Could be an issue with the OS/file location. Which version are you running and were you attempting an upgrade?

kylechase commented 2 years ago

I compiled a new iso for vyos to include the latest version of netclient (0.9.4). I placed the binary in /usr/sbin/netclient, and assigned "700" for permissions to the /etc/netclient and /etc/netclient/config folders.

To follow up on your suggestion, I ran netclient uninstall and then tried to join a network with

netclient join -t mytoken

and got the following response

2022/02/24 23:07:57 [netclient] joining thundernet at grpc.netmaker.mydomain.com:443
2022/02/24 23:07:57 [netclient] error installing: rpc error: code = Unknown desc = error: node traffic key is nil
2022/02/24 23:07:58 Failed to authenticate: rpc error: code = Unauthenticated desc = Something went wrong with Auto Login: rpc error: code = Unknown desc = no result found
2022/02/24 23:07:58 [netclient] removed thundernet network locally
2022/02/24 23:07:58 [netclient] removed systemd remnants if any existed
2022/02/24 23:07:58 [netclient] removed systemd remnants if any existed
0xdcarns commented 2 years ago

Ah okay this makes more sense. 0.9.4 does not use traffic keys though, so what is the version of netclient and netmaker (server) you are using? If you upgraded to 0.10.0 or 0.11.0 (I recommend that one) you will need the same version clients for it to operate properly. You should remove any netclients that aren't the same under sbin, etc or usr or ensure you are using the 0.9.4 server and the 0.9.4 client. If the 0.9.4 client is asking for traffic keys then our release must have the incorrect binaries currently.

kylechase commented 2 years ago

Yep, that was it! Thanks. I didn't even realize the version difference.