Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update(blackhole-2ch): kickstart "com.apple.audio.coreaudiod" Operation not permitted #171570

Open
6 tasks done
emindeniz99 opened this issue Apr 17, 2024 · 14 comments
Open
6 tasks done

Comments

@emindeniz99
Copy link

emindeniz99 commented Apr 17, 2024

Verification

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

kyleneideck/BackgroundMusic#727 (comment)

@klaushardt
Copy link
Contributor

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

@krehel
Copy link
Member

krehel commented Apr 17, 2024

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

@emindeniz99
Copy link
Author

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?

@bevanjkay
Copy link
Member

@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.

@kyan001
Copy link

kyan001 commented Apr 18, 2024

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",
                   ],

@JavierCane
Copy link

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

@iambenmitchell

This comment has been minimized.

@bevanjkay
Copy link
Member

bevanjkay commented Apr 19, 2024

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

@BrentSqAR

This comment has been minimized.

@Constantin1489

This comment was marked as resolved.

@devinroth
Copy link
Contributor

Linking to the relevant issue on the BlackHole repo.

ExistentialAudio/BlackHole#779

@pattespatte
Copy link

pattespatte commented Apr 25, 2024

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

@dobladov
Copy link

dobladov commented Apr 29, 2024

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",
                   ],

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

@elvinos
Copy link

elvinos commented May 2, 2024

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

The worked for me if you dont include the "i" in rfi i.e.: rm -rf /opt/homebrew/Caskroom/blackhole-2ch/

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests