gravitl / netmaker

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

[Bug]: Can't connect using docker on 0.14.0 #1109

Closed whites11 closed 2 years ago

whites11 commented 2 years ago

Contact Details

No response

What happened?

I upgraded my netmaker installation (docker-compose) to 0.14.0. I tried connecting using the docker method. I get this error:

[netclient] 2022-05-21 15:29:23 unable to authenticate: failed to authenticate 400 Bad Request {"Code":400,"Message":"W1R3: MacAddress can't be empty"} 

on the server side:

netmaker       | [netmaker] 2022-05-21 15:29:23 processed request error: Key: 'Node.MacAddress' Error:Field validation for 'MacAddress' failed on the 'macaddress_unique' tag 
netmaker       | [netmaker] 2022-05-21 15:29:23 processed request error: W1R3: MacAddress can't be empty 

It was working with 0.13.1

Version

v0.14.0

What OS are you using?

Linux

Relevant log output

$ docker run -d --network host  --privileged -e TOKEN=REDACTED -v /etc/netclient:/etc/netclient --name netclient gravitl/netclient:v0.14.0
Unable to find image 'gravitl/netclient:v0.14.0' locally
v0.14.0: Pulling from gravitl/netclient
3aa4d0bbde19: Already exists 
4f4fb700ef54: Pull complete 
1765760c4b17: Pull complete 
938d1a33c9ef: Pull complete 
8b0bf801e330: Pull complete 
Digest: sha256:68e36e81922d640299d9b09f50c280435cd90fa9208341717f7890ca814b9b26
Status: Downloaded newer image for gravitl/netclient:v0.14.0
62888c6ce133c781757a61d73009a844dbe18de888e131c5d8992583a686716f

$ docker logs -f netclient
[netclient] joining network
[netclient] 2022-05-21 15:29:23 joining REDACTED at REDACTED:443 
[netclient] 2022-05-21 15:29:23 unable to authenticate: failed to authenticate 400 Bad Request {"Code":400,"Message":"W1R3: MacAddress can't be empty"} 
[netclient] Starting netclient daemon
2022/05/21 15:29:24 no networks
[netclient] exiting

Contributing guidelines

afeiszli commented 2 years ago

Check if the client already exists in the UI. If so, delete it, then install again.

whites11 commented 2 years ago

Check if the client already exists in the UI. If so, delete it, then install again.

The client definitely existed before I upgraded. This is a test installation and it's ok, but if it was production it would have been a disaster!

afeiszli commented 2 years ago

I want to confirm the issue recreation for docker. I am guessing this is a general issue for restarting the current docker client. Other users have reported this when they restart their machine and during upgrades. I think it is simply because it attempts to rejoin on every restart. Can you confirm?

If so, we will make a modification to the script on docker netclient that should solve this.

whites11 commented 2 years ago

I want to confirm the issue recreation for docker. I am guessing this is a general issue for restarting the current docker client. Other users have reported this when they restart their machine and during upgrades. I think it is simply because it attempts to rejoin on every restart. Can you confirm?

If so, we will make a modification to the script on docker netclient that should solve this.

In my specific example, the clients were disconnected (container stopped, /etc/netclient deleted) and, after netmaker upgrade, reconnected using the same token.

Happened twice with two clients

afeiszli commented 2 years ago

This was working previously but we removed the MacAddress as one of the input fields which I think is causing this problem. We'll fix this for the next release.

afeiszli commented 2 years ago

fixed in 0.14.1, removed MacAddress limitation on join and authorization

whites11 commented 2 years ago

thx

whites11 commented 2 years ago

fixed in 0.14.1, removed MacAddress limitation on join and authorization

confirmed works now :+1: