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.32k stars 519 forks source link

Connection Issues when attempting to netbird up using a fresh install via the convenience install script #1217

Closed Vaneixus closed 1 year ago

Vaneixus commented 1 year ago

Describe the problem Fresh install of netbird on a public VPS. Web Interface is accessible via the client. Able to connect to the SaaS Netbird but not the selfhosted option. I have tested this on two different clients. none of them can connect to the self-hosted instance.

To Reproduce Steps to reproduce the behavior: On VPS:

  1. Run 'export NETBIRD_DOMAIN=netbird.example.com; curl -fsSL https://github.com/netbirdio/netbird/releases/latest/download/getting-started-with-zitadel.sh | bash' with the appropriate A record address. On Client:
  2. Run 'curl -fsSL https://pkgs.netbird.io/install.sh | sh'
  3. Then run 'netbird up --management-url https://netbird.example.com:443' with the appropriate address.
  4. get Error: unable to get daemon status: rpc error: code = FailedPrecondition desc = failed while getting Management Service public key: rpc error: code = PermissionDenied desc = unexpected HTTP status code received from server: 403 (Forbidden); malformed header: missing HTTP content-type

Expected behavior A client able to connect to connect

NetBird status -d output: Error: status failed: failed while getting Management Service public key: rpc error: code = PermissionDenied desc = unexpected HTTP status code received from server: 403 (Forbidden); malformed header: missing HTTP content-type

Additional context I have attempted apt remove, removing the conf file in /etc then reinstalling the packages, I have attempted to revert versions to v0.23.0, I have also attempted to restart the service, uninstall and reinstall it, etc.

mlsmaycon commented 1 year ago

Hello @Vaneixus , can you share the logs from all docker containers in the VPS?

docker compose logs > /tmp/netbird.logs 2>&1 should be enough to generate it.

Vaneixus commented 1 year ago

netbird.log Hello @mlsmaycon, I couldn't get the logs from the start due to it being erased by Docker's log management. so I had shutdown everything, restarted then attempted to netbird up one of the clients I have. All of that should hopefully be recorded in the logs file.

Vaneixus commented 1 year ago

I have attempted to use the android client to connect to the server, but I am getting an invalid server address: netbird.example.com:443

I have also tried to change the server distro from Ubuntu Server 22.04 to Debian 12, no change.

braginini commented 1 year ago

I have attempted to use the android client to connect to the server, but I am getting an invalid server address: netbird.example.com:443

I have also tried to change the server distro from Ubuntu Server 22.04 to Debian 12, no change.

What VPS provider are you using? Would still be great to see the container logs that @mlsmaycon asked about.

Vaneixus commented 1 year ago

I have attempted to use the android client to connect to the server, but I am getting an invalid server address: netbird.example.com:443 I have also tried to change the server distro from Ubuntu Server 22.04 to Debian 12, no change.

What VPS provider are you using? Would still be great to see the container logs that @mlsmaycon asked about.

Hello, I am using a KVM VPS provided by Webdock.io. I am including the netbird.log from the new Debian 12 server. netbird.log

braginini commented 1 year ago

Hey @Vaneixus You are running behind Cloudflare that proxies all the traffic. And by default gRPC isn't allowed. This means that the control channel between the NetBird agent and the NetBird Management service can't be cretaed (your agents are getting 403).

You could enable DNS only feature in Cloudfalre for your domain. Go to your domain -> record -> Proxy status

cloudfalre

Vaneixus commented 1 year ago

Hey @Vaneixus You are running behind Cloudflare that proxies all the traffic. And by default gRPC isn't allowed. This means that the control channel between the NetBird agent and the NetBird Management service can't be cretaed (your agents are getting 403).

You could enable DNS only feature in Cloudfalre for your domain. Go to your domain -> record -> Proxy status

cloudfalre

oh. that explains it.

braginini commented 1 year ago

Let me know if this fixed the issue, @Vaneixus

Vaneixus commented 1 year ago

Let me know if this fixed the issue, @Vaneixus

Hello again, yes, I can confirm that fixed it. That was such a silly mistake. Thanks a lot!

visedge commented 1 year ago

Whenever I uncheck the 'proxy' in cloudflare, my ip is exposed. I have the netbird server installed in my homelab, so does anyone know of another way of resolving this error?

Regards