AutoGPT: SYSTEM: Command browse_website returned: Error: Message: Service /home/appuser/.wdm/drivers/chromedriver/linux64/112.0.5615.49/chromedriver unexpectedly exited. Status code was: 127

Duplicates

  • I have searched the existing issues

Steps to reproduce šŸ•¹

  1. Build a dockerized version of aouto-gpt
  2. Give it any instruction that leads to it needing to browse_website

Current behavior 😯

SYSTEM: Command browse_website returned: Error: Message: Service /home/appuser/.wdm/drivers/chromedriver/linux64/112.0.5615.49/chromedriver unexpectedly exited. Status code was: 127

Expected behavior šŸ¤”

Should be bale to browse website properly

Your prompt šŸ“

# It really could be any prompt

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 29 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@p-i- I also have same issue, also using docker on an apple M2 macbook…

SYSTEM:  Command browse_website returned: Error: Message: Service /home/appuser/.wdm/drivers/chromedriver/linux64/112.0.5615.49/chromedriver unexpectedly exited. Status code was: 255

I’ve had good milage using Seleniarm (Selenium for ARM64) on M1 https://github.com/seleniumhq-community/docker-seleniarm

FROM seleniarm/standalone-chromium:latest

# Install git
USER root
RUN apt-get -y update
RUN apt-get -y install git pip

# Install Xvfb and other dependencies for headless browser testing
RUN apt-get update \
    && apt-get install -y wget gnupg2 libgtk-3-0 libdbus-glib-1-2 dbus-x11 xvfb ca-certificates

# Set environment variables
ENV PIP_NO_CACHE_DIR=yes \
    PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1

# Create a non-root user and set permissions
WORKDIR /home/seluser
RUN chown seluser:seluser /home/seluser
USER seluser

# Copy the requirements.txt file and install the requirements
COPY --chown=seluser:seluser requirements.txt .
RUN sed -i '/Items below this point will not be included in the Docker Image/,$d' requirements.txt && \
	pip install --no-cache-dir --user --break-system-packages -r requirements.txt

# Copy the application files
COPY --chown=seluser:seluser autogpt/ ./autogpt

# Set the entrypoint
ENTRYPOINT ["python3", "-m", "autogpt"]

and override the chromedriver binary path in autogpt/commands/web_selenium.py

        driver = webdriver.Chrome(
            #executable_path=ChromeDriverManager().install(), options=options
            executable_path=r'/usr/bin/chromedriver', options=options
        )

Just for the record: Same isssue here (MacBook Pro 2021 with M1, Chrome version Version 112.0.5615.137). Error msg: Command browse_website returned: Error: Message: Service /home/appuser/.wdm/drivers/chromedriver/linux64/112.0.5615.49/chromedriver unexpectedly exited. Status code was: 255

wget https://chromedriver.storage.googleapis.com/94.0.4606.41/chromedriver_linux64.zip unzip chromedriver_linux64.zip -d /path/to/directory mkdir ~/bin mv /path/to/chromedriver ~/bin export PATH=$PATH:$HOME/bin

above resolved this issue for me

Solution:

The issue occurred due to missing libraries in the Dockerfile. The solution is to add the required libraries to the Dockerfile.

RUN apt-get install -y libglib2.0 libnss3 libgconf-2-4 libfontconfig1 chromium-driver

Additionally, adding options to the Chrome webdriver also helped to resolve the issue.

options.add_argument('--no-sandbox')
options.add_argument('--window-size=1420,1080')
options.add_argument('--headless')
options.add_argument('--disable-gpu')

These changes have been made in the PR #1857 and it has been merged. Please check if the issue is resolved by updating your code with the changes in the PR.

Hi, just my two cents: I have the same problem, but with exit code 255. What is strange, is that if we go inside the running container, in /home/appuser, there is no .wdm directory , and if we try to find / -name chrome* in the container, we don’t find chromedriver. I’ve tried to install chromium in the dockerfile, but no luck. I’m still searching…

I’m running the latest stable branch with Docker on an Apple Silicon Mac.

I’m able to load simple web pages with the following changes:

  1. Added all the options mentioned above to web_selenium.py at L71 :
options.add_argument('--no-sandbox')
options.add_argument('--window-size=1420,1080')
options.add_argument('--headless')
options.add_argument('--disable-gpu')
  1. Make sure firefox is selected as the browser in .env file.

  2. This one probably is irrelevant, but I changed it at the beginning and don’t have time to test w/o it: I removed the arch specifier in the deb command when installing Chrome at L14 in Dockerfile. (Note that this doesn’t seem to help with Chrome on M1 Macs either).

I only tested with some simple static web pages. It seems to be loading fine. Not sure if firefox would crash if a website uses some fancy web features that require GPU acceleration.

This also does not work for me with the latest code on stable.

M1 MBP running in docker.

@WangPeterXF the file he’s referring to is commands/web_selenium.py

But the solution did not work for me.

Thank you, no luck for me, I have the same error then before but know, but it’s related with the Apple Silicon architecture now, SYSTEM: Command browse_website returned: Error: Message: Service /home/appuser/.wdm/drivers/chromedriver/linux64/112.0.5615.49/chromedriver unexpectedly exited. Status code was: 255 So, I connect to the terminal inside the container, and now I see the .wdm directory. If I’m going inside and launch the chromedriver, I have this error:

$ ./chromedriver
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

it send me to this: https://github.com/browserless/chrome/issues/2004 It’s true that my Macbook is an M1, so it’s another specific issue. So, I’ve ticked ā€œUse Rosettaā€¦ā€ in docker desktop, and now, when I launch chromedriver, I have rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2 Trace/breakpoint trap So I did export DOCKER_DEFAULT_PLATFORM=linux/amd64 And now I have the status code 127 back and ./chromedriver: error while loading shared libraries: libglib-2.0.so.0: cannot open shared object file: No such file or directory aaarg… 😦 endless debugging…

There was a discussion in the Discord #dev-autogpt channel and one suggestion was that it might be permission issues. The installation process might download the right thing but is not able to save it, or perhaps everything is installed fine, but the docker user is not allowed to either run it or access the files (or both)

except apple M1 chip

I already mentioned in my comment this. except apple M1 chip @yashb042

My bad, didn’t see the last line

In the file at location autogpt/commands/web_selenium.py, change line 90 to

driver = webdriver.Chrome( executable_path=ā€œ/usr/bin/chromedriverā€, options=options )

and re-build the Docker container. This resolved the issue for me

On Sun, Apr 23, 2023 at 8:53 PM ornedaj @.***> wrote:

wget https://chromedriver.storage.googleapis.com/94.0.4606.41/chromedriver_linux64.zip unzip chromedriver_linux64.zip -d /path/to/directory mkdir ~/bin mv /path/to/chromedriver ~/bin export PATH=$PATH:$HOME/bin

above resolved this issue for me

— Reply to this email directly, view it on GitHub https://github.com/Significant-Gravitas/Auto-GPT/issues/1821#issuecomment-1519228165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2D4OAUOH6EVZYVFV3QHRTXCXFG5ANCNFSM6AAAAAAW77EI5A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

I am having the same error on Macbook M1:

Service /home/appuser/.wdm/drivers/chromedriver/linux64/112.0.5615.49/chromedriver unexpectedly exited. Status code was: 255

The issue appeard to be that Chrome Driver is not correctly installed or configured.

I think I found the problem. BY adding some options before starting the chrome webdriver, the problem goies away;

if CFG.selenium_web_browser == ā€œfirefoxā€: driver = webdriver.Firefox( executable_path=GeckoDriverManager().install(), options=options ) elif CFG.selenium_web_browser == ā€œsafariā€: # Requires a bit more setup on the users end # See https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari driver = webdriver.Safari(options=options) else: options.add_argument(ā€˜ā€“no-sandbox’) options.add_argument(ā€˜ā€“window-size=1420,1080’) options.add_argument(ā€˜ā€“headless’) options.add_argument(ā€˜ā€“disable-gpu’) driver = webdriver.Chrome( executable_path=ChromeDriverManager().install(), options=options ) driver.get(url)

That’s the lines with ā€˜option.add’

This is the first Python code I’ve ever written/pasted from Google btw 😃 Will do a PR now…