netbirdio/netbird · error

failed to list network: %v

Error message

failed to list network: %v

What it means

The `netbird networks list` CLI got a gRPC error back from the daemon's ListNetworks RPC; only the status message text is surfaced (status.Convert(err).Message()). This means the CLI reached the daemon, but the daemon refused or failed the call — most often because the peer is not connected/registered with a management service, or the running daemon predates the networks API.

Source

Thrown at client/cmd/networks.go:63

	Args:    cobra.MinimumNArgs(1),
	RunE:    networksDeselect,
}

func init() {
	routesSelectCmd.PersistentFlags().BoolVarP(&appendFlag, "append", "a", false, "Append to current network selection instead of replacing")
}

func networksList(cmd *cobra.Command, _ []string) error {
	conn, err := getClient(cmd)
	if err != nil {
		return err
	}
	defer conn.Close()

	client := proto.NewDaemonServiceClient(conn)
	resp, err := client.ListNetworks(cmd.Context(), &proto.ListNetworksRequest{})
	if err != nil {
		return fmt.Errorf("failed to list network: %v", status.Convert(err).Message())
	}

	if len(resp.Routes) == 0 {
		cmd.Println("No networks available.")
		return nil
	}

	printNetworks(cmd, resp)

	return nil
}

func printNetworks(cmd *cobra.Command, resp *proto.ListNetworksResponse) {
	cmd.Println("Available Networks:")
	for _, route := range resp.Routes {
		printNetwork(cmd, route)
	}
}

View on GitHub (pinned to 93e97f4bf1)

Solutions

  1. Run `netbird status` to confirm the peer is registered and connected to management, then retry
  2. Match versions: upgrade the daemon service to the same (or newer) version as the CLI
  3. Check daemon logs for management connectivity errors (management URL, DNS, TLS)
  4. Re-authenticate with `netbird up` if the session expired or was never established
Defensive patterns

Strategy: try-catch

Validate before calling

# shell preflight: only call networks list when the peer is connected
netbird status --json | grep -q '"Status": "Connected"' && netbird networks list || echo "peer not connected"

Try / catch

resp, err := client.ListNetworks(cmd.Context(), &proto.ListNetworksRequest{})
if err != nil {
    if st, ok := status.FromError(err); ok && st.Code() == codes.Unimplemented {
        return fmt.Errorf("daemon too old for network routes; upgrade the netbird service")
    }
    return fmt.Errorf("list networks: %s", status.Convert(err).Message())
}

Prevention

When it happens

Trigger: Peer never ran `netbird up` (daemon has no management session); management server unreachable so the daemon cannot fetch networks; daemon version older than the CLI (codes.Unimplemented for ListNetworks); daemon still starting up and login state not loaded.

Common situations: CLI/daemon version skew after upgrading only the binary; freshly installed daemon before first login; management outage; running `networks list` right after service start before sync completes.

Related errors


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