netbird icon indicating copy to clipboard operation
netbird copied to clipboard

Installation on MacOS

Open alexkorotysh opened this issue 8 months ago • 42 comments

Describe the problem

I have 2 MacOS, with m1 and m3 chips. I can install and run on one, but I can't do it on another MacOS.

To Reproduce

Steps to reproduce the behavior:

  1. Install with script curl -fsSL https://pkgs.netbird.io/install.sh | sh

Expected behavior Daemon works, I have a socket

Are you using NetBird Cloud? It doesn't matter, Cloud of Self-Hosy

NetBird version

0.41.3

Is any other VPN software installed?

WireGuard, ProtonVPN, OpenVPN, Tailscale

Debug output

To help us resolve the problem, please attach the following debug output

netbird status -dA

netbird status -dA
2025-04-18T09:25:42+03:00 INFO ./caller_not_available:0: 2025/04/18 09:25:42 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"

As well as the file created by

netbird debug for 1m -AS

Error: failed to connect to daemon error: context deadline exceeded
If the daemon is not running please run:
netbird service install
netbird service start

We advise reviewing the anonymized output for any remaining personal information.

Screenshots

Image

Additional context cat /Library/LaunchDaemons/netbird.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Disabled</key>
	<false/>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>netbird</string>
	<key>ProgramArguments</key>
	<array>
		<string>/opt/homebrew/bin/netbird</string>
		<string>service</string>
		<string>run</string>
		<string>--config</string>
		<string>/etc/netbird/config.json</string>
		<string>--log-level</string>
		<string>trace</string>
		<string>--daemon-addr</string>
		<string>unix:///var/run/netbird.sock</string>
		<string>--log-file</string>
		<string>/var/log/netbird/client.log</string>
	</array>
	<key>RunAtLoad</key>
	<false/>
	<key>SessionCreate</key>
	<false/>
	<key>StandardErrorPath</key>
	<string>/var/log/netbird.err.log</string>
	<key>StandardOutPath</key>
	<string>/var/log/netbird.out.log</string>
</dict>
</plist>

If I take the command from netbird.plist and build string and add sudo, it starts to work.

Have you tried these troubleshooting steps?

  • [x] Checked for newer NetBird versions
  • [x] Searched for similar issues on GitHub (including closed ones)
  • [x] Restarted the NetBird client
  • [x] Disabled other VPN software
  • [x] Checked firewall settings

alexkorotysh avatar Apr 18 '25 06:04 alexkorotysh

netbird service install

Init already exists: /Library/LaunchDaemons/netbird.plist
Error: Init already exists: /Library/LaunchDaemons/netbird.plist

netbird service start

"launchctl" failed with stderr: Warning: Expecting a LaunchAgents path since the command was ran as user. Got LaunchDaemons instead.
`launchctl bootstrap` is a recommended alternative.
Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

Error: "launchctl" failed with stderr: Warning: Expecting a LaunchAgents path since the command was ran as user. Got LaunchDaemons instead.
`launchctl bootstrap` is a recommended alternative.
Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

alexkorotysh avatar Apr 18 '25 06:04 alexkorotysh

Add a few words, m3, like a new laptop, I mean, I don't use m3, but here during installation I saw the same issue, but socket started. M1 is my main laptop. Previously, maybe 6 months ago, Netbird worked, but I deleted the client cause smth happened with the client and it didn't work Now I'm back to Netbird, I can't debug what is going on with the starting daemon.

If I run and keep opened terminal open sudo /opt/homebrew/bin/netbird service run --config /etc/netbird/config.json --log-level info --daemon-addr unix:///var/run/netbird.sock

and run netbird up --management-url https://netbird.mod5.tech:33073 --admin-url https://netbird.mod5.tech

it starts working

alexkorotysh avatar Apr 18 '25 06:04 alexkorotysh

I don't see much detail on what is not working, but it is currently required to remove the config.json manually when it stops matching the Peer in the Dashboard:

  • Peer removed from Dashboard,
  • switching NetBird accounts (can provide a config path manually instead),
  • changing logged in user or switching to/from Setup Keys (seen it happen a few times on corporate device handovers)

to summarize:

  1. the launchctl error is clearly due to missing sudo
  2. the top post errors are due to the system daemon not starting

so I have those questions:

  1. Can you clear up which device is not working for you? Is it a new one or the old one?
  2. Did you configure both devices with brew?
  3. for the daemon not starting issue were you able to find anything in /var/log/netbird/client.log or the MacOS logs?

nazarewk avatar Apr 18 '25 07:04 nazarewk

  1. Doesn't work with the old one (Apple M1 Pro - 15.4.1 (24E263))
  2. Yes, brew is used for both
  3. There are no logs, a log file is created only if I run the daemon with sudo
sudo cat /var/log/netbird/client.log
cat: /var/log/netbird/client.log: No such file or directory
###
ls -la /var/log/netbird/
total 0
drwxr-xr-x   2 root  wheel    64 18 Apr 09:17 .
drwxr-xr-x  50 root  wheel  1600 18 Apr 00:30 ..

❯ sudo rm /etc/netbird/config.json
Password:
rm: /etc/netbird/config.json: No such file or directory
~
❯ netbird up --management-url https://netbird.XXXXX.XXXXX:33073 --admin-url https://netbird.XXXXXX.XXXXX
2025-04-18T10:42:50+03:00 INFO ./caller_not_available:0: 2025/04/18 10:42:50 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
2025-04-18T10:42:51+03:00 INFO ./caller_not_available:0: 2025/04/18 10:42:51 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
2025-04-18T10:42:53+03:00 INFO ./caller_not_available:0: 2025/04/18 10:42:53 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
Error: failed to connect to daemon error: context deadline exceeded
If the daemon is not running please run:
netbird service install
netbird service start

~                                                                                                                                                                      3s
❯ netbird service start
"launchctl" failed with stderr: Warning: Expecting a LaunchAgents path since the command was ran as user. Got LaunchDaemons instead.
`launchctl bootstrap` is a recommended alternative.
Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

Error: "launchctl" failed with stderr: Warning: Expecting a LaunchAgents path since the command was ran as user. Got LaunchDaemons instead.
`launchctl bootstrap` is a recommended alternative.
Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

alexkorotysh avatar Apr 18 '25 08:04 alexkorotysh

  • Peer removed from Dashboard,
  • switching NetBird accounts (can provide a config path manually instead),
  • changing logged in user or switching to/from Setup Keys (seen it happen a few times on corporate device handovers)

I can't remove, cause I can't add peer, it doesn't work with cloud and self-hosted

alexkorotysh avatar Apr 18 '25 08:04 alexkorotysh

❯ netbird service start

I'm pretty sure you need to prefix all/most netbird service commands with sudo on all unix systems

nazarewk avatar Apr 18 '25 08:04 nazarewk

sudo netbird service install

Init already exists: /Library/LaunchDaemons/netbird.plist
Error: Init already exists: /Library/LaunchDaemons/netbird.plist

sudo netbird service start

"launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

Error: "launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

alexkorotysh avatar Apr 18 '25 08:04 alexkorotysh

did you try running sudo netbird service uninstall followed by sudo netbird service install to see if this resolves your issue?

nazarewk avatar Apr 18 '25 09:04 nazarewk

❯ sudo netbird service uninstall

Netbird service has been uninstalled

❯ sudo netbird service install

Netbird service has been installed

❯ sudo netbird service start

"launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

Error: "launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

alexkorotysh avatar Apr 18 '25 09:04 alexkorotysh

seems to be caused by launchctl list.

for my MacOS VM it looks like:

kdn@oams ~> ssh anji-vm-macos-01.lan.etra.net.int.kdn.im. launchctl list | grep netbird
597	0	application.io.netbird.client.56499.56507
kdn@oams ~> ssh anji-vm-macos-01.lan.etra.net.int.kdn.im. launchctl list application.io.netbird.client.56499.56507
{
	"LimitLoadToSessionType" = "Aqua";
	"_AdditionalProperties" = {
		"RunningBoard" = {
			"HOME" = "/Users/kdn";
			"RunningBoardLaunchedIdentity" = {
				"AJL" = "application.io.netbird.client.56499.56507";
				"TYPE" = 1;
				"EAI" = "io.netbird.client";
				"AUID" = 				"PLAT" = 			};
			"RunningBoardLaunched" = true;
		};
	};
	"Label" = "application.io.netbird.client.56499.56507";
	"OnDemand" = true;
	"LastExitStatus" = 0;
	"PID" = 597;
	"Program" = "/Applications/NetBird UI.app/netbird-ui";
	"ProgramArguments" = (
		"/Applications/NetBird UI.app/netbird-ui";
	);
	"PerJobMachServices" = {
		"com.apple.tsm.portname" = mach-port-object;
		"com.apple.coredrag" = mach-port-object;
		"com.apple.axserver" = mach-port-object;
	};
};

Can you try running equivalent commands to identify a NetBird service in the launchctll and run the same launhctl list with discovered service name directly in your terminal? I am not a MacOS expert, but I feel like there might be something wrong with the OS configuration itself.

nazarewk avatar Apr 18 '25 09:04 nazarewk

❯ launchctl list | grep netbird

PID	Status	Label
-	78	netbird
22722	0	application.io.netbird.client.168195799.168195808

❯ launchctl list application.io.netbird.client.168195799.168195808

{
	"LimitLoadToSessionType" = "Aqua";
	"_AdditionalProperties" = {
		"RunningBoard" = {
			"TMPDIR" = "/var/folders/jh/6mggjmnd13920q9wqtl52p5r0000gn/T/";
			"HOME" = "/Users/koro";
			"RunningBoardLaunchedIdentity" = {
				"AJL" = "application.io.netbird.client.168195799.168195808";
				"TYPE" = 1;
				"EAI" = "io.netbird.client";
				"AUID" = 				"PLAT" = 			};
			"RunningBoardLaunched" = true;
		};
	};
	"Label" = "application.io.netbird.client.168195799.168195808";
	"OnDemand" = true;
	"LastExitStatus" = 0;
	"PID" = 22722;
	"Program" = "/Applications/Netbird UI.app/netbird-ui";
	"ProgramArguments" = (
		"/Applications/Netbird UI.app/netbird-ui";
	);
	"PerJobMachServices" = {
		"com.apple.tsm.portname" = mach-port-object;
		"com.apple.coredrag" = mach-port-object;
		"com.apple.axserver" = mach-port-object;
	};
};

❯ launchctl list netbird

{
	"StandardOutPath" = "/var/log/netbird.out.log";
	"LimitLoadToSessionType" = "Aqua";
	"StandardErrorPath" = "/var/log/netbird.err.log";
	"Label" = "netbird";
	"OnDemand" = false;
	"LastExitStatus" = 19968;
	"Program" = "/opt/homebrew/bin/netbird";
	"ProgramArguments" = (
		"/opt/homebrew/bin/netbird";
		"service";
		"run";
		"--config";
		"/etc/netbird/config.json";
		"--log-level";
		"info";
		"--daemon-addr";
		"unix:///var/run/netbird.sock";
		"--log-file";
		"/var/log/netbird/client.log";
	);
};

alexkorotysh avatar Apr 18 '25 09:04 alexkorotysh

I didn't want to close the issue

alexkorotysh avatar Apr 18 '25 09:04 alexkorotysh

Seems like you are having a duplicate service: the short netbird and the longer application.io.netbird.client.XXX.YYY. I am guessing the longer name is the correct one, but I don't have enough MacOS and/or release process knowledge to determine which one is correct and how to clean it up.

Do you remember whether you have always used brew or used some other installation methods too? It would be great to know how did you arrive at this state of the system to prevent it in the future.

I will notify the team and we will get back to you sometime after the Easter break, ok?

nazarewk avatar Apr 18 '25 09:04 nazarewk

@nazarewk sure, I remember that I could use for installing your pkg package from Netbird, but usually I use brew as much as possible. I guess it's normal to have 2 plists, one for the socket (engine), one for netbird-ui.

I don't have issues with installing other software, including other VPN services, so it's a reason why I opened the issue. I spent much of time debugging it locally, but nothing worked.

alexkorotysh avatar Apr 18 '25 10:04 alexkorotysh

I don't think there should be 2 plists at all (I'm not observing it and neither other team member has it), the long-form seems to be the correct one.

Can you try running sudo find /Library/LaunchDaemons /Library/LaunchAgents ~/Library/LaunchAgents -name "*netbird*.plist" to identify all possible netbird plist files? Maybe you have some leftover from an old installer.

nazarewk avatar Apr 18 '25 10:04 nazarewk

I grab my logs from other laptop

❯ curl -fsSL https://pkgs.netbird.io/install.sh | sh
The installation will be performed using brew package manager

==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
erlfmt                     intermodal                 nip4
==> New Casks
notion-mail

You have 4 outdated formulae installed.

==> Tapping netbirdio/tap
Cloning into '/opt/homebrew/Library/Taps/netbirdio/homebrew-tap'...
remote: Enumerating objects: 1360, done.
remote: Counting objects: 100% (42/42), done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 1360 (delta 15), reused 18 (delta 5), pack-reused 1318 (from 2)
Receiving objects: 100% (1360/1360), 197.29 KiB | 856.00 KiB/s, done.
Resolving deltas: 100% (569/569), done.
Tapped 1 cask and 1 formula (15 files, 247.4KB).
==> Fetching netbirdio/tap/netbird
==> Downloading https://github.com/netbirdio/netbird/releases/download/v0.41.3/n
==> Downloading from https://objects.githubusercontent.com/github-production-rel
######################################################################### 100.0%
==> Installing netbird from netbirdio/tap
🍺  /opt/homebrew/Cellar/netbird/0.41.3: 6 files, 25.8MB, built in 2 seconds
==> Running `brew cleanup netbird`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Downloading https://github.com/netbirdio/netbird/releases/download/v0.41.3/n
==> Downloading from https://objects.githubusercontent.com/github-production-rel
######################################################################### 100.0%


All dependencies satisfied.
==> Installing Cask netbird-ui
==> Moving App 'netbird_ui_darwin' to '/Applications/Netbird UI.app'
Password:
Sorry, try again.
Password:
Error: "launchctl" failed with stderr: Unload failed: 5: Input/output error
Try running `launchctl bootout` as root for richer errors.

Error: remove /Library/LaunchDaemons/netbird.plist: no such file or directory
🍺  netbird-ui was successfully installed!
Init already exists: /Library/LaunchDaemons/netbird.plist
Error: Init already exists: /Library/LaunchDaemons/netbird.plist
NetBird service has already been loaded
"launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

Error: "launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

NetBird service has already been started
Installation has been finished. To connect, you need to run NetBird by executing the following command:

netbird up
❯ netbird up --management-url https://netbird.XXXXX.XXXXXX:33073 --admin-url https://netbird.XXXXX.XXXXXX
Please do the SSO login in your browser.
If your browser didn't open automatically, use this URL to log in:

https://sso.XXXXXX.XXXXX/application/o/authorize/?audience=BEDeDJGBGcS0zZMnrIdx96mVuzUNhZx2uzxBz74Q&client_id=BEDeDJGBGcS0zZMnrIdx96mVuzUNhZx2uzxBz74Q&code_challenge=jLC6yQWdFKiPFVWt3WVSi7kgH6brTaNk67_fwSEmMxQ&code_challenge_method=S256&redirect_uri=http%3A%2F%2Flocalhost%3A53000&response_type=code&scope=openid+profile+email+offline_access+api&state=24ac6cf5b009deb03a1ff4bc549969814a2f59a97f4022c9

Strange on a workable laptop has only one service launchctl list | grep netbird

6776	0	application.io.netbird.client.13228819.13228828

alexkorotysh avatar Apr 18 '25 10:04 alexkorotysh

From m1 (not worked)

❯ sudo find /Library/LaunchDaemons /Library/LaunchAgents ~/Library/LaunchAgents -name "netbird.plist"

/Library/LaunchDaemons/netbird.plist

alexkorotysh avatar Apr 18 '25 10:04 alexkorotysh

I guess it's normal to have 2 plists, one for the socket (engine), one for netbird-ui.

Looks like you were correct, I do get different results depending on whether I run with or without sudo:

kdn@oams ~> ssh anji-vm-macos-01.lan.etra.net.int.kdn.im. sudo launchctl list | grep netbird
361	0	netbird
kdn@oams ~> ssh anji-vm-macos-01.lan.etra.net.int.kdn.im. launchctl list | grep netbird
597	0	application.io.netbird.client.56499.56507
kdn@oams ~> 

The long-form seems to be specific to the UI service, while the short form is the OS service.

Looks like this is a dead end and we need to figure out what else can be the issue.

nazarewk avatar Apr 18 '25 10:04 nazarewk

Just, tried to fresh reinstall, just share log, maybe it helps

❯ curl -fsSL https://pkgs.netbird.io/install.sh | sh
The installation will be performed using brew package manager
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Installing from the API is now the default behaviour!
You can save space and time by running:
  brew untap homebrew/core
  brew untap homebrew/cask
==> Auto-updated Homebrew!
Updated 1 tap (aquasecurity/trivy).

You have 1 outdated formula installed.

==> Fetching netbirdio/tap/netbird
==> Downloading https://github.com/netbirdio/netbird/releases/download/v0.41.3/n
Already downloaded: /Users/koro/Library/Caches/Homebrew/downloads/5918a36b16653fa703f9ce57b7352f6e042aea75fdef945dca860c0733194f55--netbird_0.41.3_darwin_arm64.tar.gz
==> Installing netbird from netbirdio/tap
🍺  /opt/homebrew/Cellar/netbird/0.41.3: 6 files, 25.8MB, built in 1 second
==> Running `brew cleanup netbird`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Downloading https://github.com/netbirdio/netbird/releases/download/v0.41.3/n
Already downloaded: /Users/koro/Library/Caches/Homebrew/downloads/cda956c3fbb978d5712121e11f07a58d78102e2bbed75d4219c815489f20e9fc--netbird-ui_0.41.3_darwin_arm64_signed.zip
All dependencies satisfied.
==> Installing Cask netbird-ui
==> Moving App 'netbird_ui_darwin' to '/Applications/Netbird UI.app'
Password:
Error: "launchctl" failed with stderr: Unload failed: 5: Input/output error
Try running `launchctl bootout` as root for richer errors.

Error: remove /Library/LaunchDaemons/netbird.plist: no such file or directory
"launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

Error: "launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

🍺  netbird-ui was successfully installed!
Init already exists: /Library/LaunchDaemons/netbird.plist
Error: Init already exists: /Library/LaunchDaemons/netbird.plist
NetBird service has already been loaded
"launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

Error: "launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

NetBird service has already been started
Installation has been finished. To connect, you need to run NetBird by executing the following command:

netbird up
~                                                                                                                                                                     22s
❯ netbird up --management-url https://netbird.XXXXXXXX:33073 --admin-url https://netbird.XXXXXX
2025-04-18T13:19:35+03:00 INFO ./caller_not_available:0: 2025/04/18 13:19:35 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
2025-04-18T13:19:36+03:00 INFO ./caller_not_available:0: 2025/04/18 13:19:36 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
2025-04-18T13:19:37+03:00 INFO ./caller_not_available:0: 2025/04/18 13:19:37 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
Error: failed to connect to daemon error: context deadline exceeded
If the daemon is not running please run:
netbird service install
netbird service start

~                                                                                                                                                                      3s
❯ sudo netbird service start
"launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

Error: "launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

~
❯ sudo netbird service install
Init already exists: /Library/LaunchDaemons/netbird.plist
Error: Init already exists: /Library/LaunchDaemons/netbird.plist
~
❯ netbird up
2025-04-18T13:20:02+03:00 INFO ./caller_not_available:0: 2025/04/18 13:20:02 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
2025-04-18T13:20:03+03:00 INFO ./caller_not_available:0: 2025/04/18 13:20:03 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
2025-04-18T13:20:05+03:00 INFO ./caller_not_available:0: 2025/04/18 13:20:05 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
Error: failed to connect to daemon error: context deadline exceeded
If the daemon is not running please run:
netbird service install
netbird service start

alexkorotysh avatar Apr 18 '25 10:04 alexkorotysh

@alexkorotysh, it seems like another installation might be affecting your current attempt.

can you please run the following commands?

sudo launchctl list | grep netbird
which netbird
ps aux | grep netbird
sudo netbird service stop
sudo netbird service uninstall
sudo launchctl list | grep netbird
ps aux | grep netbird

Save the output to share with us later. If your last command doesn't return anything, please run:

sudo launchctl list | grep netbird
sudo netbird service install
sudo netbird service start
sudo launchctl list | grep netbird
netbird status

mlsmaycon avatar Apr 18 '25 10:04 mlsmaycon

Part1

❯ sudo launchctl list | grep netbird
~                                                                                                                                                                   ✘ 0|1
❯ which netbird

/opt/homebrew/bin/netbird
~
❯ ps aux | grep netbird

koro             10991   0.1  0.3 412817264  52496   ??  S     1:19p.m.   0:02.36 /Applications/Netbird UI.app/netbird-ui
koro             19734   0.0  0.0 410733472   1552 s003  S+    1:32p.m.   0:00.01 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox --exclude-dir=.venv --exclude-dir=venv netbird
~
❯ sudo netbird service stop
Error: "launchctl" failed with stderr: Unload failed: 5: Input/output error
Try running `launchctl bootout` as root for richer errors.

~
❯ sudo netbird service uninstall
Netbird service has been uninstalled
~
❯ sudo launchctl list | grep netbird
~                                                                                                                                                                   ✘ 0|1
❯ ps aux | grep netbird
koro             19961   0.0  0.0 410733472   1520 s003  S+    1:32p.m.   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox --exclude-dir=.venv --exclude-dir=venv netbird
koro             10991   0.0  0.3 412817264  52992   ??  S     1:19p.m.   0:02.41 /Applications/Netbird UI.app/netbird-ui

Part2

❯ sudo launchctl list | grep netbird

~                                                                                                                                                                   ✘ 0|1
❯ sudo netbird service install

Netbird service has been installed
~
❯ sudo netbird service start
"launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

Error: "launchctl" failed with stderr: Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

~
❯ sudo launchctl list | grep netbird
~                                                                                                                                                                   ✘ 0|1
❯ netbird status
2025-04-18T13:33:37+03:00 INFO ./caller_not_available:0: 2025/04/18 13:33:37 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
2025-04-18T13:33:38+03:00 INFO ./caller_not_available:0: 2025/04/18 13:33:38 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
2025-04-18T13:33:40+03:00 INFO ./caller_not_available:0: 2025/04/18 13:33:40 WARNING: [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird.sock", ServerName: "localhost", Attributes: {"<%!p(networktype.keyType=grpc.internal.transport.networktype)>": "unix" }, }. Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird.sock: connect: no such file or directory"
Error: failed to connect to daemon error: context deadline exceeded
If the daemon is not running please run:
netbird service install
netbird service start

alexkorotysh avatar Apr 18 '25 10:04 alexkorotysh

@alexkorotysh is there any pending privacy warning for the daemon or in some cases for your terminal to be accepted?

Also, do you have any MDM or external controller that could change the system security?

Lastly, we could try with pkg:

brew remove --cask netbird-ui
brew remove netbird

then downloading and installing from: https://app.netbird.io/install

mlsmaycon avatar Apr 18 '25 10:04 mlsmaycon

The same with pkg :(

I can run only this line manually, and get a daemon socket,

sudo netbird service run --config /etc/netbird/config.json --log-level info --daemon-addr unix:///var/run/netbird.sock

or

sudo netbird service run

alexkorotysh avatar Apr 18 '25 11:04 alexkorotysh

So, the original issue, that the daemon couldn't start, I need to run it manually

alexkorotysh avatar Apr 18 '25 11:04 alexkorotysh

@alexkorotysh let's check .plist file and binary permissions, run the following commands and share output please

ls -l /Library/LaunchDaemons/netbird.plist
ls -l $(which netbird)
plutil /Library/LaunchDaemons/netbird.plist
cat  /Library/LaunchDaemons/netbird.plist

hakansa avatar Apr 18 '25 11:04 hakansa

❯ ls -l /Library/LaunchDaemons/netbird.plist

-rw-r--r--  1 root  wheel  934 18 Apr 14:08 /Library/LaunchDaemons/netbird.plist
~
❯ ls -l $(which netbird)

lrwxr-xr-x  1 koro  admin  36 18 Apr 14:07 /opt/homebrew/bin/netbird -> ../Cellar/netbird/0.41.3/bin/netbird
~
❯ ls -l /opt/homebrew/Cellar/netbird/0.41.3/bin/netbird

-r-xr-xr-x  1 koro  admin  27063554 16 Apr 17:04 /opt/homebrew/Cellar/netbird/0.41.3/bin/netbird
~
❯ plutil /Library/LaunchDaemons/netbird.plist
/Library/LaunchDaemons/netbird.plist: OK
~
❯ cat  /Library/LaunchDaemons/netbird.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Disabled</key>
	<false/>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>netbird</string>
	<key>ProgramArguments</key>
	<array>
		<string>/opt/homebrew/bin/netbird</string>
		<string>service</string>
		<string>run</string>
		<string>--config</string>
		<string>/etc/netbird/config.json</string>
		<string>--log-level</string>
		<string>info</string>
		<string>--daemon-addr</string>
		<string>unix:///var/run/netbird.sock</string>
		<string>--log-file</string>
		<string>/var/log/netbird/client.log</string>
	</array>
	<key>RunAtLoad</key>
	<false/>
	<key>SessionCreate</key>
	<false/>
	<key>StandardErrorPath</key>
	<string>/var/log/netbird.err.log</string>
	<key>StandardOutPath</key>
	<string>/var/log/netbird.out.log</string>
</dict>
</plist>

alexkorotysh avatar Apr 18 '25 11:04 alexkorotysh

I have exactly the same problem on OpenWRT 0.41.3.

xromansx avatar Apr 23 '25 14:04 xromansx

Same issue with starting service

After reboot service does not starting automatically.

sudo netbird service start works, but have to run it manually

Using package installation from https://pkgs.netbird.io/macos/arm64

On M2 Mac Sequoia 15.5 (24F74)

ernestp avatar Jun 02 '25 04:06 ernestp

@ernestp can you please run the following command to generate a debug bundle for our analysis?

netbird debug bundle --anonymize --upload-bundle

This will upload the bundle file and output an upload key which you can share with us.

mlsmaycon avatar Jun 02 '25 06:06 mlsmaycon

Upload file key: 9ca455295f6c62035bbdf6654a368a4d469b490333bacd809d93cdf2049cdc63/7e4fd97c-8639-43cd-8007-c281b476ff78

@ernestp can you please run the following command to generate a debug bundle for our analysis?

netbird debug bundle --anonymize --upload-bundle

This will upload the bundle file and output an upload key which you can share with us.

ernestp avatar Jun 02 '25 06:06 ernestp