web-ui icon indicating copy to clipboard operation
web-ui copied to clipboard

Own chrome browser not running

Open William-67 opened this issue 9 months ago • 20 comments

I try using my own browser, I set this up in my .env file:

CHROME_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe" CHROME_USER_DATA="C:\Users\YourUsername\AppData\Local\Google\Chrome\User Data"

It open my chrome, but after then not running task at all, and no error occurred, just stuck in there.

I assume it may be due to multiple profile I have so I deleted all others but with main profile, but it still not working.

William-67 avatar Feb 15 '25 19:02 William-67

me too!

shaowin16 avatar Feb 16 '25 08:02 shaowin16

Set CHROME_USER_DATA empty, try again

warmshao avatar Feb 16 '25 08:02 warmshao

Set CHROME_USER_DATA empty, try again

Now CHROME_USER_DATA is empty, an error occurs after running:

[src.browser.custom_browser] Failed to start a new Chrome instance.: BrowserType.connect_over_cdp: connect ECONNREFUSED ::1:9222
Call log:
  - <ws preparing> retrieving websocket url from http://localhost:9222

ERROR    [browser] Failed to initialize Playwright browser:  To start chrome in Debug mode, you need to close all existing Chrome instances and try again otherwise we can not connect to the instance.
WARNING  [src.agent.custom_agent] No history to create GIF from

and Chrome is closed.

shaowin16 avatar Feb 16 '25 09:02 shaowin16

Not working as well, the chrome do nothing and about a minute later it open the default one without my data and credentials.

William-67 avatar Feb 16 '25 20:02 William-67

Not working as well, it open my browser and not processing, then after a minute it open the default one and do the task, the one without my data

William-67 avatar Feb 16 '25 20:02 William-67

Check if there is a process occupying port 9222. If you are using Windows, enter the following command in the terminal: netstat -aon|findstr 9222. Then, run taskkill /f /pid {pid of 9222}.

warmshao avatar Feb 17 '25 00:02 warmshao

For me using own browser was working yesterday and today morning perfectly. But suddenly this error started to appear:

INFO     [src.agent.custom_agent] 
📍 Step 1
ERROR    [browser] Failed to update state: Page.screenshot: Protocol error (Page.captureScreenshot): Cannot take screenshot with 0 width.
Call log:
  - taking page screenshot
  -     - disabled all CSS animations
  -   - waiting for fonts to load...
  -   - fonts loaded

ERROR    [agent] ❌ Result failed 3/3 times:
 Page.screenshot: Protocol error (Page.captureScreenshot): Cannot take screenshot with 0 width.
Call log:
  - taking page screenshot
  -     - disabled all CSS animations
  -   - waiting for fonts to load...
  -   - fonts loaded

ERROR    [agent] ❌ Stopping due to 3 consecutive failures
WARNING  [src.agent.custom_agent] No history to create GIF from

I tried to install project again but it's still occurring. Chrome opens up but nothing else happens.

imlastrebor avatar Feb 17 '25 11:02 imlastrebor

I have a same error, last week works fine, but today not working:

INFO [browser_use] BrowserUse logging setup complete with level info INFO [root] Anonymized telemetry enabled. See https://github.com/browser-use/browser-use for more information. INFO [agent] 🚀 Starting task: Search for Tour Agencies INFO [agent] 📍 Step 1 ERROR [browser] Failed to start a new Chrome instance.: BrowserType.connect_over_cdp: connect ECONNREFUSED ::1:9222 Call log:

  • retrieving websocket url from http://localhost:9222

WARNING [browser] Page load failed, continuing... ERROR [browser] Failed to start a new Chrome instance.: BrowserType.connect_over_cdp: connect ECONNREFUSED ::1:9222 Call log:

  • retrieving websocket url from http://localhost:9222

ERROR [agent] ❌ Result failed 1/3 times: To start chrome in Debug mode, you need to close all existing Chrome instances and try again otherwise we can not connect to the instance. INFO [agent]

alexisCode50 avatar Feb 17 '25 17:02 alexisCode50

Did anyone find the solution for this issue?

faizan-official avatar Feb 19 '25 12:02 faizan-official

In case it helps anyone (in windows), I created a .bat file, like so: @echo off "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 16" %*

And then set my path to CHROME_PATH=C:\Users\user\web-ui\my-chrome.bat

This way I'm able to have it load the exact profile I want to load.

atlasgp1 avatar Feb 19 '25 12:02 atlasgp1

In case it helps anyone (in windows), I created a .bat file, like so: @echo off "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 16" %*

And then set my path to CHROME_PATH=C:\Users\user\web-ui\my-chrome.bat

This way I'm able to have it load the exact profile I want to load.

is the profile 16fixed or actually a variable

fyq163 avatar Mar 03 '25 10:03 fyq163

For me using own browser was working yesterday and today morning perfectly. But suddenly this error started to appear:

INFO     [src.agent.custom_agent] 
📍 Step 1
ERROR    [browser] Failed to update state: Page.screenshot: Protocol error (Page.captureScreenshot): Cannot take screenshot with 0 width.
Call log:
  - taking page screenshot
  -     - disabled all CSS animations
  -   - waiting for fonts to load...
  -   - fonts loaded

ERROR    [agent] ❌ Result failed 3/3 times:
 Page.screenshot: Protocol error (Page.captureScreenshot): Cannot take screenshot with 0 width.
Call log:
  - taking page screenshot
  -     - disabled all CSS animations
  -   - waiting for fonts to load...
  -   - fonts loaded

ERROR    [agent] ❌ Stopping due to 3 consecutive failures
WARNING  [src.agent.custom_agent] No history to create GIF from

I tried to install project again but it's still occurring. Chrome opens up but nothing else happens.

@imlastrebor have you sorted this? I seem to have the same problem

alienatedsec avatar Mar 04 '25 12:03 alienatedsec

what do i do as a linux user

ArshithGVaz avatar Mar 05 '25 09:03 ArshithGVaz

I have a same error, last week works fine, but today not working:

INFO [browser_use] BrowserUse logging setup complete with level info INFO [root] Anonymized telemetry enabled. See https://github.com/browser-use/browser-use for more information. INFO [agent] 🚀 Starting task: Search for Tour Agencies INFO [agent] 📍 Step 1 ERROR [browser] Failed to start a new Chrome instance.: BrowserType.connect_over_cdp: connect ECONNREFUSED ::1:9222 Call log:

  • retrieving websocket url from http://localhost:9222

WARNING [browser] Page load failed, continuing... ERROR [browser] Failed to start a new Chrome instance.: BrowserType.connect_over_cdp: connect ECONNREFUSED ::1:9222 Call log:

  • retrieving websocket url from http://localhost:9222

ERROR [agent] ❌ Result failed 1/3 times: To start chrome in Debug mode, you need to close all existing Chrome instances and try again otherwise we can not connect to the instance. INFO [agent]

@alexisCode50 I also encountered this problem, my application scenario is localized Ollama, the model is deepseek. I found that using vision with uncheck off worked just fine. So I guess because the model doesn't support vision, or when you use something like a model that doesn't support vision, Error will be displayed。Hope this helps you...

reddragon-nafalian avatar Mar 19 '25 10:03 reddragon-nafalian

Checking the "Use Own Browser" box in web ui is not working, no errors but when I enter my profile path in CHROME_USER_DATA, it gives following error:

ERROR [browser] Failed to initialize Playwright browser: BrowserType.launch: Pass user_data_dir parameter to 'browser_type.launch_persistent_context(user_data_dir, **kwargs)' instead of specifying '--user-data-dir' argument

I think it's something to do with deprecation stuff, I tried to tinker a bit, managed to get rid of the error but the browser launched was still not the profile I want it to load from CHROME_USER_DATA.

voidbydefault avatar Mar 26 '25 20:03 voidbydefault

I'm having this same issue. I've tried disabling vision, trying using my own browser and not using my own browser. I also tried python 3.11 and 3.13, as well as the .venv method and the docker method. All led to the same issue. I was testing this on Windows 11. I'm going to try on my linux vm to see if the issue is the same.

wolfleyb avatar Apr 08 '25 04:04 wolfleyb

I'm having this same issue. I've tried disabling vision, trying using my own browser and not using my own browser. I also tried python 3.11 and 3.13, as well as the .venv method and the docker method. All led to the same issue. I was testing this on Windows 11. I'm going to try on my linux vm to see if the issue is the same.

Same problem on Ubuntu. Both times I filled in the "CHROME_PATH" setting, but not "CHROME_USER_DATA"

wolfleyb avatar Apr 08 '25 04:04 wolfleyb

Same issue here on Windows

BrianVerbanckBDO avatar Apr 08 '25 17:04 BrianVerbanckBDO

facing same issue

sandeep-07 avatar Oct 05 '25 15:10 sandeep-07

已收到,谢谢!

shaowin16 avatar Oct 05 '25 15:10 shaowin16