openclaw - ✅(Solved) Fix Browser tool consistently times out - unable to start browser sessions [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#43654Fetched 2026-04-08 00:16:18
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
cross-referenced ×2commented ×1

Error Message

Error message:

Fix Action

Fix / Workaround

Impact

  • Complete loss of browser automation functionality
  • No workaround available for web scraping/automation tasks
  • Affects any workflow requiring web interaction

PR fix notes

PR #46505: fix: distinguish transient from persistent browser fetch errors

Description (problem / solution / changelog)

Summary

The browser tool's error handler (enhanceBrowserFetchError) treats all failures identically — appending "Do NOT retry the browser tool — it will keep failing" to every error, including transient ones like timeouts and aborts. This causes the model to permanently abandon the browser tool for the rest of a conversation on what might be a momentary blip.

Problem

enhanceBrowserFetchError has two issues:

  1. Abort and timeout are conflated. Both match the same looksLikeTimeout check (which includes "aborted", "abort", "aborterror"). A user-initiated cancellation produces a "timed out" message — misleading and wrong.

  2. The no-retry model hint is applied to all errors. Timeouts are often transient (gateway starting up, momentary load spike). Aborts are deliberately triggered by the caller. Neither should tell the model to permanently give up on the browser tool.

Solution

Separate the three error categories with appropriate messaging:

Error typeTransient?MessageNo-retry hint?
TimeoutUsually yes"Can't reach the OpenClaw browser control service (timed out after {N}ms). {operator hint}"No
Abort/cancelYes"Browser control service request was cancelled."No
Network error (ECONNREFUSED, etc.)Usually no"Can't reach the OpenClaw browser control service. {operator hint} ({msg})"Yes

Rate limit errors (429) are unchanged — they already have appropriate messaging via BrowserServiceError.

Dispatcher-path errors (enhanceDispatcherPathError) are unchanged — they retain the no-retry hint for persistent failures like "browser control disabled".

Related issues

Partially improves (does not fully fix):

  • #40793 — Removes the "Do NOT retry" hint from timeout errors, so the model won't permanently abandon the browser after a transient timeout. The "Restart the gateway" operator hint is still present, which is a separate concern.
  • #38844 — When a Playwright-level stall inside a route handler triggers the outer fetchBrowserJson timeout, the model will no longer be told to give up permanently on the browser tool.

Changed files

  • src/browser/client-fetch.ts — Split looksLikeTimeout into separate timeout and abort checks; only apply no-retry hint to persistent network errors
  • src/browser/client.test.ts — Update test for abort/timeout distinction; add test verifying timeouts don't include no-retry hint

Testing

  • All existing browser tests pass
  • New test verifies abort produces "cancelled" (not "timed out")
  • New test verifies timeouts do not include the "Do NOT retry" hint
  • Connection errors (ECONNREFUSED) still include the hint — verified by existing wraps connection failures with a sandbox hint test

Changed files

  • src/browser/client-fetch.ts (modified, +13/-9)
  • src/browser/client.test.ts (modified, +7/-1)

Code Example

timed out. Restart the OpenClaw gateway (OpenClaw.app menubar, or `openclaw gateway`). Do NOT retry the browser tool — it will keep failing. Use an alternative approach or inform the user that the browser is currently unavailable.

---

{
  "enabled": true,
  "profile": "openclaw",
  "running": false,
  "cdpReady": false,
  "cdpHttp": false,
  "pid": null,
  "cdpPort": 18800,
  "cdpUrl": "http://127.0.0.1:18800",
  "detectedBrowser": "chromium",
  "detectedExecutablePath": "/usr/bin/chromium-browser",
  "headless": false,
  "noSandbox": true
}
RAW_BUFFERClick to expand / collapse

Bug Description

The browser tool consistently times out when attempting to start browser sessions, making it completely unusable.

Environment

  • OpenClaw: 2026.3.8 (3caab92)
  • OS: Ubuntu 24.04.4 LTS (ARM64)
  • Node: v22.22.0
  • Platform: AWS EC2 (Graviton 3)

Reproduction Steps

  1. Call browser(action="start")
  2. Tool times out consistently

Expected Behavior

Browser should start successfully and be ready for automation

Actual Behavior

Error message:

timed out. Restart the OpenClaw gateway (OpenClaw.app menubar, or `openclaw gateway`). Do NOT retry the browser tool — it will keep failing. Use an alternative approach or inform the user that the browser is currently unavailable.

Browser Status

{
  "enabled": true,
  "profile": "openclaw",
  "running": false,
  "cdpReady": false,
  "cdpHttp": false,
  "pid": null,
  "cdpPort": 18800,
  "cdpUrl": "http://127.0.0.1:18800",
  "detectedBrowser": "chromium",
  "detectedExecutablePath": "/usr/bin/chromium-browser",
  "headless": false,
  "noSandbox": true
}

Additional Context

  • Gateway is running normally (pid 46906)
  • Chromium browser is detected and available at /usr/bin/chromium-browser
  • CDP port 18800 configured but not accessible
  • noSandbox: true due to container environment
  • Issue persists after gateway restarts

Impact

  • Complete loss of browser automation functionality
  • No workaround available for web scraping/automation tasks
  • Affects any workflow requiring web interaction

System Resources

  • RAM: 7.6GB total
  • CPU: 4-core ARM Graviton 3
  • Disk: 58GB available
  • No resource constraints observed during failure

extent analysis

Fix Plan

The fix involves adjusting the Chromium browser launch configuration to ensure it can bind to the specified CDP port and properly handle the noSandbox mode.

Step-by-Step Solution

  1. Verify CDP Port Availability: Ensure that port 18800 is not in use by another process. You can use netstat -tlnp | grep 18800 to check.
  2. Adjust Chromium Launch Flags: Modify the launch flags for Chromium to include --remote-debugging-port=18800 and --no-sandbox. This ensures Chromium binds to the correct port and operates without sandbox restrictions.
  3. Implement Fix in Code: Update the browser launch code to include these flags. For example, if you're using Node.js and the puppeteer library, your launch code might look like this:
const puppeteer = require('puppeteer');

// Launch Chromium with specified flags
const browser = await puppeteer.launch({
  executablePath: '/usr/bin/chromium-browser',
  args: [
    '--remote-debugging-port=18800',
    '--no-sandbox',
    '--headless=false' // Adjust based on your headless preference
  ]
});
  1. Test the Fix: After applying these changes, attempt to start a browser session using the updated configuration to verify that the issue is resolved.

Verification

To verify that the fix worked, successfully start a browser session and confirm that the CDP port (18800) is accessible and that the browser is ready for automation tasks.

Extra Tips

  • Ensure that your system's firewall settings allow traffic on the specified CDP port.
  • If issues persist, consider logging the Chromium browser's output to diagnose any underlying problems it might be encountering.
  • Regularly review and update your dependencies (like puppeteer) to ensure you have the latest fixes and features.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING