AutoGPT: browse_website is broken on Apple M1 & M1 Max due to chromedriver mismatch
⚠️ Search for existing issues first ⚠️
- I have searched the existing issues, and there is no existing issue for my problem
Which Operating System are you using?
MacOS
GPT-3 or GPT-4?
GPT-4
Steps to reproduce 🕹
Let the GPT execute a browse_website
command
Current behavior 😯
Browsing fails because Selenium can’t find an appropriate chromedriver for Apple M1 arch. It tries to download chromedriver_mac64_m1.zip
, while only chromedriver_mac64.zip
exists (see repo).
EDIT: apparently a similar issue occurs on Apple M1 Max which should use mac_arm64
arch.
Your Logs 📒
====== WebDriver manager ======
Current google-chrome version is 112.0.5615
Get LATEST chromedriver version for 112.0.5615 google-chrome
There is no [mac64_m1] chromedriver for browser 112.0.5615 in cache
Trying to download new driver from https://chromedriver.storage.googleapis.com/112.0.5615.49/chromedriver_mac64_m1.zip
SYSTEM: Command browse_website returned: Error: There is no such driver by url https://chromedriver.storage.googleapis.com/112.0.5615.49/chromedriver_mac64_m1.zip
THOUGHTS: It seems like we need to use a web driver to browse the website. I think we should use Selenium to automate the browsing process and extract the information we need.
REASONING: Selenium is a powerful tool for automating web browsing and can be used to extract information from websites. By using Selenium, we can automate the browsing process and extract the information we need without having to manually navigate the website.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 5
- Comments: 40 (4 by maintainers)
Joining late to the party.
I had the same issue and this is what I did that solved the issue for me in my M1
driver = webdriver.Chrome( executable_path="/usr/bin/chromedriver", options=options )
it seems that the original line that installs the chrome driver is installing a wrong version while the version installed i the docker file is the proper one because:
Hope this helps others.
I have been hitting a very similar issue, albeit a different error code and @Pwuts suggested I add my logs to this Issue thread:
I am running AutoGPT within a Docker container in continuous mode and everything works great until it tries to access a website and I receive the following error:
This results in a near-iterative loop as it works through the array of websites it initially finds in the Google API search. I am on a MacBook Pro with an M1 Max chip and I have configured my Docker container to use Pinecone, Google, Hugging Face, and my OpenAI GPT-4 API Key but the issue seems to be solely related to the browse_website function. I have tested on master, stable, and some other branches that claimed to solve similar issues to no avail.
It sounds like another user has ran into the same issue and we are pretty certain it is due to the Mac M1 architecture but we are unclear on how to work around. Any help would be much appreciated!
Editing
web_selenium.py
fixed my issue with the browse_website command without doing anything else! (Mac M1 Max; using Dockerfile to run in a container)This is the complete function I’m using in case it’s easier to copy and paste:
Thank you so much for the fix!
Just tried it, and it works! Even when Rosetta emulation is disabled in Docker.
Have a stable branch, just changed one line in web_selenium.py So the problem is with webdriver-manager setup, link to repo.
This could be a solution, detect the platform, then use this setup (from README.md of webdriver_manager repo):
This didn’t resolve the issue for me. It produces a new error instead. Is this the only change you made?
Even if you try all suggested solutions to get it working on the latest release
v0.2.2
on Docker & Mac M1, you will still get:There are two main issues:
chromedriver
path in the docker container directly in thescrape_text_with_selenium
function, i.e.you can verify this is the docker container path for
chromedriver
by doing the following:and then once in the container
not
linux/amd64
as others have suggested. mac m1 is arm not amdDoing both of the changes above fixed it
You are using /usr/local/bin/chromedriver, but you need to use /usr/bin/chromedriver because that is the location of the chromedriver installed in the Dockerfile definition.
Just tried the latest stable, and here are results from my M1:
Status code was: 255
when enabled Dockers Rosetta for x86/amd64 emulation on Apple Silicon:
Status code was: -5
hey I’m a noob feeling concerned about that here on a M1 max chip I get
Command browse_website returned: Error: Message: unknown error: cannot find Chrome binary Stacktrace: 0 chromedriver 0x0000000105409670 chromedriver + 4298352 1 chromedriver 0x0000000105401bbc chromedriver + 4266940 2 chromedriver 0x0000000105034758 chromedriver + 280408 3 chromedriver 0x0000000105059e40 chromedriver + 433728 4 chromedriver 0x0000000105058308 chromedriver + 426760 5 chromedriver 0x0000000105098994 chromedriver + 690580 6 chromedriver 0x0000000105098114 chromedriver + 688404 7 chromedriver 0x00000001050622d0 chromedriver + 467664 8 chromedriver 0x0000000105063354 chromedriver + 471892 9 chromedriver 0x00000001053c96c4 chromedriver + 4036292 10 chromedriver 0x00000001053cdc64 chromedriver + 4054116 11 chromedriver 0x00000001053d42d8 chromedriver + 4080344 12 chromedriver 0x00000001053ce970 chromedriver + 4057456 13 chromedriver 0x00000001053a58dc chromedriver + 3889372 14 chromedriver 0x00000001053ed25c chromedriver + 4182620 15 chromedriver 0x00000001053ed3b4 chromedriver + 4182964 16 chromedriver 0x00000001053fc0f4 chromedriver + 4243700 17 libsystem_pthread.dylib 0x00000001a99de06c _pthread_start + 148 18 libsystem_pthread.dylib 0x00000001a99d8e2c thread_start + 8
So i’m subscribing to this issue
I tried this on my Macbook Pro M1 Pro but get this
@Pwuts
Tried within devcontainer but failed as follows: