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

Waiting for Zitadel to become ready LOOP #1709

Closed alfrefarina closed 8 months ago

alfrefarina commented 8 months ago

Describe the problem

I'm following the Quickstart guide for self hosting, I've successfully opened the required ports and pointed my public domain to the VM. Unfortunately it gets stuck on Waiting for Zitadel to become ready, I can access the Zitadel page with https://domainname:443/ui/console and I can also see that I get the Lets Encrypt certificate.

If I just type the domain name I get a blank page.

To Reproduce

Follow the Quickstart Guide

Expected behavior

It should go further and show me the NetBird console

Are you using NetBird Cloud?

No

NetBird version

Latest

Screenshots

Screenshot 2024-03-15 at 15 58 41

braginini commented 8 months ago

hey @alfrefarina Are you running behind Cloudflare? Also, could you please send the output of docker compose logs command?

alfrefarina commented 8 months ago

Hello, thanks for answering, no I'm not running behind Cloudflare. These are the logs, I hope I sent them correctly. netbird_docker_logs.txt

mlsmaycon commented 8 months ago

@alfrefarina, can you confirm if the issue persists and if you are running with the required VM size?

The database used by Zitadel is quite resource-intensive, so you should have at least 1CPU and 2GB of memory

alfrefarina commented 8 months ago

Yes, the issue still persists. My machine is an Ubuntu 20.04 with 4CPU and 4GB of memory.

mlsmaycon commented 8 months ago

the script validates the zitadel endpoint by issuing a request to Zitadel using the domain and generated PAT.

you can test it out with the following command:

PAT=$(cat ./machinekey/zitadel-admin-sa.token)
NETBIRD_DOMAIN=<your_instance_domain>
curl -v --fail -o /dev/null "https://$NETBIRD_DOMAIN/auth/v1/users/me" -H "Authorization: Bearer $PAT"

Is possible that the system can't access the docker container using this domain

alfrefarina commented 8 months ago

If I run these commands the script gets stuck "Trying IP:443.." at 0%, if I access the URL https://$NETBIRD_DOMAIN/auth/v1/users/me it says: "code: 16, message: auth header missing"

mlsmaycon commented 8 months ago

can you update your /etc/hosts file and add the NETBIRD_DOMAIN value pointing to a local VM IP address and then try again?

alfrefarina commented 8 months ago

If I point the NETBIRD_DOMAIN to the local IP address your commands seem to work, but shouldn't the domain point to the Public IP?

mlsmaycon commented 8 months ago

only for remote clients, the services don't need to use private IP addresses, so changing the /etc/hosts should be fine.

alfrefarina commented 8 months ago

Sorry but I'm confused, if I rerun the quickstart script with NETBIRD_DOMAIN pointing to my local private IP address I won't get a certificate, because it needs my Public IP address, or am I wrong?

mlsmaycon commented 8 months ago

This will only happen if you update the domain in your DNS provider. However, updating the local server's /etc/hosts file should not affect certificate provisioning.

alfrefarina commented 8 months ago

Ok, thank you very much, I rerun the script and I can successfully reach NetBird's dashboard.