Skip to content

fix(brew): add a launchd-domain hint to friendlify - #51

Merged
msitarzewski merged 1 commit into
msitarzewski:mainfrom
Kartalops:fix/friendlify-launchd-domain-hint
Jun 7, 2026
Merged

msitarzewski merged 1 commit into
msitarzewski:mainfrom
Kartalops:fix/friendlify-launchd-domain-hint

Conversation

@Kartalops

Copy link
Copy Markdown
Contributor

fix(brew): add a launchd-domain hint to friendlify

brew services start|stop|restart on 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
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

`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
@msitarzewski
msitarzewski merged commit 0be65f3 into msitarzewski:main Jun 7, 2026
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

Successfully merging this pull request may close these issues.

2 participants