yabai icon indicating copy to clipboard operation
yabai copied to clipboard

Error Installation on M1 Air: yabai: scripting-addition failed to inject payload into Dock.app!

Open Jonovono opened this issue 2 years ago • 14 comments

Hi, I followed the Mac thread and have tried everything! But can't seem to get it working. Everything works except the spaces.

Anyone have any ideas?

I'm still having issues, even after following @Tweoss steps

I get this error:

$ sudo yabai --load-sa
could not spawn remote thread: (os/kern) invalid argument
yabai: scripting-addition failed to inject payload into Dock.app!
MacBook Air (M1, 2020) 12.2.1

File Commands:

$ file $(which yabai)
/usr/local/bin/yabai: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64]
/usr/local/bin/yabai (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/local/bin/yabai (for architecture arm64):	Mach-O 64-bit executable arm64

jordan at MacBook-Air in ~
$ cat /Library/ScriptingAdditions/yabai.osax/Contents/Info.plist | grep -A 1 CFBundleVersion
<key>CFBundleVersion</key>
<string>2.0.4</string>

jordan at MacBook-Air in ~
$ file /Library/ScriptingAdditions/yabai.osax/Contents/Resources/payload.bundle/Contents/MacOS/payload
/Library/ScriptingAdditions/yabai.osax/Contents/Resources/payload.bundle/Contents/MacOS/payload: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64e:Mach-O 64-bit dynamically linked shared library arm64e]
/Library/ScriptingAdditions/yabai.osax/Contents/Resources/payload.bundle/Contents/MacOS/payload (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/Library/ScriptingAdditions/yabai.osax/Contents/Resources/payload.bundle/Contents/MacOS/payload (for architecture arm64e):	Mach-O 64-bit dynamically linked shared library arm64e

jordan at MacBook-Air in ~
$ file /Library/ScriptingAdditions/yabai.osax/Contents/MacOS/mach_loader
/Library/ScriptingAdditions/yabai.osax/Contents/MacOS/mach_loader: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/Library/ScriptingAdditions/yabai.osax/Contents/MacOS/mach_loader (for architecture x86_64):	Mach-O 64-bit executable x86_64
/Library/ScriptingAdditions/yabai.osax/Contents/MacOS/mach_loader (for architecture arm64e):	Mach-O 64-bit executable arm64e

Console.app logs:

default	16:39:16.581952-0400	runningboardd	Acquiring assertion targeting [daemon<com.apple.Dock.agent(501)>:2470] from originator [daemon<com.apple.WindowServer(88)>:394] with description <RBSAssertionDescriptor| "AppVisible" ID:414-394-1294 target:2470 attributes:[
	<RBSDomainAttribute| domain:"com.apple.appnap" name:"AppVisible" sourceEnvironment:"(null)">,
	<RBSAcquisitionCompletionAttribute| policy:AfterApplication>
	]>
default	16:39:16.582912-0400	runningboardd	Assertion 414-394-1294 (target:[daemon<com.apple.Dock.agent(501)>:2470]) will be created as active
default	16:39:16.592556-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring jetsam update because this process is not memory-managed
default	16:39:16.592758-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring suspend because this process is not lifecycle managed
default	16:39:16.592863-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring GPU update because this process is not GPU managed
default	16:39:16.593048-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Skipping AppNap state - not lifecycle managed
default	16:39:17.105830-0400	runningboardd	Invalidating assertion 414-394-1294 (target:[daemon<com.apple.Dock.agent(501)>:2470]) from originator [daemon<com.apple.WindowServer(88)>:394]
default	16:39:17.227613-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring jetsam update because this process is not memory-managed
default	16:39:17.228876-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring suspend because this process is not lifecycle managed
default	16:39:17.228997-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring GPU update because this process is not GPU managed
default	16:39:17.229378-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Skipping AppNap state - not lifecycle managed
default	16:39:19.145541-0400	Dock	LSExceptions shared instance invalidated for timeout.
default	16:39:19.644987-0400	runningboardd	Acquiring assertion targeting [daemon<com.apple.Dock.agent(501)>:2470] from originator [daemon<com.apple.WindowServer(88)>:394] with description <RBSAssertionDescriptor| "AppVisible" ID:414-394-1322 target:2470 attributes:[
	<RBSDomainAttribute| domain:"com.apple.appnap" name:"AppVisible" sourceEnvironment:"(null)">,
	<RBSAcquisitionCompletionAttribute| policy:AfterApplication>
	]>
default	16:39:19.645126-0400	runningboardd	Assertion 414-394-1322 (target:[daemon<com.apple.Dock.agent(501)>:2470]) will be created as active
default	16:39:19.645662-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring jetsam update because this process is not memory-managed
default	16:39:19.645699-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring suspend because this process is not lifecycle managed
default	16:39:19.645735-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring GPU update because this process is not GPU managed
default	16:39:19.645939-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Skipping AppNap state - not lifecycle managed
default	16:39:19.705178-0400	runningboardd	Invalidating assertion 414-394-1322 (target:[daemon<com.apple.Dock.agent(501)>:2470]) from originator [daemon<com.apple.WindowServer(88)>:394]
default	16:39:19.823085-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring jetsam update because this process is not memory-managed
default	16:39:19.823123-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring suspend because this process is not lifecycle managed
default	16:39:19.824892-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring GPU update because this process is not GPU managed
default	16:39:19.825126-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Skipping AppNap state - not lifecycle managed
default	16:39:33.451859-0400	runningboardd	Acquiring assertion targeting [daemon<com.apple.Dock.agent(501)>:2470] from originator [daemon<com.apple.WindowServer(88)>:394] with description <RBSAssertionDescriptor| "AppVisible" ID:414-394-1344 target:2470 attributes:[
	<RBSDomainAttribute| domain:"com.apple.appnap" name:"AppVisible" sourceEnvironment:"(null)">,
	<RBSAcquisitionCompletionAttribute| policy:AfterApplication>
	]>
default	16:39:33.451905-0400	runningboardd	Assertion 414-394-1344 (target:[daemon<com.apple.Dock.agent(501)>:2470]) will be created as active
default	16:39:33.452455-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring jetsam update because this process is not memory-managed
default	16:39:33.452486-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring suspend because this process is not lifecycle managed
default	16:39:33.452512-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring GPU update because this process is not GPU managed
default	16:39:33.452568-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Skipping AppNap state - not lifecycle managed
default	16:39:33.941010-0400	runningboardd	Invalidating assertion 414-394-1344 (target:[daemon<com.apple.Dock.agent(501)>:2470]) from originator [daemon<com.apple.WindowServer(88)>:394]
default	16:39:34.052510-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring jetsam update because this process is not memory-managed
default	16:39:34.052726-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring suspend because this process is not lifecycle managed
default	16:39:34.052944-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring GPU update because this process is not GPU managed
default	16:39:34.053616-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Skipping AppNap state - not lifecycle managed
default	16:39:37.828255-0400	runningboardd	Acquiring assertion targeting [daemon<com.apple.Dock.agent(501)>:2470] from originator [daemon<com.apple.WindowServer(88)>:394] with description <RBSAssertionDescriptor| "AppVisible" ID:414-394-1385 target:2470 attributes:[
	<RBSDomainAttribute| domain:"com.apple.appnap" name:"AppVisible" sourceEnvironment:"(null)">,
	<RBSAcquisitionCompletionAttribute| policy:AfterApplication>
	]>
default	16:39:37.828433-0400	runningboardd	Assertion 414-394-1385 (target:[daemon<com.apple.Dock.agent(501)>:2470]) will be created as active
default	16:39:37.829545-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring jetsam update because this process is not memory-managed
default	16:39:37.829580-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring suspend because this process is not lifecycle managed
default	16:39:37.829613-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring GPU update because this process is not GPU managed
default	16:39:37.829679-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Skipping AppNap state - not lifecycle managed
default	16:39:37.907046-0400	runningboardd	Invalidating assertion 414-394-1385 (target:[daemon<com.apple.Dock.agent(501)>:2470]) from originator [daemon<com.apple.WindowServer(88)>:394]
default	16:39:38.024341-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring jetsam update because this process is not memory-managed
default	16:39:38.024780-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring suspend because this process is not lifecycle managed
default	16:39:38.025316-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Ignoring GPU update because this process is not GPU managed
default	16:39:38.026043-0400	runningboardd	[daemon<com.apple.Dock.agent(501)>:2470] Skipping AppNap state - not lifecycle managed

Any ideas?

Jonovono avatar Apr 16 '22 20:04 Jonovono

facing the same issue on mac os 12.3.1.

mrpmohiburrahman avatar Apr 16 '22 22:04 mrpmohiburrahman

Make sure that the terminal/shell you are running is an arm binary, and not an x86-64 binary running through Rosetta 2.

koekeishiya avatar Apr 18 '22 15:04 koekeishiya

Got this error too using both os x default terminal and iTerm. The "Open with Rosetta" was unticked in both cases.

Mebius973 avatar Apr 25 '22 12:04 Mebius973

$ sudo yabai --load-sa
could not spawn remote thread: (os/kern) invalid argument
yabai: scripting-addition failed to inject payload into Dock.app!

I am not sure which specific error it is in your case, but this message is either caused by an architecture mismatch, or because the following flag (on Apple Silicon) has not been set properly :

# Open a terminal and run the below command, then reboot
sudo nvram boot-args=-arm64e_preview_abi

If you are certain that none of the above is the case, you can also try to fully disable SIP (from recovery): csrutil disable. Last time I tested I could use the partial disabling command listed in the wiki, but maybe this changed in Monterey 12.3.1.

koekeishiya avatar Apr 25 '22 14:04 koekeishiya

My bad, I don' t have exactly the same issue:

sudo yabai --load-sa
could not retrieve task port for pid: 6658
yabai: scripting-addition failed to inject payload into Dock.app!

The process is Dock.app:

ps ax | grep 6658
 6658   ??  S      0:00.31 /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock

SIP is disabled:

csrutil status
System Integrity Protection status: disabled.

Mebius973 avatar Apr 25 '22 15:04 Mebius973

Are you running from a sandboxed environment, like Nix or something? I have never gotten that error message myself as long as SIP is disabled.

koekeishiya avatar Apr 25 '22 15:04 koekeishiya

I'm running from a M1 macbook pro with filevault activated.

Mebius973 avatar Apr 25 '22 15:04 Mebius973

solved it using sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool true

Mebius973 avatar Apr 25 '22 16:04 Mebius973

Hm I don't remember ever having to turn off library validation. Will need to check my system if it for some reason is disabled??

koekeishiya avatar Apr 25 '22 16:04 koekeishiya

I use Xtrafinder and during the installation it is asked to do so to enable loading script-additions. Just after doing that, I had no issue loading the SA for yabai.

Mebius973 avatar Apr 25 '22 16:04 Mebius973

I'm also having the same issue and have confirmed boot-args are set properly and that the terminal is an arm binary. Could anything else be causing this error:

$ sudo yabai --load-sa
could not spawn remote thread: (os/kern) invalid argument
yabai: scripting-addition failed to inject payload into Dock.app!

acdifran avatar Apr 28 '22 02:04 acdifran

I'm getting the following:

~ ❯ sudo yabai --load-sa
sh: /Library/ScriptingAdditions/yabai.osax/Contents/MacOS/mach_loader: No such file or directory
yabai: scripting-addition failed to inject payload into Dock.app!

I had issues on 11.3 (didn't check the error message but had the same problems) and 12.3.

PaddiM8 avatar May 15 '22 11:05 PaddiM8

I'm getting the following:

~ ❯ sudo yabai --load-sa
sh: /Library/ScriptingAdditions/yabai.osax/Contents/MacOS/mach_loader: No such file or directory
yabai: scripting-addition failed to inject payload into Dock.app!

I had issues on 11.3 (didn't check the error message but had the same problems) and 12.3.

I see the same error:

grafik

karkraeg avatar May 31 '22 10:05 karkraeg

I'm getting the following:

~ ❯ sudo yabai --load-sa
sh: /Library/ScriptingAdditions/yabai.osax/Contents/MacOS/mach_loader: No such file or directory
yabai: scripting-addition failed to inject payload into Dock.app!

I had issues on 11.3 (didn't check the error message but had the same problems) and 12.3.

I see the same error:

grafik

fixed by sudo nvram boot-args=-arm64e_preview_abi

karkraeg avatar May 31 '22 11:05 karkraeg

i has a similar issue and the problem was that the yabai service in homebrew was not started. once i started it with brew services start yabai sudo yabai --load-sa everything worked as expected :)

AquaWolf33 avatar Aug 07 '22 06:08 AquaWolf33