update(blackhole-2ch): kickstart "com.apple.audio.coreaudiod" Operation not permitted
Verification
- [X] I understand that if I ignore these instructions, my issue may be closed without review.
- [X] I have retried my command with
--force. - [X] I ran
brew update-reset && brew updateand retried my command. - [X] I ran
brew doctor, fixed as many issues as possible and retried my command. - [X] I have checked the instructions for reporting bugs.
- [X] I made doubly sure this is not a checksum does not match / SHA256 mismatch error (do not open an issue before trying to open a PR to fix first).
Description of issue
> brew upgrade
==> Casks with 'auto_updates true' or 'version :latest' will not be upgraded; pa
==> Upgrading 1 outdated package:
blackhole-2ch 0.5.0 -> 0.6.0
==> Upgrading blackhole-2ch
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-cask/aa21378
Already downloaded: /Users/emin/Library/Caches/Homebrew/downloads/304ebd2343c2ca204b80ca5b123eb22ec1c53dd65057dfc453387679f01f7bcf--blackhole-2ch.rb
==> Downloading https://existential.audio/downloads/BlackHole2ch-0.6.0.pkg
Already downloaded: /Users/emin/Library/Caches/Homebrew/downloads/094ac75837aa76e51e9defa1f6623144c5a3b223a1b426cf5ddb42c224e70c4a--BlackHole2ch-0.6.0.pkg
==> Uninstalling packages with sudo; the password may be necessary:
Could not kickstart service "com.apple.audio.coreaudiod": 1: Operation not permitted
==> Purging files for version 0.6.0 of Cask blackhole-2ch
Error: blackhole-2ch: Failure while executing; `/usr/bin/sudo -E -- /bin/launchctl kickstart -kp system/com.apple.audio.coreaudiod` exited with 1. Here's the output:
Could not kickstart service "com.apple.audio.coreaudiod": 1: Operation not permitted
Command that failed
brew upgrade
Output of command with --verbose --debug
I edited manually rb file so that remove kickstart coreaudiod command. https://github.com/kyleneideck/BackgroundMusic/issues/727#issuecomment-2032782997
Output of brew doctor and brew config
-
Output of brew tap
-
Related Issues
https://github.com/kyleneideck/BackgroundMusic/issues/727#issuecomment-2032782997
I have the same error and found this. Core Audio - Known Issues
To improve security and stability, using launchctl kickstart -k is no longer permitted for critical system processes. If a process must be forcefully terminated, it is recommended to use kill instead. (123028502)
Solution: With OS X Sonoma 14.4 update there is no rights to relaunch coreaudiod - https://forums.developer.apple.com/forums/thread/748228?answerId=784882022#784882022
sudo killall coreaudiod
Yes, I patched the Cask files for blackhole-[2|16|64]ch to account for this after it was raised to our attention last month.
We had a discussion the other day about the solution, and someone was kind enough to write a small patch script - https://github.com/orgs/Homebrew/discussions/5291
Thank you @klaushardt and @krehel, I solved my problem with removing the uninstall cask script from local file and kill coreaudiod manually.
I didn't search the issue in discussions, sorry for my mistake.
Manual editing is required for all users. Is it correct because there is not any method to update installed cask in local homebrew metadata?
@emindeniz99 No there isn't, because the uninstall process can often change over time, so we use the version that matches the currently installed version. If you were to remove the cask's directory from the Caskroom, and use brew reinstall the latest uninstall script would be used instead.
I uninstalled the old version by manually modified /opt/homebrew/Caskroom/blackhole-2ch/.metadata/0.5.0/20231116152617.059/Casks/blackhole-2ch.rb at line 18-23 from
system_command "/bin/launchctl",
args: [
"kickstart",
"-kp",
"system/com.apple.audio.coreaudiod",
],
to
system_command "/usr/bin/killall",
args: [
"coreaudiod",
],
Thx @kyan001!
I had to modify it as the new recipe states (commit):
system_command "/usr/bin/killall",
args: ["coreaudiod"],
sudo: true,
must_succeed: true
I uninstalled the old version by manually modified
/opt/homebrew/Caskroom/blackhole-2ch/.metadata/0.5.0/20231116152617.059/Casks/blackhole-2ch.rbat line 18-23 fromsystem_command "/bin/launchctl", args: [ "kickstart", "-kp", "system/com.apple.audio.coreaudiod", ],to
system_command "/usr/bin/killall", args: [ "coreaudiod", ],
Yep this fixed the brew upgrade command for me.
My file was located at /opt/homebrew/Caskroom/blackhole-2ch/.metadata/0.5.0/20230911235106.162/Casks/blackhole-2ch.rb I assume this will be different for each system.
I recommend doing this in terminal:
- Open terminal
- Type:
nano /opt/homebrew/Caskroom/blackhole-2ch/.metadata/0.5.0/ - Press tab until you see
blackhole-2ch.rbfilled out. Which will probably be different if you have the 4 channel
A potentially easier solution is to remove the file from the Caskroom and then reinstall it.
This will cause Brew to use the most up-to-date uninstall stanza, instead of the one that was present when the installed version was installed.
Silicon Mac
rm -rfi /opt/homebrew/Caskroom/blackhole-2ch/
Intel Mac
rm -rfi /usr/local/Caskroom/blackhole-2ch/
Then reinstall
brew reinstall blackhole-2ch
I was running a second reinstall blackhole-64ch - and it was working. Thanks and have a nicce day
I followed bevanjkay -> it was working for blackhole-2ch and blackhole-16ch.
But not for: blackhole-64ch:
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-cask/1f1003545f569d4edd1605b305201d122feb66ed/Casks/b/blackhole-64ch.rb
Already downloaded: /Users/bs/Library/Caches/Homebrew/downloads/6f266aa25cea5072a49537567e6d791240b75ee40f5a7b5672f2e987703bb2c8--blackhole-64ch.rb
==> Downloading https://existential.audio/downloads/BlackHole64ch-0.6.0.pkg
Already downloaded: /Users/bs/Library/Caches/Homebrew/downloads/e3d9aac22defb66f385a873b85ae492aea540dc48984702df9c03837a8e525ea--BlackHole64ch-0.6.0.pkg
==> Installing Cask blackhole-64ch
==> Running installer for blackhole-64ch with sudo; the password may be necessary.
installer: Package name is BlackHole: Audio Loopback Driver (64ch) 0.6.0
installer: Upgrading at base path /
installer: The upgrade failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An error occurred while running scripts from the package “BlackHole64ch-0.6.0.pkg”.)
==> Purging files for version 0.6.0 of Cask blackhole-64ch
Error: Failure while executing; /usr/bin/sudo -u root -E LOGNAME=bs USER=bs USERNAME=bs -- /usr/sbin/installer -pkg /opt/homebrew/Caskroom/blackhole-64ch/0.6.0/BlackHole64ch-0.6.0.pkg -target / exited with 1. Here's the output:
installer: Package name is BlackHole: Audio Loopback Driver (64ch) 0.6.0
installer: Upgrading at base path /
installer: The upgrade failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An error occurred while running scripts from the package “BlackHole64ch-0.6.0.pkg”.)
For intel mac, /usr/local/Caskroom/blackhole-2ch/ instead of /opt/homebrew/Caskroom/blackhole-2ch/
Linking to the relevant issue on the BlackHole repo.
https://github.com/ExistentialAudio/BlackHole/issues/779
BlackHole was transfered during the migration from my Intel Mac to the Silicon Mac. It worked after these commands:
rm -rf /usr/local/Caskroom/blackhole-2ch/
Then install again
brew install blackhole-2ch
I uninstalled the old version by manually modified
/opt/homebrew/Caskroom/blackhole-2ch/.metadata/0.5.0/20231116152617.059/Casks/blackhole-2ch.rbat line 18-23 fromsystem_command "/bin/launchctl", args: [ "kickstart", "-kp", "system/com.apple.audio.coreaudiod", ],to
system_command "/usr/bin/killall", args: [ "coreaudiod", ],
bakcground-music had exactly the same issue, this file can be modified to fix it.
sudo nano /opt/homebrew/Caskroom/background-music/.metadata/0.4.0/20231225152717.155/Casks/background-music.rb
A potentially easier solution is to remove the file from the
Caskroomand then reinstall it. This will cause Brew to use the most up-to-date uninstall stanza, instead of the one that was present when the installed version was installed.Silicon Mac
rm -rfi /opt/homebrew/Caskroom/blackhole-2ch/Intel Mac
rm -rfi /usr/local/Caskroom/blackhole-2ch/Then reinstall
brew reinstall blackhole-2ch
The worked for me if you dont include the "i" in rfi i.e.: rm -rf /opt/homebrew/Caskroom/blackhole-2ch/
Thanks all!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Has it been resolved? Or “won’t fix”?
Devin On May 23, 2024 at 5:05 PM -0700, github-actions[bot] @.***>, wrote:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
The only way to globally resolve this would be to submit a PR to https://github.com/homebrew/Brew to detect and intercept the outdated kickstart command and replace it with the correct command. In future we would ideally replace these commands with a set of commands available through a Ruby DSL and not allow ad-hoc preflight/postflight blocks.
The recommended command is retroactive if that makes any difference.
Devin On May 23, 2024 at 8:13 PM -0700, Bevan Kay @.***>, wrote:
The only way to globally resolve this would be to submit a PR to https://github.com/homebrew/Brew to detect and intercept the outdated kickstart command and replace it with the correct command. In future we would ideally replace these commands with a set of commands available through a Ruby DSL and not allow ad-hoc preflight/postflight blocks. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
Closing this as workaround has been provided
I tried all the above and its not working... (because my blackhole-2ch.rb doesn't exist) Then I figured out this workaround:
-
Disable SIPÂ (System Integrity Protection)Â : go to Recovery Mode and type the following in terminal
csrutil disable -
Then go back to user:
brew uninstall background-music -
Enable SIP again: go to Recovery Mode and type the following in terminal
csrutil enable
I uninstalled the old version by manually modified
/opt/homebrew/Caskroom/blackhole-2ch/.metadata/0.5.0/20231116152617.059/Casks/blackhole-2ch.rbat line 18-23 fromsystem_command "/bin/launchctl", args: [ "kickstart", "-kp", "system/com.apple.audio.coreaudiod", ],to
system_command "/usr/bin/killall", args: [ "coreaudiod", ],
bakcground-musichad exactly the same issue, this file can be modified to fix it.sudo nano /opt/homebrew/Caskroom/background-music/.metadata/0.4.0/20231225152717.155/Casks/background-music.rb
Modifying background-music and then running brew uninstall background-music to invoke killall didn't work for me. Any advice @dobladov ?
â–¶ brew uninstall background-music
==> Uninstalling Cask background-music
==> Removing launchctl service com.bearisdriving.BGM.XPCHelper
Password:
==> Uninstalling packages with sudo; the password may be necessary:
==> Removing files:
/Library/Application Support/Background Music
/Library/Audio/Plug-Ins/HAL/Background Music Device.driver
/usr/local/libexec/BGMXPCHelper.xpc
sudo: usr/bin/killall: command not found
Error: Failure while executing; `/usr/bin/sudo -E -- usr/bin/killall coreaudiod` exited with 1. Here's the output:
sudo: usr/bin/killall: command not found
A potentially easier solution is to remove the file from the
Caskroomand then reinstall it. This will cause Brew to use the most up-to-date uninstall stanza, instead of the one that was present when the installed version was installed.Silicon Mac
rm -rfi /opt/homebrew/Caskroom/blackhole-2ch/Intel Mac
rm -rfi /usr/local/Caskroom/blackhole-2ch/Then reinstall
brew reinstall blackhole-2ch
finally! this one worked. thanks!
instead of this fix i had issues with I did something else:
-
Go into recovery mode (on M1 Mac shut it down, then start using the touch ID sensor, but hold it until you see "hold to boot into recovery mode" and release when you see "Booting into recovery mode", then log in your user, and open the terminal (utilities > terminal) from the menu bar
-
disable system integrity protection (SIP):
csrutil disableandreboot -
uninstall background music:
brew uninstall background-music. it should work this time. and shut down the mac again completely -
enable SIP again, follow the above steps, when in SIP terminal:
csrutil enableandreboot
profit
I uninstalled the old version by manually modified
/opt/homebrew/Caskroom/blackhole-2ch/.metadata/0.5.0/20231116152617.059/Casks/blackhole-2ch.rbat line 18-23 fromsystem_command "/bin/launchctl", args: [ "kickstart", "-kp", "system/com.apple.audio.coreaudiod", ],to
system_command "/usr/bin/killall", args: [ "coreaudiod", ],
bakcground-musichad exactly the same issue, this file can be modified to fix it.sudo nano /opt/homebrew/Caskroom/background-music/.metadata/0.4.0/20231225152717.155/Casks/background-music.rbModifying
background-musicand then runningbrew uninstall background-musicto invoke killall didn't work for me. Any advice @dobladov ?â–¶ brew uninstall background-music ==> Uninstalling Cask background-music ==> Removing launchctl service com.bearisdriving.BGM.XPCHelper Password: ==> Uninstalling packages with sudo; the password may be necessary: ==> Removing files: /Library/Application Support/Background Music /Library/Audio/Plug-Ins/HAL/Background Music Device.driver /usr/local/libexec/BGMXPCHelper.xpc sudo: usr/bin/killall: command not found Error: Failure while executing; `/usr/bin/sudo -E -- usr/bin/killall coreaudiod` exited with 1. Here's the output: sudo: usr/bin/killall: command not found