Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Message: unknown error: cannot find Chrome binary #1517

Closed
1 task done
vanillechai opened this issue Apr 15, 2023 · 11 comments
Closed
1 task done

Error: Message: unknown error: cannot find Chrome binary #1517

vanillechai opened this issue Apr 15, 2023 · 11 comments
Labels
bug Something isn't working function: browse

Comments

@vanillechai
Copy link

vanillechai commented Apr 15, 2023

Duplicates

  • I have searched the existing issues

Steps to reproduce 🕹

This happens with any AI settings: As soon as the first browse_website command is executed, Auto-GPT fails with this error.

Branch: master
commit-hash: e986af5

also happens on:
Branch: stable
commit-hash: 60b2b61

Current behavior 😯

  System: Command browse_website returned: Error: Message: unknown error: cannot find Chrome binary
Stacktrace:
0   chromedriver                        0x00000001027bd670 chromedriver + 4298352
1   chromedriver                        0x00000001027b5bbc chromedriver + 4266940
2   chromedriver                        0x00000001023e8758 chromedriver + 280408
3   chromedriver                        0x000000010240de40 chromedriver + 433728
4   chromedriver                        0x000000010240c308 chromedriver + 426760
5   chromedriver                        0x000000010244c994 chromedriver + 690580
6   chromedriver                        0x000000010244c114 chromedriver + 688404
7   chromedriver                        0x00000001024162d0 chromedriver + 467664
8   chromedriver                        0x0000000102417354 chromedriver + 471892
9   chromedriver                        0x000000010277d6c4 chromedriver + 4036292
10  chromedriver                        0x0000000102781c64 chromedriver + 4054116
11  chromedriver                        0x00000001027882d8 chromedriver + 4080344
12  chromedriver                        0x0000000102782970 chromedriver + 4057456
13  chromedriver                        0x00000001027598dc chromedriver + 3889372
14  chromedriver                        0x00000001027a125c chromedriver + 4182620
15  chromedriver                        0x00000001027a13b4 chromedriver + 4182964
16  chromedriver                        0x00000001027b00f4 chromedriver + 4243700
17  libsystem_pthread.dylib             0x0000000188e13fa8 _pthread_start + 148
18  libsystem_pthread.dylib             0x0000000188e0eda0 thread_start + 8

After this, Auto-GPT reasons I will try to find an alternative to Chrome and use the \'google\' command to find other open source software that meets the requirements., re-encounter the error and goes into a loop.

Expected behavior 🤔

  • It used to work until I git pulled this morning.
  • There is no point in installing the Chrome binary, as Auto-GPT is running on a headless machine and I am connected via ssh.

Your prompt 📝

This error is independent of the prompt.

@AlizerUncaged
Copy link

you need to install chrome on the default paths, works for me

@vanillechai
Copy link
Author

you need to install chrome on the default paths, works for me

How can you do that on a headless machine? How would Chrome run from Docker or docker-compose?

@mezzovide
Copy link

mezzovide commented Apr 15, 2023

#1520 this would add support for headless

@ricktonoli
Copy link

FYI, got around this by adding --headless as per above, but also had to add an option for --no-sandbox, making sure the --no-sandbox is the first option, as per https://stackoverflow.com/questions/53073411/selenium-webdriverexceptionchrome-failed-to-start-crashed-as-google-chrome-is

This seemed to do the trick.

@tuapuikia
Copy link

You can refer to my single docker image dockerfile. It come with redis server and redisearch module.

https://github.com/tuapuikia/Auto-GPT/blob/master/Dockerfile-s6

https://github.com/tuapuikia/Auto-GPT/blob/44739518ee4f9c27cc4596eb14587bdbfd68e842/Dockerfile-s6#L20

RUN apt update && apt -y install vim redis-server chromium-driver chromium && \

@gabrielrbarbosa
Copy link
Contributor

I had it working using:

selenium.version
'4.8.3'

chrome-driver and google-chrome-stable 109

web.py

options.binary_location=r'/usr/bin/google-chrome-stable'
driver = webdriver.Chrome(
    executable_path='/home/gabriel/Auto-GPT/chromedriver', options=options
)

@xpose2000
Copy link

I managed to fix it by modifying web.py and adding the following under user agent option... Be sure to download chromedriver here:. https://chromedriver.chromium.org/downloads.

    options.add_argument("--headless=new")
    options.add_argument("--no-sandbox")
    options.add_argument("--ignore-ssl-errors=true")
    options.add_argument("--ignore-certificate-errors")    
    
    options.binary_location="C:/Program Files/Google/Chrome Beta/Application/chrome.exe"
    driver = webdriver.Chrome('C:/PATH_TO/chromedriver_win32/chromedriver.exe',options=options)

I still get SSL handshake errors on occasion, not sure which argument needs to be added to ignore those.

@dasoumao
Copy link

install chromium-chromedriver on a headless machine, note you should have systemd to use snap. For wsl user, try this https://stackoverflow.com/questions/62588767/running-google-chrome-on-wsl-ubuntu-as-headless-no-sandbox-gives-multiple

@primaryobjects
Copy link
Contributor

primaryobjects commented Apr 18, 2023

The following worked for me on Windows 10 in Ubuntu WSL. Edit web_selenium.py here:

options.binary_location="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"

driver = webdriver.Chrome(
    executable_path="/mnt/c/Users/your_user_name/Auto-GPT/chromedriver", options=options
)

  • You can find the path to chrome.exe by right-clicking the Chrome icon on your desktop, select Properties, copy the path to the executable from Target.
  • Download chromedriver.exe and save it to a path as set for executable_path above.

It would be great if the file path to chromedriver.exe and chrome.exe could be configurable in the .env file.

@Stausifr
Copy link

I managed to fix it by modifying web.py and adding the following under user agent option... Be sure to download chromedriver here:. https://chromedriver.chromium.org/downloads.

    options.add_argument("--headless=new")
    options.add_argument("--no-sandbox")
    options.add_argument("--ignore-ssl-errors=true")
    options.add_argument("--ignore-certificate-errors")    
    
    options.binary_location="C:/Program Files/Google/Chrome Beta/Application/chrome.exe"
    driver = webdriver.Chrome('C:/PATH_TO/chromedriver_win32/chromedriver.exe',options=options)

I still get SSL handshake errors on occasion, not sure which argument needs to be added to ignore those.

Does it work on Mac? I mean if download chrome driver for ma and reference the path

@Pwuts
Copy link
Member

Pwuts commented Apr 19, 2023

Please check if this is resolved with #1473. If this issue still exists in master for you, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working function: browse
Projects
None yet
Development

No branches or pull requests