[GH-ISSUE #5069] A fresh NetBird installation with the Getting Started file results in 401 Error #9848

Closed
opened 2026-08-05 01:23:42 -04:00 by saavagebueno · 4 comments
Owner

Originally created by @tilwegener on GitHub (Jan 8, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5069

Describe the problem

A fresh NetBird installation with the Getting Started file results in this error:

“Request failed with status code 401 Error: Token invalid”.

The following can be read in the logs:

netbird-management  | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq7g] management/server/http/middleware/auth_middleware.go:91: Error when validating JWT: token could not be parsed: token is unverifiable: error while executing keyfunc: unable to find appropriate key
netbird-management  | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq7g] shared/management/http/util/util.go:85: got a handler error: token invalid
netbird-management  | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq7g] management/server/telemetry/http_api_metrics.go:201: HTTP response d5fqp57nbe4s73cbqq7g: GET /api/users/current status 401
netbird-management  | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq80] shared/auth/jwt/validator.go:124: getPublicKey error: unable to find appropriate key
netbird-management  | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq80] shared/auth/jwt/validator.go:191: token could not be parsed: token is unverifiable: error while executing keyfunc: unable to find appropriate key
netbird-management  | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq80] management/server/http/middleware/auth_middleware.go:91: Error when validating JWT: token could not be parsed: token is unverifiable: error while executing keyfunc: unable to find appropriate key

To Reproduce

Steps to reproduce the behavior:

  1. Install Netbird with export NETBIRD_DOMAIN=netbird.example.com; curl -fsSL https://github.com/netbirdio/netbird/releases/latest/download/getting-started.sh | bash
  2. Setup first user
  3. Login with this user
  4. See error

Expected behavior

The login works and you are logged in.

Are you using NetBird Cloud?

Netbird Selfhosted 0.62.0 on Ubuntu 22.04 LTS and Netbird Selfhosted 0.62.1 on Ubuntu 24.04 LTS

NetBird version

netbird version

Is any other VPN software installed?

If yes, which one?

Debug output

To help us resolve the problem, please attach the following anonymized status output

netbird status -dA

Create and upload a debug bundle, and share the returned file key:

netbird debug for 1m -AS -U

Uploaded files are automatically deleted after 30 days.

Alternatively, create the file only and attach it here manually:

netbird debug for 1m -AS

Screenshots

Image

Additional context

Add any other context about the problem here.

Have you tried these troubleshooting steps?

  • Reviewed client troubleshooting (if applicable)
  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings
Originally created by @tilwegener on GitHub (Jan 8, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5069 **Describe the problem** A fresh NetBird installation with the Getting Started file results in this error: “Request failed with status code 401 Error: Token invalid”. The following can be read in the logs: ``` netbird-management | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq7g] management/server/http/middleware/auth_middleware.go:91: Error when validating JWT: token could not be parsed: token is unverifiable: error while executing keyfunc: unable to find appropriate key netbird-management | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq7g] shared/management/http/util/util.go:85: got a handler error: token invalid netbird-management | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq7g] management/server/telemetry/http_api_metrics.go:201: HTTP response d5fqp57nbe4s73cbqq7g: GET /api/users/current status 401 netbird-management | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq80] shared/auth/jwt/validator.go:124: getPublicKey error: unable to find appropriate key netbird-management | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq80] shared/auth/jwt/validator.go:191: token could not be parsed: token is unverifiable: error while executing keyfunc: unable to find appropriate key netbird-management | 2026-01-08T13:09:40Z ERRO [context: HTTP, requestID: d5fqp57nbe4s73cbqq80] management/server/http/middleware/auth_middleware.go:91: Error when validating JWT: token could not be parsed: token is unverifiable: error while executing keyfunc: unable to find appropriate key ``` **To Reproduce** Steps to reproduce the behavior: 1. Install Netbird with `export NETBIRD_DOMAIN=netbird.example.com; curl -fsSL https://github.com/netbirdio/netbird/releases/latest/download/getting-started.sh | bash` 2. Setup first user 3. Login with this user 4. See error **Expected behavior** The login works and you are logged in. **Are you using NetBird Cloud?** Netbird Selfhosted 0.62.0 on Ubuntu 22.04 LTS and Netbird Selfhosted 0.62.1 on Ubuntu 24.04 LTS **NetBird version** `netbird version` **Is any other VPN software installed?** If yes, which one? **Debug output** To help us resolve the problem, please attach the following anonymized status output netbird status -dA Create and upload a debug bundle, and share the returned file key: netbird debug for 1m -AS -U *Uploaded files are automatically deleted after 30 days.* Alternatively, create the file only and attach it here manually: netbird debug for 1m -AS **Screenshots** <img width="469" height="80" alt="Image" src="https://github.com/user-attachments/assets/b2df4b47-da1d-4a4c-b77e-8171f406f95e" /> **Additional context** Add any other context about the problem here. **Have you tried these troubleshooting steps?** - [x] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [x] Checked for newer NetBird versions - [x] Searched for similar issues on GitHub (including closed ones) - [x] Restarted the NetBird client - [x] Disabled other VPN software - [x] Checked firewall settings
saavagebueno added the triage-needed label 2026-08-05 01:23:42 -04:00
Author
Owner

@codewhizz commented on GitHub (Jan 8, 2026):

Just installed completely fresh the latest version (extra info - with the same subdomain I used for v0.60.9 netbird).

I'm getting this error after completing the setup of new account and signing in -
I think it successfully logs in, and redirects to this page
https://netbird.example.com/peers

and then soon after that without showing anything redirects to this page
https://netbird.example.com/error?code=403&message=failed%2520to%2520validate%2520user%2520permissions%253A%2520user%2520is%2520pending%2520approval&type=user-status

Image
<!-- gh-comment-id:3724498583 --> @codewhizz commented on GitHub (Jan 8, 2026): Just installed completely fresh the latest version (extra info - with the same subdomain I used for v0.60.9 netbird). I'm getting this error after completing the setup of new account and signing in - I think it successfully logs in, and redirects to this page https://netbird.example.com/peers and then soon after that without showing anything redirects to this page https://netbird.example.com/error?code=403&message=failed%2520to%2520validate%2520user%2520permissions%253A%2520user%2520is%2520pending%2520approval&type=user-status <img width="942" height="571" alt="Image" src="https://github.com/user-attachments/assets/3e8fd4fa-f2e4-49ca-89db-2619ae8df6fb" />
Author
Owner

@codewhizz commented on GitHub (Jan 8, 2026):

I freshly reinstalled it again with different subdomain, now I don't see the setup page as well. It just redirects me to sign in page. And when I try to sign in with credentials I used to setup to my old subdomain for netbird v0.62.1 an hour ago. WEIRDLY It signs me in! (I don't know how it signed me in with that credentials, because I reinstalled fresh and changed subdomain as well.)

And after I'm signed in it shows me this error

Screenshots

Image

same as @tilwegener

<!-- gh-comment-id:3724981367 --> @codewhizz commented on GitHub (Jan 8, 2026): I freshly reinstalled it again with different subdomain, now I don't see the setup page as well. It just redirects me to sign in page. And when I try to sign in with credentials I used to setup to my old subdomain for netbird v0.62.1 an hour ago. WEIRDLY It signs me in! (I don't know how it signed me in with that credentials, because I reinstalled fresh and changed subdomain as well.) And after I'm signed in it shows me this error > **Screenshots** > > <img alt="Image" width="469" height="80" src="https://private-user-images.githubusercontent.com/38760774/533360309-b2df4b47-da1d-4a4c-b77e-8171f406f95e.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njc4OTQ1MTgsIm5iZiI6MTc2Nzg5NDIxOCwicGF0aCI6Ii8zODc2MDc3NC81MzMzNjAzMDktYjJkZjRiNDctZGExZC00YTRjLWI3N2UtODE3MWY0MDZmOTVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAxMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMTA4VDE3NDMzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ3NDllZDZkODFjODc3MDJkYTUzZmNkYjA1ZTgwZTJjZjU3MTVlNGQ5ZTgyMTdkZjkxM2JmYzA2OGE5NTg4ODAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.DiuP7sky6YCqkvC8GIDDe7F6MbvzRfCU6r7mgfym-0I"> same as @tilwegener
Author
Owner

@codewhizz commented on GitHub (Jan 8, 2026):

I'm so sorry! I thought I'd deleted docker volumes with command docker volume prune --force, but after doing docker volume ls, I saw all old volumes were still there. ChatGPT's commands sent me hallucinating fr...

My Fix (Warning: Only for fresh installs not for upgrades) -
docker volume prune --all was the correct command. Thank you! Excited to try this new version

<!-- gh-comment-id:3725215397 --> @codewhizz commented on GitHub (Jan 8, 2026): I'm so sorry! I thought I'd deleted docker volumes with command `docker volume prune --force`, but after doing `docker volume ls`, I saw all old volumes were still there. ChatGPT's commands sent me hallucinating fr... **My Fix (Warning: Only for fresh installs not for upgrades) -** `docker volume prune --all` was the correct command. Thank you! Excited to try this new version
Author
Owner

@tilwegener commented on GitHub (Jan 9, 2026):

Fixed with #5073.

<!-- gh-comment-id:3730272341 --> @tilwegener commented on GitHub (Jan 9, 2026): Fixed with #5073.
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9848