{"record":{"id":"bcaed6eb711335f2","repo":"netbirdio/netbird","slug":"get-active-profile-file-path-v-bcaed6","errorCode":null,"errorMessage":"get active profile file path: %v","messagePattern":"get active profile file path: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/up.go","lineNumber":214,"sourceCode":"func runInForegroundMode(ctx context.Context, cmd *cobra.Command, activeProf *profilemanager.Profile) error {\n\t// override the default profile filepath if provided\n\tif configPath != \"\" {\n\t\t_ = profilemanager.NewServiceManager(configPath)\n\t}\n\n\terr := handleRebrand(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcustomDNSAddressConverted, err := parseCustomDNSAddress(cmd.Flag(dnsResolverAddress).Changed)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconfigFilePath, err := activeProf.FilePath()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get active profile file path: %v\", err)\n\t}\n\n\tic, err := setupConfig(customDNSAddressConverted, cmd, configFilePath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"setup config: %v\", err)\n\t}\n\n\tprovidedSetupKey, err := getSetupKey()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconfig, err := profilemanager.UpdateOrCreateConfig(*ic)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get config file: %v\", err)\n\t}\n\n\t_, _ = profilemanager.UpdateOldManagementURL(ctx, config, configFilePath)","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/up.go#L196-L232","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure HOME (or XDG_CONFIG_HOME) is set and writable for the running user","Verify the profile with 'netbird profiles list' and recreate it if its path is stale","Check permissions on the netbird config directory (~/.config/netbird)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if home, err := os.UserHomeDir(); err != nil || home == \"\" {\n    log.Fatal(\"HOME must be set for foreground mode profile paths\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set HOME/XDG_CONFIG_HOME in containers running foreground mode","Keep the profile store on writable, user-owned storage"],"tags":["cli","foreground","profiles","filesystem","netbird"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}