7

After formatting a Redhat server (Amazon-flavored Linux) and reinstalling python, selenium, pyvirtualdisplay, Xvfb, Chrome and Chromedriver, I've encountered an error: selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/chromedriver unexpectedly exited. Status code was: 127

This error occurs upon initializing the browser / driver with: driver = webdriver.Chrome(executable_path="/usr/bin/chromedriver")

I'm using Richard Lloyd's Chrome and Chromedriver 2.9. I believe this issue stems from dependency issues with Chromedriver.

Any help would be greatly appreciated. Been struggling with this for a little while now.

3
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask. Also see Where do I post questions about Dev Ops? Commented Jan 14, 2017 at 8:01
  • 1
    I'm late to this party, but this is definitely not dev ops. This is a problem I'm currently encountering when trying to use selenium for chrome extension development on a VM that had no screen. This post is the closest I've found to an answer, but I'm still having this problem. Commented Apr 22, 2017 at 22:31
  • hey @firechant, after much experimenting, i eventually got the found a workaround by swapping to Firefox on a Ubuntu EC2 instance. not an ideal solution, but it got the job done for me... 1. basic EC2 setup, 2. download pip package manager, 3. apt-get xvfb, 4. install Firefox 50.1.0 and geckodriver 0.11.1 Commented Apr 24, 2017 at 13:38

2 Answers 2

4

I know it's a bit late, but I got to this searching for the problem - and the problem was that I didn't have chromium installed. I followed this walkthrough by jrg, and was able to get it to open the webdriver perfectly.

The commands I ran, in order, are here:

sudo apt-get install libxss1 libappindicator1 libindicator7 fonts-liberation
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb

After that I was able to create a webdriver just fine with:

driver = webdriver.Chrome(CHROME_DRIVER_PATH)

Hope that helps anyone else getting to this answer for the same reason!

Sign up to request clarification or add additional context in comments.

4 Comments

I was using Ubuntu 16.04 at the time, but got to this answer after an exhaustive search - it may not be super helpful if you're on a debian build, but if you're getting an error, hit me up with your debian version and I'll see if I can help
I did what you suggested @bubthegreat and it seems to have set everything up right, but I'm getting this error now: packages/selenium/webdriver/common/service.py", line 88, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. I'm on 16.04 and have been cranking on this thing for hours. Any direction would be awesome. It's an EC2 Ubuntu instance that I'm using.
@bubthegreat I solved a permissions problem by setting the chromedriver to be executable with going to the directory the driver was in and using this command chmod a+x chromedriver, but now I'm stuck at a chromedriver unexpectedly exited. Status code was: 12. I'm all out of tinker juice. :\
Haven't been able to reproduce, but maybe try reddit.com/r/learnpython/comments/81ethp/…
1

Well, if it is a dependency problem as you described here, this can help you to understand what's missing?

LD_DEBUG=all path-to-executable/command/driver -args(if any)

Example:

LD_DEBUG=all cat

example output:

LD_DEBUG=all ping google.com

As in this output screenshot it shows what actually needed to ping and in which sequence similarily when CTRL+C issued it shows what's happening to stop that ping.

I posted this screenshot as I can't post the whole output due to char limit, let me know if it doesn't solve your issue.

check this for a complete output http://www.bnikolic.co.uk/blog/linux-ld-debug.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.