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
10.09k stars 444 forks source link

Netbird up command not working and unable to login any clients on any platform (self hosted) #1538

Open inboardnor opened 5 months ago

inboardnor commented 5 months ago

I'm facing challenges with setting up Netbird for remote LAN access through a Vultr VM and encountering several peculiar issues. Below, I detail my setup, the specific errors I've encountered, my troubleshooting attempts, and some unusual behaviors that seem related to my core problem. I hope you all can help.Setup Details:Vultr VM Specifications: 2 GB RAM 64 GB Storage Ubuntu 22.04 OSNetbird Version: 0.25.6DNS Configuration: Managed by Cloudflare, with settings:

No proxy
gRPC enabled

Objective and VPN Structure:Goal: To connect to my LAN from outside the network without direct access to my physical router, due to living in an apartment.Strategy: Utilize a cloud server (Vultr VM) acting as a virtual router, managed by Netbird, for my remote connections.Diagram Illustrating the Setup:

[Peer A] --\

-- [Netbird Server (Vultr VM)] -- [LAN] [Peer B] --/

*Command and Error Encountered:Command Used: netbird up --management-url https://domain.com:443

*Error Received:

Error: unable to get daemon status: rpc error: code = FailedPrecondition desc = failed while getting Management Service public key: rpc error: code = Unavailable desc = unexpected HTTP status code received from server: 502 (Bad Gateway); malformed header: missing HTTP content-type

Unusual Behaviors Observed:Connection Attempts: No window prompts for sign-up via the Windows or Mac apps when attempting to connect, unlike demonstrated in tutorial videos. However, accessing the admin page triggers the expected ZITADEL login popup.Peers Page Error: Persistently receiving a "Request failed with status code 502" error on the peers page, which lacks options at the top.Mobile Connection Issue: Attempting to connect via iPhone results in an "invalid server name" warning.Troubleshooting Attempts:Hosts File Modification: Attempted to resolve the issue by commenting out the 127.0.1.1 netbird-router netbird-router line in /etc/hosts.DNS Configuration Adjustment: Following a suggestion from Netbird Issue #1372, edited ](https://github.com/netbirdio/netbird/issues/1372)`/etc/resolv.conf` to remove all nameservers.Docker Compose File Editing: Considered modifying the Docker compose file to address potential configuration issues.Direct Server Manipulation: Checked Netbird server status on Vultr VM, ensuring no service interruptions.Questions for the Community:

How can I resolve the "502 Bad Gateway" error and the missing HTTP content-type header issue?
Is there a known workaround for the sign-up window not appearing when attempting to connect through the apps?
Considering my VPN setup with a Vultr VM, should I add the VM itself as a peer, or is it unnecessary since it's running the Netbird server?
Are there additional configuration steps I should take on Cloudflare, especially regarding gRPC settings, to support my Netbird setup?
Any specific insights into the "invalid server name" warning when attempting to connect devices like an iPhone?

Thank you for considering my situation. Any advice, insights, or recommendations to navigate these challenges would be greatly appreciated.

Br0kenSilos commented 2 months ago

I am having the same / similar issue. I am self-hosted in the cloud. Hostinger and Linode. Using Ubuntu Server 24.04. I have rebuilt this thing 2 dozen times and on different servers on different providers. Each time I get the same results. The install script finishes and provides me with the admin login and password. I go to the link provided and login with the credentials provided. I pick a 2FA method (or skip it). I am asked to change the admin password. I do that, and then it send me to login again. At this point I login with the admin account and the new password. Then it just goes to the little animated netbird logo in the middle of the screen and sits there. Forever...

If I look in the browser f12 I get the following...

CHROME_POLY:
Object { menus: Getter & Setter, manifest: Getter & Setter, normandyAddonStudy: Getter & Setter, extension: Getter & Setter, storage: Getter & Setter, test: Getter & Setter, userScripts: Getter & Setter, runtime: {…}, i18n: {…} } content-scripts.js:1:68054 CONTENT_SHELL: Page allowed. Skipping shell injection blocks content-scripts.js:1:54246 TSS: excluded result: true content-scripts.js:1:65065 Checking to see if there is an authorization response to be delivered. 8858-126786d3acdd1f51.js:1:71012 Potential authorization request https://netbird.mydoman.com/nb-auth Object { code: "KbbUetL5Q3m8maQlQhi2lP7YIVDuPphZ6Jtm2dOqItNiWw", state: "D2tAwxJrA1" } D2tAwxJrA1 KbbUetL5Q3m8maQlQhi2lP7YIVDuPphZ6Jtm2dOqItNiWw undefined 8858-126786d3acdd1f51.js:1:70980 Delivering authorization response 8858-126786d3acdd1f51.js:1:71012 Object { code: 502, message: "" } ​ code: 502 ​ message: "" ​

: Object { … } 6822-d69731cdfa4c45b6.js:1:10743 Object { code: 502, message: "" } ​ code: 502 ​ message: "" ​ : Object { … } 6822-d69731cdfa4c45b6.js:1:10743 Object { code: 502, message: "" } ​ code: 502 ​ message: "" ​ : Object { … } 6822-d69731cdfa4c45b6.js:1:10743 Uncaught (in promise) undefined XHRGET https://netbird.mydoman.com/api/users [HTTP/2 502 75ms] GET https://netbird.mydoman.com/api/users Status 502 VersionHTTP/2 Transferred138 B (0 B size) Referrer Policystrict-origin-when-cross-origin DNS ResolutionDNS over HTTPS alt-svc h3=":443"; ma=2592000 content-length 0 date Sat, 25 May 2024 17:42:55 GMT server Caddy X-Firefox-Spdy h2 Accept application/json Accept-Encoding gzip, deflate, br, zstd Accept-Language en-US,en;q=0.5 Authorization Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjI2ODcwNTc3MTM0MzA1MjgwNCJ9.eyJpc3MiOiJodHRwczovL25iMS5jbGlmZnN0b25lc2cuY29tIiwic3ViIjoiMjY4NzA1NjM1ODgzODEwODIwIiwiYXVkIjpbIjI2ODcwNTYyMjM5NDk5NDY5MkBuZXRiaXJkIiwiMjY4NzA1NjI0NDc1MzY5NDc2QG5ldGJpcmQiLCIyNjg3MDU2MjAzOTg0NDA0NTIiXSwiZXhwIjoxNzE2NzAyMTYyLCJpYXQiOjE3MTY2NTg5NjIsIm5iZiI6MTcxNjY1ODk2MiwianRpIjoiMjY4NzA4ODYxOTkxNTE4MjEyIn0.utLiaYs8IaTYGB7Qm40JU8x7IFUPkUINtRxGsNZk1NO0qd7J3REkZyBlLto_dXVzYPdqk8VxwEVEnY2ZTs7WBqwXxH1UODmDVtAItEb8u-1PtT3tJJ-cFHC4g-mVZn0wYWvzHuNVn2e3r767UdXm6QNiKbtUJi9PEUCiU0nx0eA9wJjkCjsgwmeze4WWxczglQAoFadHzhcFgnqFuzRdIoDivKUh1WnqERZBT55wiShzFHhOBmlgFPFsd5es63fSa3MrlNGugXmZj18CCIg56hyaIKZIs6cjI7KZClQLwyTFBBlbEunlB2TOclyTvIMrlwhbeHV68ybu00Scz8JW6g Cache-Control no-cache Connection keep-alive Content-Type application/json Cookie cf_clearance=WGETMynTFpEIz.2CR_GcZEeFBoOvOidZdsYNpzeYoAE-1716612744-1.0.1.1-yu4ICNIqA5RFX3nRXz5v4CLquPsTYLsUZDnqNL4EU024HLaMG3x2xpyI92Y63UcOJuu2FA65Qssu6l9Vs1pkZg; __Secure-zitadel.useragent=MTcxNjY1ODk2M3xLd1pVdngxNmxyQWJUd0UzdERyaV9YWERnNm5ldGt3dk9aa01ubVE5ZkFiTGpQMmF6S0U2LU9XT2lnb2dLSDV6dENxRHhuSHFCd1VoajNUSWozajJ2X2hpOFpscGtVcz18C-VYHGM6cW_r1beQg4CeCeQO_vJiJf1OjPUlXN0tTKE=; __Host-zitadel.login.csrf=MTcxNjY1NzEyMXxJa293TUhoS2QzUjNjSGh1VUVoR0x6RTVTR3RsT0RnMU16RnllbkZMY2tSQ1RISXZPVzUwUm5OQ2NHYzlJZ289fAotoRJNqeoCeXshcY-xPLKjO4Sfkw2RTokrBJTJ8Evh; mode=auto-dark Host netbird.mydoman.com Pragma no-cache Priority u=4 Referer https://netbird.mydoman.com/peers Sec-Fetch-Dest empty Sec-Fetch-Mode cors Sec-Fetch-Site same-origin Sec-GPC 1 TE trailers User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0