Skip to content

Edge 156: daemon reports "DevToolsActivePort not found" when the file exists but the port is dead - caused by --remote-debugging-port on the default profile #977

Open

Description

@FahadBinHussain

Summary

The daemon's final error says DevToolsActivePort not found, but the file is there and the chrome://inspect/#remote-debugging toggle is already on. The file just points at a port nothing is listening on. The message and the suggested fix send you to tick a checkbox that is already ticked.

Trigger: the browser was started with --remote-debugging-port=9222 on the default profile. Edge 156 (chromium 136+ lockdown, same IsUsingDefaultDataDirectory() check as #264) then opens no devtools endpoint at all — the requested port never binds and the toggle path does not come up either — so the DevToolsActivePort file on disk is stale from the previous run.

Not a duplicate of #264 / #291 / #894

What I see

fatal: DevToolsActivePort not found in ['C:\Users\<user>\AppData\Local\Google\Chrome\User Data',
'C:\Users\<user>\AppData\Local\Google\Chrome SxS\User Data', ...,
'C:\Users\<user>\AppData\Local\Microsoft\Edge\User Data', ...] — enable
chrome://inspect/#remote-debugging, or set BU_CDP_WS for a remote browser

but the state is actually:

  • %LOCALAPPDATA%\Microsoft\Edge\User Data\DevToolsActivePort exists — port 64302, /devtools/browser/<uuid> on line 2
  • %LOCALAPPDATA%\Microsoft\Edge\User Data\Local State → devtools.remote_debugging.user-enabled = true
  • nothing is listening on 64302, or on any other port
  • the DevToolsActivePort mtime is older than the browser process start time — leftover from the previous run, the new browser never wrote it

so the real message is "found, but dead", not "not found".

Repro

  1. edge 156, default profile, edge://inspect/#remote-debugging → tick "allow remote debugging for this browser instance"
  2. quit edge completely
  3. relaunch edge with --profile-directory=Default --remote-debugging-port=9222
  4. run browser-use

Cross-checks that may help

  • the same command without the flag works: edge writes a dynamic port to DevToolsActivePort and list_tabs() returns the live tabs
  • --remote-debugging-port does work on a non-default profile — --headless=new --user-data-dir=<scratch> --remote-debugging-port=9333 binds 9333 and /json/version answers normally, so this is specific to the default profile
  • the port the harness picks up changes on every browser start, so 9222 is usually closed even while everything is working — that part is expected
  • the flag is not a broken process singleton. Launching the same command while edge is already running gives exit code 0, empty stderr and no second instance — identical to the same launch without the flag

Suggested changes

  • tell "no DevToolsActivePort file" apart from "file present but port not listening", and include the port and the file mtime in the error
  • when a supported browser is running and the toggle is on but no port is live, say the endpoint is not reachable and name the likely cause — a browser started with --remote-debugging-port on the default profile ends up with no endpoint at all on chromium/edge 136+. install.md currently lists three possible reasons for daemon alive FAIL and the actionable one is not among them; the recovery it points at ("tick the checkbox") is already done in this case
  • --doctor reports chrome running [ok] + daemon alive [FAIL], which is the only hint that anything is wrong
  • the recovery text says "start Chrome" and points at chrome://inspect/#remote-debugging — on windows the browser here was edge, and edge://inspect/#remote-debugging is the matching page (see also fix: _open_chrome_inspect() fails on Windows — webbrowser.open() can't handle chrome:// protocol #290 for the windows chrome:// handling)

Environment

OS:                  Windows 11 x64
browser version:     edge 156.0.4314.58
browser-harness:     0.1.13 (pypi)
python:              3.11.15

browser-harness doctor
  platform          Windows 10
  python            3.11.15
  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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions