4

I am using:

  • Chromium 73
  • Chromium ChromeDriver 73
  • Alpine 3.9
  • Selenium Java

in CI (in kuberenetes cluster) and I am getting crashes for web driver since I added WebWorker to my application code under test.

Crash Log Here - https://gist.github.com/yosiat/360cb40af0cf7e234a0c6304c8c26ef1

I enabled chrome webdriver verbose logging and I see those lines:

[33751:33751:0709/175416.767497:ERROR:validation_errors.cc(76)] Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED (DevToolsAgentHost::ChildWorkerCreated deserializer)
[33751:33761:0709/175416.767545:ERROR:render_process_host_impl.cc(4800)] Terminating render process for bad Mojo message: Received bad user message: Validation failed for DevToolsAgentHost::ChildWorkerCreated deserializer [VALIDATION_ERROR_DESERIALIZATION_FAILED (DevToolsAgentHost::ChildWorkerCreated deserializer)
[33751:33761:0709/175416.767578:ERROR:bad_message.cc(27)] Terminating renderer for bad IPC message, reason 123
[1562694856.784][DEBUG]: DevTools WebSocket Event: Inspector.targetCrashed EBB11FCDAB2DEC02066BF3BCD6FF4F8D {

}
[1562694856.784][INFO]: Done waiting for pending navigations. Status: unknown error: cannot determine loading status
from tab crashed
[1562694856.835][INFO]: [d62047bf581d2bfcc6f681474fb0ea28] RESPONSE Navigate ERROR unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed
  (Session info: chrome=73.0.3683.103)
Yosi
  • 2,936
  • 7
  • 39
  • 64
  • Have similar problem: Alphine, chromium 73 and same first three lines of log. In my case it fails only on some sites (not every page) and DevTools protocol is not used. – uhbif19 Jul 17 '19 at 14:12
  • Any particular reason why you are running chromium 73 and not the latest stable 75 (with the ChromeDriver for it)? My guess would be some kind of regression so try it with the latest stable. – tukan Jul 24 '19 at 08:34
  • @tukan It is the last version available in alpine repos. – uhbif19 Jul 30 '19 at 09:05

2 Answers2

1

Try launching the chrome with argument '--disable-dev-shm-usage' . Example JAVA :

  ChromeOptions options = new ChromeOptions();
  options.addArguments("--disable-dev-shm-usage");

Most probably its crashing because of the memory issues. Reference

If above solution is not working then you can try mounting an emptyDir to /dev/shm and setting the medium to Memory

Rahul L
  • 4,249
  • 15
  • 18
  • Already tried both disabling shm in chrome and resizing shm by docker options. Not working. – uhbif19 Jul 30 '19 at 09:03
  • I had a similar issue and it solved it. I'm using wdio with cucumber and I put these settings : 'goog:chromeOptions': { args: process.env.HEADLESS !== 'false' ? [ '--headless', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage' ] : [] } – Holgrabus Jul 18 '23 at 18:18
0

I got exactly the same error while trying to setup nightwatch + chromium + chromedriver in docker. Our project uses Auth0 which in turn uses web workers, some other sites without web workers opened just fine. I used node:10-alpine image and simply installed chrome and chromedriver like this apk add chromium-chromedriver chromium, tried --privileged mode and a bunch of chrome flags but it didn't work.

Then I tried using this as a base (right now it installs chrome 76) https://github.com/GoogleChromeLabs/lighthousebot/blob/master/builder/Dockerfile and it worked. The final dockerfile was something like this

FROM node:10-slim AS test

RUN apt-get update --fix-missing && apt-get -y upgrade

RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-stable --no-install-recommends \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /src/*.deb
RUN npm install nightwatch chromedriver

# copy nightwatch files, etc

And chrome was run with --headless, --no-sandbox and --disable-gpu.