From c68bb8f99f39dd12bbfd9f0c743bc161fff27858 Mon Sep 17 00:00:00 2001 From: Zoltan Papp Date: Mon, 15 Jun 2026 12:04:50 +0200 Subject: [PATCH] fix(ui): resolve active profile before GetConfig in GetRestrictions GetRestrictions called the daemon GetConfig with an empty GetConfigRequest, which the daemon has rejected since multi-profile support landed ("active profile name is empty") because it reads the profile name from the request. Resolve the active profile via GetActiveProfile first and pass its name/username, mirroring the working Settings.GetConfig path. GetActiveProfile self-heals to the default profile, so a valid name is always supplied; the profile-switch-disabled MDM flag is orthogonal and unaffected. --- client/ui/services/settings.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/ui/services/settings.go b/client/ui/services/settings.go index d56d137fb..253051f50 100644 --- a/client/ui/services/settings.go +++ b/client/ui/services/settings.go @@ -4,6 +4,7 @@ package services import ( "context" + "fmt" "reflect" "github.com/netbirdio/netbird/client/proto" @@ -200,7 +201,14 @@ func (s *Settings) GetRestrictions(ctx context.Context) (Restrictions, error) { if err != nil { return Restrictions{}, err } - cfgResp, err := cli.GetConfig(ctx, &proto.GetConfigRequest{}) + active, err := cli.GetActiveProfile(ctx, &proto.GetActiveProfileRequest{}) + if err != nil { + return Restrictions{}, fmt.Errorf("get active profile: %w", err) + } + cfgResp, err := cli.GetConfig(ctx, &proto.GetConfigRequest{ + ProfileName: active.GetProfileName(), + Username: active.GetUsername(), + }) if err != nil { return Restrictions{}, err }