fix(brew): add a launchd-domain hint to friendlify - #51
Merged
msitarzewski merged 1 commit intoJun 7, 2026
Merged
Conversation
`brew services start|stop|restart` on macOS 14+ frequently fails with
"Could not find service '<name>' in domain for current user (gui/501/...)".
The plist is registered for a different launchd domain than the one
the current user session owns, and the user sees only the raw
`BrewExitNonZero` toast with no hint that the fix is `launchctl
bootstrap` under the right domain or moving the plist to
`~/Library/LaunchAgents`.
Extend `brew::error_patterns::friendlify` with a third pattern that
matches the canonical "Could not find service" / "not found in domain"
shape on a `services` command and returns a one-sentence hint pointing
the user at the bootstrap and the LaunchAgents directory. The pattern
is gated to `command.contains("services")` so unrelated "domain"
mentions in other commands don't false-positive.
Adds three tests:
- a positive match against a representative real-shape stderr
- a non-match when the same stderr comes from `brew install` (gate check)
- a non-match on empty stderr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(brew): add a launchd-domain hint to friendlify
brew services start|stop|restarton macOS 14+ frequently fails with"Could not find service '' in domain for current user (gui/501/...)".
The plist is registered for a different launchd domain than the one
the current user session owns, and the user sees only the raw
BrewExitNonZerotoast with no hint that the fix islaunchctl bootstrapunder the right domain or moving the plist to~/Library/LaunchAgents.Extend
brew::error_patterns::friendlifywith a third pattern thatmatches the canonical "Could not find service" / "not found in domain"
shape on a
servicescommand and returns a one-sentence hint pointingthe user at the bootstrap and the LaunchAgents directory. The pattern
is gated to
command.contains("services")so unrelated "domain"mentions in other commands don't false-positive.
Adds three tests:
brew install(gate check)