netbirdio/netbird · error

failed to get status: %v

Error message

failed to get status: %v

What it means

Raised by the `netbird debug for <duration>` command (runForDuration) when its first daemon RPC, client.Status with ShouldRunProbes:true, returns a gRPC error. The CLI dials the daemon's IPC channel (unix socket / Windows named pipe / loopback TCP via getClient), and surfaces only the gRPC status message via status.Convert(err).Message(). It indicates the CLI-to-daemon RPC failed, not that the peer's connectivity state is bad.

Source

Thrown at client/cmd/debug.go:257

	if err != nil {
		return err
	}

	conn, err := getClient(cmd)
	if err != nil {
		return err
	}
	defer func() {
		if err := conn.Close(); err != nil {
			log.Errorf(errCloseConnection, err)
		}
	}()

	client := proto.NewDaemonServiceClient(conn)

	stat, err := client.Status(cmd.Context(), &proto.StatusRequest{ShouldRunProbes: true})
	if err != nil {
		return fmt.Errorf("failed to get status: %v", status.Convert(err).Message())
	}

	stateWasDown := stat.Status != string(internal.StatusConnected) && stat.Status != string(internal.StatusConnecting)

	initialLogLevel, err := client.GetLogLevel(cmd.Context(), &proto.GetLogLevelRequest{})
	if err != nil {
		return fmt.Errorf("failed to get log level: %v", status.Convert(err).Message())
	}

	if stateWasDown {
		if _, err := client.Up(cmd.Context(), &proto.UpRequest{}); err != nil {
			cmd.PrintErrf("Failed to bring service up: %v\n", status.Convert(err).Message())
		} else {
			cmd.Println("netbird up")
			time.Sleep(time.Second * 10)
		}
	}

View on GitHub (pinned to 93e97f4bf1)

Solutions

  1. Verify the daemon is up: `netbird status` (if that fails too, the daemon is down) or `systemctl status netbird` / Windows `sc query netbird`; start or restart it, then re-run
  2. Inspect daemon logs (/var/log/netbird/client.log or `journalctl -u netbird`) for a crash or restart loop and fix the cause there
  3. If --daemon-addr / NB_DAEMON_ADDR is set, confirm it matches the address the daemon actually serves, or drop the flag to use the default
  4. Re-run the command; because the failure happens before any state change, no cleanup of the overlay is needed
Defensive patterns

Strategy: retry

Validate before calling

# run before the debug command: fail fast if the daemon is unreachable
netbird status >/dev/null 2>&1 || { echo "netbird daemon is not responding; start it first"; exit 1; }
netbird debug for 5m

Prevention

When it happens

Trigger: Calling netbird debug for <duration> while the daemon process is not running or the socket is absent; the daemon crashes or restarts between the dial and the Status call; the caller lacks permission on the socket; a custom --daemon-addr points at an address nothing serves; the command context is canceled (Ctrl+C) before the RPC completes.

Common situations: Running the debug command right after boot before the netbird service has started; after `netbird service uninstall`; daemon crash-looping (check its logs); hardened environments where the invoking user cannot access /var/run/netbird.sock; CI containers that have the CLI but not the service.

Related errors


AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16). Data as JSON: /api/errors/0972d676b42f335e. Report an issue: GitHub.