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]: I can't make a Windows Server join a network #1456

Closed rjusher closed 2 years ago

rjusher commented 2 years ago

What happened?

I am trying to join a Windows Database Server on AWS but I constantly get the following error:

C:\Program Files (x86)\Netclient>"C:\Program Files (x86)\Netclient\netclient.exe" join -t <token>
[netclient.exe] 2022-08-09 16:22:05 netclient.exe is in proper location, C:\Program Files (x86)\Netclient\netclient.exe
2022/08/09 16:22:05 Gravitl Netclient on Windows started
[netclient.exe] 2022-08-09 16:22:05 joining <network> at api.netmaker.mynetmaker.com:443
[netclient.exe] 2022-08-09 16:22:35 error installing:  error creating node Post "https://api.netmaker.mynetmaker.com:443/api/nodes/clientdeploy": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Extra information:

I already joined several other similar servers (Windows Server 2019) and they are working great, but this one doesn't want to join.

I already tried to increase the verbosity level of running the join command but I don't get more information.

I already turned off the firewall

I already opened the relevant ports on AWS Security Group

Version

Windows Server 2016 v0.14.5

What OS are you using?

Windows

Relevant log output

C:\Program Files (x86)\Netclient>"C:\Program Files (x86)\Netclient\netclient.exe" join -t <token>
[netclient.exe] 2022-08-09 16:22:05 netclient.exe is in proper location, C:\Program Files (x86)\Netclient\netclient.exe
2022/08/09 16:22:05 Gravitl Netclient on Windows started
[netclient.exe] 2022-08-09 16:22:05 joining <network> at api.netmaker.mynetmaker.com:443
[netclient.exe] 2022-08-09 16:22:35 error installing:  error creating node Post "https://api.netmaker.mynetmaker.com:443/api/nodes/clientdeploy": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Contributing guidelines

mattkasun commented 2 years ago

to verify that the api is reachable from the windows client machine run the windows equivalent of the following curl command:

curl https://api.netmaker.mynetmaker.com/api/users/adm/hasadmin

A response of true or false indicates success while a failure to connect or timeout indicates either a misconfigured server or a network/firewall issue.

rjusher commented 2 years ago

Did as you said

Invoke-WebRequest -URI https://api.netmaker.mynetmaker.com/api/users/adm/hasadmin

Got the following result:

StatusCode        : 200
StatusDescription : OK
Content           : true

RawContent        : HTTP/1.1 200 OK
                    Content-Length: 5
                    Content-Type: application/json
                    Date: Wed, 10 Aug 2022 15:42:01 GMT

                    true

Forms             : {}
Headers           : {[Content-Length, 5], [Content-Type, application/json], [Date, Wed, 10 Aug 2022 15:42:01 GMT]}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : System.__ComObject
RawContentLength  : 5

As I understood your comment the response of true indicates success, so the my problem lies somewhere else.

rjusher commented 2 years ago

I am not really sure what happened, but out of a sudden I was able to join the network.

My current theory is that I was trying to join the network when the server was under heavy load, making the request fail due to the timeout.

I would be a nice addition to be able to set a longer timeout as a flag in the cli.