{"record":{"id":"0a19bffac2875199","repo":"netbirdio/netbird","slug":"daemon-up-failed-v","errorCode":null,"errorMessage":"daemon up failed: %v","messagePattern":"daemon up failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/up.go","lineNumber":333,"sourceCode":"\t}\n\n\tusername, err := user.Current()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get current user: %v\", err)\n\t}\n\n\t// set the new config\n\treq := setupSetConfigReq(customDNSAddressConverted, cmd, activeProf.ID.String(), username.Username)\n\tif _, err := client.SetConfig(ctx, req); err != nil {\n\t\tif st, ok := gstatus.FromError(err); ok && st.Code() == codes.Unavailable {\n\t\t\tlog.Warnf(\"setConfig method is not available in the daemon: %s\", st.Message())\n\t\t} else {\n\t\t\treturn daemonCallError(\"call service setConfig method\", err)\n\t\t}\n\t}\n\n\tif err := doDaemonUp(ctx, cmd, client, pm, activeProf, customDNSAddressConverted, username.Username); err != nil {\n\t\treturn fmt.Errorf(\"daemon up failed: %v\", err)\n\t}\n\tcmd.Println(\"Connected\")\n\treturn nil\n}\n\nfunc doDaemonUp(ctx context.Context, cmd *cobra.Command, client proto.DaemonServiceClient, pm *profilemanager.ProfileManager, activeProf *profilemanager.Profile, customDNSAddressConverted []byte, username string) error {\n\n\tprovidedSetupKey, err := getSetupKey()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get setup key: %v\", err)\n\t}\n\n\tloginRequest, err := setupLoginRequest(providedSetupKey, customDNSAddressConverted, cmd)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"setup login request: %v\", err)\n\t}\n\n\tprofileID := activeProf.ID.String()","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/up.go#L315-L351","documentation":"Generic umbrella returned by runInDaemonMode when doDaemonUp fails. doDaemonUp performs the whole registration sequence: reading the setup key, building the LoginRequest from flags, the backoff-wrapped Login RPC, optional SSO login, and the final Up RPC. Any failure in that chain surfaces here with only 'daemon up failed' as context, so the underlying error string in the output is the real diagnostic.","triggerScenarios":"Any of: setup-key file unreadable; invalid flag values caught by setupLoginRequest; Login RPC failing (bad setup key, unreachable management); SSO flow erroring; Up RPC refusing (e.g. privilege refusal routed through daemonCallError).","commonSituations":"Users see this after `netbird up` with wrong credentials or flags; the actionable text is the wrapped inner error, not this prefix.","solutions":["Read the inner error after the colon; it identifies the actual failing step (setup key, login request, SSO, or the Up call)","Re-run with `--log-level debug` and check the daemon log for the matching failure","If the inner error is a privilege refusal, follow the command it prints (it tells you how to rerun with elevation)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// umbrella error: branch on the wrapped cause, not on this prefix\nif err := upCmd.Execute(); err != nil {\n\tswitch {\n\tcase strings.Contains(err.Error(), \"get setup key\"): // fix credential source\n\tcase strings.Contains(err.Error(), \"login backoff\"): // connectivity to management\n\tcase strings.Contains(err.Error(), \"sso login failed\"): // redo interactive login\n\tdefault: // inspect daemon logs\n\t}\n}","preventionTips":["Treat 'daemon up failed' as a envelope; always read the inner error","Automate unattended registration with setup keys to shrink the failure surface (no SSO, no retries on auth)"],"tags":["go","netbird","cli","wrapper","registration"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}