{"record":{"id":"1f6be5190e5f0e7d","repo":"netbirdio/netbird","slug":"unable-to-get-daemon-status-v-1f6be5","errorCode":null,"errorMessage":"unable to get daemon status: %v","messagePattern":"unable to get daemon status: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/up.go","lineNumber":302,"sourceCode":"\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 func() {\n\t\terr := conn.Close()\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"failed closing daemon gRPC client connection %v\", err)\n\t\t\treturn\n\t\t}\n\t}()\n\n\tclient := proto.NewDaemonServiceClient(conn)\n\n\tstatus, err := client.Status(ctx, &proto.StatusRequest{\n\t\tWaitForReady: func() *bool { b := true; return &b }(),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to get daemon status: %v\", err)\n\t}\n\n\tif status.Status == string(internal.StatusConnected) {\n\t\tif !profileSwitched {\n\t\t\tcmd.Println(\"Already connected\")\n\t\t\treturn nil\n\t\t}\n\n\t\tif _, err := client.Down(ctx, &proto.DownRequest{}); err != nil {\n\t\t\tlog.Errorf(\"call service down method: %v\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tusername, err := user.Current()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get current user: %v\", err)\n\t}","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/up.go#L284-L320","documentation":"After dialing, the CLI calls client.Status with WaitForReady=true, which blocks until the daemon's gRPC server is serving and then returns its status. This error means that wait failed: the connection broke, the context was canceled, or the daemon never reached a serving state within the wait. It is distinct from 421 in that the dial succeeded but the status RPC did not complete.","triggerScenarios":"Daemon is still initializing and the connection drops; daemon crashes between dial and Status; the CLI context is canceled (Ctrl+C) while blocked in WaitForReady; socket closed by a daemon restart racing the CLI.","commonSituations":"Running `netbird up` immediately after `netbird service start` on slow machines, daemon OOM-killed during startup, or restarting the service while a CLI command is in flight.","solutions":["Confirm the daemon stays up: `netbird service status`; if it restarts, inspect journalctl -u netbird (or Windows service logs)","Retry the command after the service reports running","If the daemon crash-loops, run `netbird service run --log-level debug` in foreground and fix the reported startup error"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// WaitForReady hides startup races; retry once after the service reports active\nif err := runUp(); err != nil && strings.Contains(err.Error(), \"unable to get daemon status\") {\n\ttime.Sleep(2 * time.Second)\n\terr = runUp()\n}","preventionTips":["After `netbird service start`, wait for `netbird service status` to report running before `netbird up`","Keep the daemon from crash-looping: watch memory limits and config validity"],"tags":["go","netbird","grpc","daemon","status","wait-for-ready"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}