[GH-ISSUE #5218] Foreground login broken #10138

Closed
opened 2026-08-05 01:24:46 -04:00 by saavagebueno · 6 comments
Owner

Originally created by @Nyeksenn on GitHub (Jan 30, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5218

I want to start the netbird client using the following command:

sudo netbird up --foreground-mode --log-file console

or alternatively with:

sudo netbird up --foreground-mode --log-file console --setup-key XXXX

Both commands lead to the following error:

2026-01-30T09:36:09+01:00 ERRO shared/management/client/grpc.go:516: failed to login to Management Service: rpc error: code = PermissionDenied desc = no peer auth method provided, please use a setup key or interactive SSO login
Error: foreground login failed: login check failed: rpc error: code = InvalidArgument desc = invalid setup-key or no sso information provided, err: invalid UUID length: 0

I used the latest client version v0.64.3.
This error appears both with the official management server and a self-hosted one.
Originally this error appeared on the Homeassistant addon, but I can easily reproduce it
on a regular Linux server.

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
Originally created by @Nyeksenn on GitHub (Jan 30, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5218 I want to start the netbird client using the following command: ```bash sudo netbird up --foreground-mode --log-file console ``` or alternatively with: ```bash sudo netbird up --foreground-mode --log-file console --setup-key XXXX ``` Both commands lead to the following error: ```bash 2026-01-30T09:36:09+01:00 ERRO shared/management/client/grpc.go:516: failed to login to Management Service: rpc error: code = PermissionDenied desc = no peer auth method provided, please use a setup key or interactive SSO login Error: foreground login failed: login check failed: rpc error: code = InvalidArgument desc = invalid setup-key or no sso information provided, err: invalid UUID length: 0 ``` I used the latest client version `v0.64.3`. This error appears both with the official management server and a self-hosted one. Originally this error appeared on the Homeassistant addon, but I can easily reproduce it on a regular Linux server. **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
saavagebueno added the triage-needed label 2026-08-05 01:24:46 -04:00
Author
Owner

@codesalatdev commented on GitHub (Jan 31, 2026):

Interestingly enough, the PermissionDenied error is not new. I downgraded to 0.60.2 and got the following:

2026-01-31T14:10:25+01:00 ERRO shared/management/client/grpc.go:349: failed to login to Management Service: rpc error: code = PermissionDenied desc = no peer auth method provided, please use a setup key or interactive SSO login
2026-01-31T14:10:25+01:00 ERRO shared/management/client/grpc.go:349: failed to login to Management Service: rpc error: code = PermissionDenied desc = no peer auth method provided, please use a setup key or interactive SSO login
2026-01-31T14:10:25+01:00 INFO client/internal/login.go:170: peer has been successfully registered on Management Service
2026-01-31T14:10:25+01:00 INFO client/internal/connect.go:124: starting NetBird client version 0.60.2 on linux/amd64
2026-01-31T14:10:25+01:00 INFO client/net/env_linux.go:70: system supports advanced routing

It initially showed the same error message only to then login perfectly fine. So I think only the err: invalid UUID length: 0 message is relevant here.

Before downgrading to 0.60.2 I tried logging in with 0.64.2 just to get the same error messages as with 0.64.3.

Since 0.60.2 worked absolutely fine, I used that to log in and then upgraded to 0.64.3.

<!-- gh-comment-id:3828504344 --> @codesalatdev commented on GitHub (Jan 31, 2026): Interestingly enough, the PermissionDenied error is not new. I downgraded to 0.60.2 and got the following: ``` 2026-01-31T14:10:25+01:00 ERRO shared/management/client/grpc.go:349: failed to login to Management Service: rpc error: code = PermissionDenied desc = no peer auth method provided, please use a setup key or interactive SSO login 2026-01-31T14:10:25+01:00 ERRO shared/management/client/grpc.go:349: failed to login to Management Service: rpc error: code = PermissionDenied desc = no peer auth method provided, please use a setup key or interactive SSO login 2026-01-31T14:10:25+01:00 INFO client/internal/login.go:170: peer has been successfully registered on Management Service 2026-01-31T14:10:25+01:00 INFO client/internal/connect.go:124: starting NetBird client version 0.60.2 on linux/amd64 2026-01-31T14:10:25+01:00 INFO client/net/env_linux.go:70: system supports advanced routing ``` It initially showed the same error message only to then login perfectly fine. So I think only the `err: invalid UUID length: 0` message is relevant here. Before downgrading to 0.60.2 I tried logging in with 0.64.2 just to get the same error messages as with 0.64.3. Since 0.60.2 worked absolutely fine, I used that to log in and then upgraded to 0.64.3.
Author
Owner

@kohenkatz commented on GitHub (Feb 1, 2026):

@Nyeksenn said:

Originally this error appeared on the Homeassistant addon, ...

@codesalatdev said:

Since 0.60.2 worked absolutely fine, I used that to log in and then upgraded to 0.64.3.

Home Assistant makes it almost impossible to install an older version, so here's a workaround for using an older version: https://github.com/netbirdio/addon-netbird/issues/345#issuecomment-3830390172

<!-- gh-comment-id:3830402950 --> @kohenkatz commented on GitHub (Feb 1, 2026): @Nyeksenn said: > Originally this error appeared on the Homeassistant addon, ... @codesalatdev said: > Since 0.60.2 worked absolutely fine, I used that to log in and then upgraded to 0.64.3. Home Assistant makes it almost impossible to install an older version, so here's a workaround for using an older version: https://github.com/netbirdio/addon-netbird/issues/345#issuecomment-3830390172
Author
Owner

@kohenkatz commented on GitHub (Feb 1, 2026):

I tested all versions released in the last month. It is broken in 0.64.3 and 0.64.2, but it works in 0.64.1 and older.

I suspect the issue is caused by https://github.com/netbirdio/netbird/pull/5010, but I am not familiar enough with the codebase to say for sure.

<!-- gh-comment-id:3830420873 --> @kohenkatz commented on GitHub (Feb 1, 2026): I tested all versions released in the last month. It is broken in 0.64.3 and 0.64.2, but it works in 0.64.1 and older. I suspect the issue is caused by https://github.com/netbirdio/netbird/pull/5010, but I am not familiar enough with the codebase to say for sure.
Author
Owner

@kohenkatz commented on GitHub (Feb 1, 2026):

I suspect the issue is caused by #5010

Confirmed that this is where the issue comes from.

The old code treated codes.PermissionDenied and codes.InvalidArgument as "needs login", while the new code only does for codes.PermissionDenied, but NOT for codes.InvalidArgument.


Old code in client/cmd/login.go says this:

if s, ok := gstatus.FromError(err); ok && (s.Code() == codes.InvalidArgument || s.Code() == codes.PermissionDenied) {
	needsLogin = true
	return nil
}

New code in client/internal/auth/auth.go says:

isAuthError = isPermissionDenied(err)

which is defined as

func isPermissionDenied(err error) bool {
	if err == nil {
		return false
	}
	s, ok := status.FromError(err)
	if !ok {
		return false
	}
	return s.Code() == codes.PermissionDenied
}

All that said, I'm not sure if this change was intentional, given that @pappz said there are more changes planned here.

<!-- gh-comment-id:3830450828 --> @kohenkatz commented on GitHub (Feb 1, 2026): > I suspect the issue is caused by [#5010](https://github.com/netbirdio/netbird/pull/5010) Confirmed that this is where the issue comes from. The old code treated `codes.PermissionDenied` and `codes.InvalidArgument` as "needs login", while the new code only does for `codes.PermissionDenied`, but NOT for `codes.InvalidArgument`. --- [Old code in `client/cmd/login.go`](https://github.com/netbirdio/netbird/blob/67211010f7240d53734abd922777c32fccb02754/client/cmd/login.go#L280-L289) says this: ``` if s, ok := gstatus.FromError(err); ok && (s.Code() == codes.InvalidArgument || s.Code() == codes.PermissionDenied) { needsLogin = true return nil } ``` [New code in `client/internal/auth/auth.go`](https://github.com/netbirdio/netbird/blob/0c990ab6623530b2ad6925a8dce04bdcc2455baa/client/internal/auth/auth.go#L187) says: ``` isAuthError = isPermissionDenied(err) ``` which is [defined as](https://github.com/netbirdio/netbird/blob/0c990ab6623530b2ad6925a8dce04bdcc2455baa/client/internal/auth/auth.go#L482-L491) ``` func isPermissionDenied(err error) bool { if err == nil { return false } s, ok := status.FromError(err) if !ok { return false } return s.Code() == codes.PermissionDenied } ``` --- All that said, I'm not sure if this change was intentional, given that @pappz [said](https://github.com/netbirdio/netbird/pull/5010#discussion_r2675339341) there are more changes planned here.
Author
Owner

@alexbarcelo commented on GitHub (Feb 4, 2026):

0.64.5 is still giving the same error on my end.

<!-- gh-comment-id:3846952948 --> @alexbarcelo commented on GitHub (Feb 4, 2026): 0.64.5 is still giving the same error on my end.
Author
Owner

@bhudgens commented on GitHub (Feb 9, 2026):

@Nyeksenn said:

Originally this error appeared on the Homeassistant addon, ...

@codesalatdev said:

Since 0.60.2 worked absolutely fine, I used that to log in and then upgraded to 0.64.3.

Home Assistant makes it almost impossible to install an older version, so here's a workaround for using an older version: netbirdio/addon-netbird#345 (comment)

Thank you @kohenkatz for your work around. Your temporary fix worked for me as well.

A script to make this easier for those folks with docker installed:

https://gist.github.com/bhudgens/e76f61a91eeb8492b5706fa4b721cf8e

<!-- gh-comment-id:3873907001 --> @bhudgens commented on GitHub (Feb 9, 2026): > [@Nyeksenn](https://github.com/Nyeksenn) said: > > > Originally this error appeared on the Homeassistant addon, ... > > [@codesalatdev](https://github.com/codesalatdev) said: > > > Since 0.60.2 worked absolutely fine, I used that to log in and then upgraded to 0.64.3. > > Home Assistant makes it almost impossible to install an older version, so here's a workaround for using an older version: [netbirdio/addon-netbird#345 (comment)](https://github.com/netbirdio/addon-netbird/issues/345#issuecomment-3830390172) Thank you @kohenkatz for your work around. Your temporary fix worked for me as well. A script to make this easier for those folks with docker installed: https://gist.github.com/bhudgens/e76f61a91eeb8492b5706fa4b721cf8e
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#10138