Can't get Google Chrome working in CentOS 7

Issues related to applications and software problems
Locke_42
Posts: 6
Joined: 2017/01/11 18:43:09

Can't get Google Chrome working in CentOS 7

Postby Locke_42 » 2017/01/11 18:50:45

I'm trying to set up Selenium for the first time on our Jenkins server. We want to use ChromeDriver as the WebDriver, but I'm running into a problem with Chrome. Namely, every time I run a test script, it says Chrome has crashed or exited abnormally. When I manually run google-chrome-stable, I get:

Code: Select all

[jenkins@jenkins01 chromium]$ ps aux | grep Xvfb
jenkins  13656  0.0  0.3  87616 14324 ?        Ss   01:15   0:00 /usr/bin/Xvfb :99 -ac -screen 0 1920x1080x24

[jenkins@jenkins01 chromium]$ google-chrome-stable --version
Google Chrome 55.0.2883.87

[jenkins@jenkins01 chromium]$ cat /etc/system-release
CentOS Linux release 7.1.1503 (Core)

[jenkins@jenkins01 ~]$ google-chrome-unstable --enable-logging=stderr
Xlib:  extension "RANDR" missing on display ":99".
Xlib:  extension "RANDR" missing on display ":99".
[21888:21888:0111/182719.545993:WARNING:audio_manager.cc(317)] Multiple instances of AudioManager detected
[21888:21888:0111/182719.546014:WARNING:audio_manager.cc(278)] Multiple instances of AudioManager detected
[21888:21888:0111/182719.578339:WARNING:password_store_factory.cc(248)] Using basic (unencrypted) store for password storage. See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_password_storage.md for more information about password storage options.
[21888:21918:0111/182719.588207:WARNING:external_pref_loader.cc(212)] You are using an old-style extension deployment method (external_extensions.json), which will soon be deprecated. (see http://developer.chrome.com/extensions/external_extensions.html)
Illegal instruction


Can anyone help?

EDIT:
Oops, I posted the google-chrome-unstable (v57) stderr by mistake. But it makes no difference; the google-chrome-stable (v55) stderr is the same.

User avatar
TrevorH
Forum Moderator
Posts: 20293
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't get Google Chrome working in CentOS 7

Postby TrevorH » 2017/01/11 20:28:43

CentOS Linux release 7.1.1503 (Core)


This is 2 minor versions backlevel. Update to 7.3.1611 and try again.

Is this a 64 or 32 bit install?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Locke_42
Posts: 6
Joined: 2017/01/11 18:43:09

Re: Can't get Google Chrome working in CentOS 7

Postby Locke_42 » 2017/01/11 20:51:51

64-bit.

I updated to 7.3, but still getting the same error.

Code: Select all

[jenkins@jenkins01 ~]$ cat /etc/system-release
CentOS Linux release 7.3.1611 (Core)

[jenkins@jenkins01 ~]$ ps aux | grep Xvfb
jenkins   1262  0.0  0.4 127512 15220 ?        Ss   20:47   0:00 /usr/bin/Xvfb :99 -ac -screen 0 1920x1080x24

[jenkins@jenkins01 ~]$ google-chrome-stable --version
Google Chrome 55.0.2883.87

[jenkins@jenkins01 ~]$ google-chrome-stable --enable-logging=stderr
Xlib:  extension "RANDR" missing on display ":99".
Xlib:  extension "RANDR" missing on display ":99".
[1432:1432:0111/204930:WARNING:audio_manager.cc(317)] Multiple instances of AudioManager detected
[1432:1432:0111/204930:WARNING:audio_manager.cc(278)] Multiple instances of AudioManager detected
[1432:1432:0111/204931:WARNING:password_store_factory.cc(248)] Using basic (unencrypted) store for password storage. See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_password_storage.md for more information about password storage options.
[1432:1459:0111/204931:WARNING:external_pref_loader.cc(212)] You are using an old-style extension deployment method (external_extensions.json), which will soon be deprecated. (see http://developer.chrome.com/extensions/external_extensions.html)
Illegal instruction


Here is the response when I run a test script:

Code: Select all

[jenkins@jenkins01 scripts]$ python pytest.py
Starting!
Getting WebDriver
Traceback (most recent call last):
  File "pytest.py", line 9, in <module>
    driver = webdriver.Chrome(chromedriver)  # Optional argument, if not specified will search path.
  File "/usr/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 3.10.0-514.2.2.el7.x86_64 x86_64)

And here's the test script:

Code: Select all

import time
import os
from selenium import webdriver

print "Starting!"
print "Getting WebDriver"
chromedriver = '/var/lib/jenkins/chromedriver'
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver)  # Optional argument, if not specified will search path.
print "DONE! Getting Google.com"
driver.get('http://www.google.com/xhtml');
time.sleep(5) # Let the user actually see something!
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5) # Let the user actually see something!
driver.quit()

User avatar
TrevorH
Forum Moderator
Posts: 20293
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't get Google Chrome working in CentOS 7

Postby TrevorH » 2017/01/11 20:57:56

Check in /var/log/messages and there should be a single line telling you where it crashed and in what library. An illegal instruction error sounds like it's been compiled for a processor that you don't have - what are you running on?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Locke_42
Posts: 6
Joined: 2017/01/11 18:43:09

Re: Can't get Google Chrome working in CentOS 7

Postby Locke_42 » 2017/01/11 21:31:50

I'm running it on an AWS EC2 instance.

This is what shows up in /var/log/messages:

Code: Select all

Jan 11 21:29:14 jenkins01 kernel: traps: chrome[1768] trap invalid opcode ip:7f6421b77c4b sp:7ffc980332c0 error:0 in chrome[7f641f355000+6612000]

User avatar
TrevorH
Forum Moderator
Posts: 20293
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't get Google Chrome working in CentOS 7

Postby TrevorH » 2017/01/11 21:33:28

Ah. Make sure your nss packages are up to date - there was a bug in those that caused yum to crash with an illegal instruction error on xen machines (which I believe is what Amazon images are).
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Locke_42
Posts: 6
Joined: 2017/01/11 18:43:09

Re: Can't get Google Chrome working in CentOS 7

Postby Locke_42 » 2017/01/11 21:38:45

These?

Code: Select all

nss.x86_64   3.21.3-2.el7_3   @updates   
nss-softokn.x86_64   3.16.2.3-14.4.el7   @base   
nss-softokn-freebl.x86_64   3.16.2.3-14.4.el7   @base   
nss-sysinit.x86_64   3.21.3-2.el7_3   @updates   
nss-tools.x86_64   3.21.3-2.el7_3   @updates   
nss-util.x86_64   3.21.3-1.1.el7_3   @updates   

User avatar
TrevorH
Forum Moderator
Posts: 20293
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't get Google Chrome working in CentOS 7

Postby TrevorH » 2017/01/11 22:02:19

It was the nss-softokn packages in particular. Try using

export NSS_DISABLE_HW_AES=1

in the command prompt you use to execute this and see if it makes any difference.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Locke_42
Posts: 6
Joined: 2017/01/11 18:43:09

Re: Can't get Google Chrome working in CentOS 7

Postby Locke_42 » 2017/01/11 22:13:14

Nope, no change :/

Code: Select all

[jenkins@jenkins01 ~]$ export NSS_DISABLE_HW_AES=1

[jenkins@jenkins01 ~]$ google-chrome-stable --enable-logging=stderr
Xlib:  extension "RANDR" missing on display ":99".
Xlib:  extension "RANDR" missing on display ":99".
[2865:2865:0111/221347:WARNING:audio_manager.cc(317)] Multiple instances of AudioManager detected
[2865:2865:0111/221347:WARNING:audio_manager.cc(278)] Multiple instances of AudioManager detected
[2865:2865:0111/221347:WARNING:password_store_factory.cc(248)] Using basic (unencrypted) store for password storage. See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_password_storage.md for more information about password storage options.
[2865:2892:0111/221347:WARNING:external_pref_loader.cc(212)] You are using an old-style extension deployment method (external_extensions.json), which will soon be deprecated. (see http://developer.chrome.com/extensions/external_extensions.html)
Illegal instruction

[jenkins@jenkins01 ~]$ sudo tail /var/log/messages
Jan 11 22:05:24 jenkins01 dhclient[747]: bound to 10.63.51.12 -- renewal in 1601 seconds.
Jan 11 22:10:01 jenkins01 systemd: Created slice user-0.slice.
Jan 11 22:10:01 jenkins01 systemd: Starting user-0.slice.
Jan 11 22:10:01 jenkins01 systemd: Started Session 13 of user root.
Jan 11 22:10:01 jenkins01 systemd: Starting Session 13 of user root.
Jan 11 22:10:01 jenkins01 systemd: Removed slice user-0.slice.
Jan 11 22:10:01 jenkins01 systemd: Stopping user-0.slice.
Jan 11 22:12:32 jenkins01 kernel: traps: chrome[2724] trap invalid opcode ip:7f5f52038c4b sp:7ffea9bdc480 error:0 in chrome[7f5f4f816000+6612000]
Jan 11 22:12:37 jenkins01 kernel: traps: chrome[2793] trap invalid opcode ip:7f76d2163c4b sp:7ffd7a410d40 error:0 in chrome[7f76cf941000+6612000]
Jan 11 22:13:47 jenkins01 kernel: traps: chrome[2865] trap invalid opcode ip:7f949db15c4b sp:7ffefdbc9980 error:0 in chrome[7f949b2f3000+6612000]
[jenkins@jenkins01 ~]$

User avatar
TrevorH
Forum Moderator
Posts: 20293
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't get Google Chrome working in CentOS 7

Postby TrevorH » 2017/01/11 22:19:24

Then I suspect you need to do at least one of several things. One: see if you can reproduce this on a non-Amazon instance, preferably a real machine so that you can rule out some sort of similar xen-related bug. Next, see if you can grab a core dump and feed it into gdb and find out what it's crashing with and if possible where, and what it was trying to run and if that is a real instruction that could be executed at all or if it's doing something stupid and taking a wild branch into mid-air and trying to execute wherever it lands. If it is a real instruction, check in /proc/cpuinfo to see if that is an instruction that's listed as being present on the cpu you are on - e.g. if it's an aesni instruction, that the flags section of cpuinfo shows "aes" listed. If it is meant to be present then you have an Amazon/xen bug. If it looks like it's taken a wild step into the unknown then I guess you need to report it to Google as a chrome bug.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke


Return to “CentOS 7 - Software Support”

Who is online

Users browsing this forum: No registered users and 7 guests