Notice: Undefined index: height in /var/www/ on line 27
Just headless system things –

Just headless system things

I have a RHEL 6.4 Jenkins master that had problems starting an in-build selenium-server using maven. The pom looks something like this. Now i’ve been tracking an error for some time that looks something like this.

[11:43:57] I/launcher - Running 1 instances of WebDriver
[11:43:57] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[11:44:17] E/launcher - null
[11:44:17] E/launcher - WebDriverError: null
at Object.checkLegacyResponse (/full/path/to/protractor/node_modules/selenium-webdriver/lib/error.js:505:15)

VERY descriptive right?

At first i thought this had something to do with not being able to access the port on localhost, turns out it wasn’t that.

At second glance i thought it had something to do with the webdriver being faulty, so i tried providing something random as a webdriver to see if i had the same problem. Then i got this.

[14:02:34] I/launcher - Running 1 instances of WebDriver
[14:02:34] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[14:02:35] E/launcher - The driver executable does not exist: C:\bullshit
[14:02:35] E/launcher - WebDriverError: The driver executable does not exist: C:\bullshit

Which is far more descriptive to be honest. But then i remembered that i had piped away the logging from the server somewhere.

<processLogFile>${}/selenium-server/server.log</processLogFile> Aha!

And that’s when i found this lovely line in the logs

Creating a new session for Capabilities [{count=1, browserName=chrome, chromeOptions={args=[--headless, --disable-gpu, --window-size=800,600]}, version=, platform=ANY}]
chromedriver: error while loading shared libraries: cannot open shared object file: No such file or directory

Now this i can work with. This is something very common with CentOS, RHEL and Ubuntu Servers. Since they have no X window system all libraries that create something of value for displaying stuff on a screen are skipped out. And apparantly chromium-webdriver requires X11. That feels kind of stupid as my capabilities explicitly specifies running in headless mode. The sane thing would be that this kind of system dependencies shouldn’t be required. But apparantly they do.

Oh well, just get on with installing X11 stuff on your system. This is how you fix it on RHEL/CentOS

yum install libX11

But still it didn’t work!

In the end, it turned out i hadn’t even installed google-chrome-stable in the first place. So i did that, and it worked. However, then i got even worse problems, first libpulse wasn’t installed and was apparantly a requirement for a headless environments (?!).

yum install pulseaudio-libs

This eventually lead to core dumps when trying to make a simple GET towards any site and dump the dom.

[jenkins@my-worker01~]$ /opt/google/chrome/google-chrome --headless --disable-gpu --dump-dom --enable-crash-reporter --enable-logging --v=99 --no-sandbox
[1109/] ZygoteMain: initializing 0 fork delegates
[1109/] Available number of cores: 4
shared memfd open() failed: Invalid argument
[1109/] Failed to connect to the context. Error: Connection refused
[1109/] Could not get the download directory.
[1109/] Non Browser crash dumping enabled for: renderer
Failed to generate minidump.Illegal instruction (core dumped)
[0100/] Invalid node channel message
[jenkins@my-worker01 ~]$

I found at least one other person on the Google Developers Blog where they presented Headless Chrome and that was also a Red Hat Enterprise Linux system. This is where i ran into a complete halt and decided to file a bug-report towards the chromium project. You can view it below if you want.

I’m creating a selenium-cluster with a windows-server instead, at this point it seems easier than configuring chrome-headless for RHEL

No Comments

You can leave the first : )

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.