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

chromedriver_linux64 unexpectedly exited. Status code was: 127 #10

Closed
mohnish7 opened this issue Aug 25, 2021 · 2 comments
Closed

chromedriver_linux64 unexpectedly exited. Status code was: 127 #10

mohnish7 opened this issue Aug 25, 2021 · 2 comments

Comments

@mohnish7
Copy link

mohnish7 commented Aug 25, 2021

Trying to run chromedriver in Google Cloud Run. Here is what the docker file looks like:

FROM python:3.7

ADD main.py /

RUN apt-get update
RUN apt-get install wget

# Install Chrome
#RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
#RUN dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install

COPY . /
RUN pip install --upgrade google-api-python-client
RUN pip install -r requirements.txt

EXPOSE XXXXX

CMD [ "python", "./main.py" ]

Any idea how to fix this error? In my requirements file I have chromedriver_py== 92.0.4515.43 mentioned. Any other dependencies that I need to install?

The issue seems to be originating from here:

browser = Chrome(executable_path=binary_path, options=opts)

Here's the options:

opts = Options()
	opts.add_argument("--no-sandbox")
	opts.add_argument("--headless")
	opts.add_argument('--disable-dev-shm-usage')
	opts.add_argument("--window-size=1920x1080")
	opts.add_argument(
	    "--user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.43 Safari/537.36'")
	opts.add_argument("--disable-gpu")
	opts.add_argument("--disable-extensions")
	opts.add_argument("--start-maximized")
	browser = Chrome(executable_path=binary_path, options=opts)
@breuerfelix
Copy link
Owner

well you commented out the chrome installation, and the chromedriver needs chrome to work, so maybe this could be the issue.

another way you can debug this: in the CMD run the chromedriver directly (it should be located somewhere in the pypy packages, you need to search it a little) and then see what the output is, what is the correct error message? if this is working, then add all the flags from your python code to the CMD and see if they work as expected or which error message you get.
because you run the driver directly, you get way more info than from running it through python :)

@mohnish7
Copy link
Author

I ended up using chromedriver directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants