netbirdio/netbird · error

get active profile file path: %v

Error message

get active profile file path: %v

What it means

Thrown by runInForegroundMode (client/cmd/up.go:214) when activeProf.FilePath() fails to produce the config file path for the active profile. The foreground path ('netbird up -f' or --foreground-mode) runs without the daemon, so the CLI itself must locate the profile's config file on disk; failure here blocks config setup before any connection attempt.

Source

Thrown at client/cmd/up.go:214

func runInForegroundMode(ctx context.Context, cmd *cobra.Command, activeProf *profilemanager.Profile) error {
	// override the default profile filepath if provided
	if configPath != "" {
		_ = profilemanager.NewServiceManager(configPath)
	}

	err := handleRebrand(cmd)
	if err != nil {
		return err
	}

	customDNSAddressConverted, err := parseCustomDNSAddress(cmd.Flag(dnsResolverAddress).Changed)
	if err != nil {
		return err
	}

	configFilePath, err := activeProf.FilePath()
	if err != nil {
		return fmt.Errorf("get active profile file path: %v", err)
	}

	ic, err := setupConfig(customDNSAddressConverted, cmd, configFilePath)
	if err != nil {
		return fmt.Errorf("setup config: %v", err)
	}

	providedSetupKey, err := getSetupKey()
	if err != nil {
		return err
	}

	config, err := profilemanager.UpdateOrCreateConfig(*ic)
	if err != nil {
		return fmt.Errorf("get config file: %v", err)
	}

	_, _ = profilemanager.UpdateOldManagementURL(ctx, config, configFilePath)

View on GitHub (pinned to 93e97f4bf1)

Solutions

  1. Ensure HOME (or XDG_CONFIG_HOME) is set and writable for the running user
  2. Verify the profile with 'netbird profiles list' and recreate it if its path is stale
  3. Check permissions on the netbird config directory (~/.config/netbird)
Defensive patterns

Strategy: validation

Validate before calling

if home, err := os.UserHomeDir(); err != nil || home == "" {
    log.Fatal("HOME must be set for foreground mode profile paths")
}

Prevention

When it happens

Trigger: Foreground mode when the profile's path cannot be derived: HOME/XDG_CONFIG_HOME unset in a minimal container, profile store entry with a stale path, or permission errors on the config directory.

Common situations: Running 'netbird up --foreground-mode' in containers/CI where HOME is not set; a profile created on another machine or user account referenced by the store.

Related errors


AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16). Data as JSON: /api/errors/bcaed6eb711335f2. Report an issue: GitHub.