AutoGPT: browse_website fails with non-headless browser
Duplicates
- I have searched the existing issues
Steps to reproduce š¹
- Clone github repository of autoGPT, latest or stable. Doesnāt matter.
- Install dev container : https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers 3, Have docker desktop up and running.
- In vscode use CTRL+SHIFT+P and search for Dev Containers: Reopen in Container.
- After the dev container is opened in VSCode and running on docker, do pip install -r requirements.txt
- Start the autgpt using the command: python -m autogpt
Current behavior šÆ
Once when it tries to browse a website with the command : browse_website and Arguments : {āurlā: <the website it wants to browse>, question: <the question it has>
it returns an error in the System message:
SYSTEM: Command browse_website returned: Error: Message: unknown error: cannot find Chrome binary Stacktrace: #0 0x55ac2df50fe3 <unknown> #1 0x55ac2dc8fd36 <unknown> #2 0x55ac2dcb6f4a <unknown> #3 0x55ac2dcb4a9b <unknown> #4 0x55ac2dcf6af7 <unknown> #5 0x55ac2dcf611f <unknown> #6 0x55ac2dced693 <unknown> #7 0x55ac2dcc003a <unknown> #8 0x55ac2dcc117e <unknown> #9 0x55ac2df12dbd <unknown> #10 0x55ac2df16c6c <unknown> #11 0x55ac2df204b0 <unknown> #12 0x55ac2df17d63 <unknown> #13 0x55ac2deeac35 <unknown> #14 0x55ac2df3b138 <unknown> #15 0x55ac2df3b2c7 <unknown> #16 0x55ac2df49093 <unknown> #17 0x7f0432fd2ea7 start_thread
Expected behavior š¤
It should be able to run the browse_website command normally and browse the website with the question.
Your prompt š
# Paste your prompt here
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 29 (4 by maintainers)
@aeiberra comments worked along with :
The error you are encountering is related to Chrome not starting correctly when using Selenium WebDriver. You can try adding a few more arguments to the options object to resolve this issue.
Update the scrape_text_with_selenium(url) function in your script as follows:
File: autogpt/web.py:
Make sure chrome is actually installed in your container, the current Dockerfile doesnāt install it for example.
looks like web.py got removed from Stable in a recent merge. This broken again and the error persists even with the commands from @darrynv
SYSTEM: Command browse_website returned: Error: Message: unknown error: Chrome failed to start: crashed. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Stacktrace: #0 0x560011b04fe3 <unknown> #1 0x560011843d36 <unknown> #2 0x56001186cb20 <unknown> #3 0x560011868a9b <unknown> #4 0x5600118aaaf7 <unknown> #5 0x5600118aa11f <unknown> #6 0x5600118a1693 <unknown> #7 0x56001187403a <unknown> #8 0x56001187517e <unknown> #9 0x560011ac6dbd <unknown> #10 0x560011acac6c <unknown> #11 0x560011ad44b0 <unknown> #12 0x560011acbd63 <unknown> #13 0x560011a9ec35 <unknown> #14 0x560011aef138 <unknown> #15 0x560011aef2c7 <unknown> #16 0x560011afd093 <unknown> #17 0x7f4d24f1dea7 start_thread
I think this is a specific problem for M1 or other ARM processor users. I assume you also have a problem with macOS. Try setting up Docker to use Rosetta for x86/amd64 emulation on Apple Silicon
For me, the Chat-GPT fixed the problem in web_selenium.py file:
I am using headless server for this.
https://github.com/Significant-Gravitas/Auto-GPT/issues/2600#issuecomment-1518220293 This solution worked for me
Editing the Auto-GPT/autogpt/commands/web_selenium.py file as follows and suggested by @darkcount2011:
Plus running the commands:
sudo apt-get update sudo apt-get install wget gnupg wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' sudo apt-get update sudo apt-get install google-chrome-stable
Posted by @darrynvSolved for me, running on Kali Linux Subsystem for windows.
PS: last commands produced the following errors:
But browse_website COMMAND works now. Thanks for the continuous support!
Modifying
web_selenium.py
with the options per @darkcount2011 and installing chrome per @darrynv has got me past the errors. Though the options are for chrome, if anyone is getting these errors with Safari or Firefox the options would need to be modified somewhere else.I added it, but it didnāt seem to fix the problem unfortunately. Maybe it has something to do with the pathing? I donāt know what the file system usually looks like in a docker container? ` options.binary_location = ā/usr/local/bin/chromedriverā also probably wrong file name but itās an example
Iām still having this problem on an M1 mac on master with docker-compose.
Iāll try again and see if it works, thanks
Editing the Auto-GPT/autogpt/commands/web_selenium.py file as follows and suggested by @darkcount2011:
Change this part of code: