{"record":{"id":"512ddd9a6109c4bb","repo":"netbirdio/netbird","slug":"daemon-login-failed-v","errorCode":null,"errorMessage":"daemon login failed: %v","messagePattern":"daemon login failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/login.go","lineNumber":92,"sourceCode":"\t\t\tif providedSetupKey != \"\" {\n\t\t\t\treturn fmt.Errorf(\"--extend cannot be combined with a setup key; setup keys can only enrol new peers\")\n\t\t\t}\n\t\t\tif err := doExtendSession(ctx, cmd); err != nil {\n\t\t\t\treturn fmt.Errorf(\"extend session failed: %v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\n\t\t// workaround to run without service\n\t\tif util.FindFirstLogPath(logFiles) == \"\" {\n\t\t\tif err := doForegroundLogin(ctx, cmd, providedSetupKey, activeProf); err != nil {\n\t\t\t\treturn fmt.Errorf(\"foreground login failed: %v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\n\t\tif err := doDaemonLogin(ctx, cmd, providedSetupKey, activeProf, username.Username, pm); err != nil {\n\t\t\treturn fmt.Errorf(\"daemon login failed: %v\", err)\n\t\t}\n\n\t\tcmd.Println(\"Logging successfully\")\n\n\t\treturn nil\n\t},\n}\n\nfunc doDaemonLogin(ctx context.Context, cmd *cobra.Command, providedSetupKey string, activeProf *profilemanager.Profile, username string, pm *profilemanager.ProfileManager) error {\n\tconn, err := DialClientGRPCServer(ctx, daemonAddr)\n\tif err != nil {\n\t\t//nolint\n\t\treturn fmt.Errorf(\"failed to connect to daemon error: %v\\n\"+\n\t\t\t\"If the daemon is not running please run: \"+\n\t\t\t\"\\nnetbird service install \\nnetbird service start\\n\", err)\n\t}\n\tdefer conn.Close()\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/login.go#L74-L110","documentation":"Wraps a failure from doDaemonLogin: when the NetBird daemon/service is running, `netbird login` delegates authentication to the daemon over its IPC socket, and this error surfaces any login failure reported back by the daemon. It fires whenever the daemon-side login (management connection, profile handling, or credential exchange) returns an error, so the CLI command exits non-zero instead of silently reporting success.","triggerScenarios":"Thrown at client/cmd/login.go:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the inner error to see whether it was daemon connectivity, the Login RPC, or SSO","Ensure the daemon is installed and running ('netbird service install && netbird service start')","For SSO failures, complete the browser flow and retry login"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","contentChangedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}