macOS TCC: uncaught PermissionError on DevToolsActivePort kills the daemon before the Chrome 147+ fallback

Author: MythicSorcererCreated Sep 29, 2026Updated Sep 29, 2026
Labelsbug

Before submitting

  • I searched existing issues for duplicates.
  • I ran browser-harness --doctor and 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.com issue.

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 — 0

Root cause

daemon.py:296:

python
for base in PROFILES:
    try:
        active = (base / "DevToolsActivePort").read_text(encoding="utf-8", errors="replace").splitlines()
    except (FileNotFoundError, NotADirectoryError):
        continue

macOS 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 permitted

Granting 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:

python
    except OSError:
        continue

FileNotFoundError 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

  1. uv tool install --python 3.12 browser-harness
  2. Run the CLI without Full Disk Access for the parent app
  3. Enable chrome://inspect/#remote-debugging in Chrome
  4. Run browser-harness --doctor, or browser-harness <<'PY' / print(page_info()) / PY
  5. 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

  1. Install: uv tool install --python 3.12 browser-harness (0.1.13).

  2. Run the CLI from an app that does not have Full Disk Access (Accessibility alone is not enough).

  3. In Chrome, open chrome://inspect/#remote-debugging and tick "Allow remote debugging for this browser instance".

  4. Run:

    browser-harness <<'PY'
    print(page_info())
    PY
  5. Observe:

    browser-harness: daemon default didn't come up -- check ~/.config/browser-harness/tmp/bu-default.log
  6. In that log:

    fatal: [Errno 1] Operation not permitted: '/Users/<user>/Library/Application Support/Google/Chrome/DevToolsActivePort'
  7. browser-harness --doctor reports [FAIL] daemon alive and [FAIL] active browser connections — 0.

  8. browser-harness mac-approve reports setup-required even though remote debugging is already enabled, because the readiness check hits the same PermissionError.

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 login

Note 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 permitted

Source: browser-use/browser-harness