netbirdio/netbird · error
unable to get daemon status: %v
Error message
unable to get daemon status: %v
What it means
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.
Source
Thrown at client/cmd/up.go:302
return fmt.Errorf("failed to connect to daemon error: %v\n"+
"If the daemon is not running please run: "+
"\nnetbird service install \nnetbird service start\n", err)
}
defer func() {
err := conn.Close()
if err != nil {
log.Warnf("failed closing daemon gRPC client connection %v", err)
return
}
}()
client := proto.NewDaemonServiceClient(conn)
status, err := client.Status(ctx, &proto.StatusRequest{
WaitForReady: func() *bool { b := true; return &b }(),
})
if err != nil {
return fmt.Errorf("unable to get daemon status: %v", err)
}
if status.Status == string(internal.StatusConnected) {
if !profileSwitched {
cmd.Println("Already connected")
return nil
}
if _, err := client.Down(ctx, &proto.DownRequest{}); err != nil {
log.Errorf("call service down method: %v", err)
return err
}
}
username, err := user.Current()
if err != nil {
return fmt.Errorf("get current user: %v", err)
}View on GitHub (pinned to 93e97f4bf1)
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
Defensive patterns
Strategy: retry
Try / catch
// WaitForReady hides startup races; retry once after the service reports active
if err := runUp(); err != nil && strings.Contains(err.Error(), "unable to get daemon status") {
time.Sleep(2 * time.Second)
err = runUp()
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- management client is not initialised
- service is not up
- client not initialized
- engine not started
- no connection to management
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/1f6be5190e5f0e7d.
Report an issue: GitHub.