macOS TCC: uncaught PermissionError on DevToolsActivePort kills the daemon before the Chrome 147+ fallback
Before submitting
- I searched existing issues for duplicates.
- I ran
browser-harness --doctorand read the output. - I read the troubleshooting section of
install.md. - This is a reproducible bug in browser-harness — not a question, feature request, or
cloud.browser-use.comissue.
Summary
Summary
On macOS, when the process launching browser-harness lacks Full Disk Access, get_ws_url() raises an uncaught PermissionError and the daemon exits. The Chrome 147+ fallback in the same function is never reached, so the fixes in #264 / #291 cannot help affected users.
Reproduced on browser-harness 0.1.13 (latest release), macOS Darwin 27.0.0, arm64, Python 3.12.13.
Error
fatal: [Errno 1] Operation not permitted: '/Users/<user>/Library/Application Support/Google/Chrome/DevToolsActivePort'browser-harness --doctor then reports:
[FAIL] daemon alive — see install.md
[FAIL] active browser connections — 0Root cause
daemon.py:296:
for base in PROFILES:
try:
active = (base / "DevToolsActivePort").read_text(encoding="utf-8", errors="replace").splitlines()
except (FileNotFoundError, NotADirectoryError):
continuemacOS TCC returns PermissionError (errno 1, EPERM), not FileNotFoundError. That exception escapes get_ws_url() and terminates the daemon, so control never reaches the 9222 / 9223 probe loop at daemon.py:331.
The same pattern also exists at daemon.py:254 in _ws_from_devtools_active_port().
This is not a POSIX permission problem: the file is mode 644, owned by the user, with no ACL. The entire ~/Library/Application Support/Google/Chrome/ directory is unreadable without Full Disk Access.
$ ls ~/Library/Application\ Support/Google/Chrome/
ls: .../Google/Chrome/: Operation not permittedGranting Accessibility permission does not help — that is a separate TCC service. Only Full Disk Access covers this path. install.md currently documents Accessibility only, so the documented remedy does not resolve this failure.
Suggested fix
Widen the except clause at both daemon.py:296 and daemon.py:254:
except OSError:
continueFileNotFoundError and NotADirectoryError are both subclasses of OSError, so this is behavior-preserving for the existing cases. It lets the 9222 / 9223 fallback probes and the remote_debugging_user_enabled() diagnostic at daemon.py:340 run as intended, and surfaces the real diagnosis instead of a bare traceback.
Reproduction
uv tool install --python 3.12 browser-harness- Run the CLI without Full Disk Access for the parent app
- Enable
chrome://inspect/#remote-debuggingin Chrome - Run
browser-harness --doctor, orbrowser-harness <<'PY' / print(page_info()) / PY - Inspect
${XDG_CONFIG_HOME:-~/.config}/browser-harness/tmp/bu-default.log
In this state browser-harness mac-approve also reports setup-required even though remote debugging is already enabled — the underlying PermissionError makes the readiness check fail and the message is misleading.
With Full Disk Access granted to the parent app, the same command connects successfully on the first attempt with no code changes.
Repro
Install:
uv tool install --python 3.12 browser-harness(0.1.13).Run the CLI from an app that does not have Full Disk Access (Accessibility alone is not enough).
In Chrome, open
chrome://inspect/#remote-debuggingand tick "Allow remote debugging for this browser instance".Run:
browser-harness <<'PY' print(page_info()) PYObserve:
browser-harness: daemon default didn't come up -- check ~/.config/browser-harness/tmp/bu-default.logIn that log:
fatal: [Errno 1] Operation not permitted: '/Users/<user>/Library/Application Support/Google/Chrome/DevToolsActivePort'browser-harness --doctorreports[FAIL] daemon aliveand[FAIL] active browser connections — 0.browser-harness mac-approvereportssetup-requiredeven though remote debugging is already enabled, because the readiness check hits the samePermissionError.
Control: grant Full Disk Access to the parent app and restart it. The same command then connects on the first attempt, with no code changes.
Environment
OS: macOS Darwin 27.0.0, arm64 (macOS 27) Chrome: 152.0.7977.54 (stable, default profile, remote debugging enabled at 127.0.0.1:9222) browser-harness --version: 0.1.13 python: 3.12.13
browser-harness --doctor while the bug is active:
browser-harness doctor
platform Darwin 27.0.0
python 3.12.13
version 0.1.13 (pypi)
latest release 0.1.13
[ok ] chrome running
[FAIL] daemon alive — see install.md
[FAIL] active browser connections — 0
[FAIL] Browser Use cloud auth — optional: browser-harness auth loginNote the file itself is not the problem: it is mode 644, owned by the user, with no ACL. The whole ~/Library/Application Support/Google/Chrome/ directory is unreadable:
$ ls ~/Library/Application\ Support/Google/Chrome/
ls: .../Google/Chrome/: Operation not permittedSource: browser-use/browser-harness