Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

UnknownError: session deleted because of page crash from tab crashed #20

Closed

Description

@elgalu

Chrome crashes on docker-selenium instances (works ok with real machines) on certain high GPU intensive UI tests

{code}
UnknownError: unknown error: session deleted because of page crash
from tab crashed
(Session info: chrome=43.0.2357.81)
(Driver info: chromedriver=2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3),platform=Linux 3.13.0-32-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 53 milliseconds
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'zelenium', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-32-generic', java.version: '1.7.0_80'
Session ID: b12eb3c43351dad58746798c40078ef9
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/tmp/.com.google.Chrome.11yHIh}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=43.0.2357.81, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, applicationCacheEnabled=false, takesScreenshot=true}]
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
==== async task ====
WebDriver.executeScript()
.....
{code}

Works ok in Firefox.

Activity

  1. elgalu commented on Jun 1, 2015

    @elgalu
    OwnerAuthor

    Note: playing with certain Chrome options like --no-sandbox didn't help

    capabilities: {
        browserName: 'chrome',
        chromeOptions: {
            args: [
                '--disable-gpu',
                '--disable-impl-side-painting',
                '--disable-gpu-sandbox',
                '--disable-accelerated-2d-canvas',
                '--disable-accelerated-jpeg-decoding',
                '--no-sandbox',
                '--test-type=ui',
                ],
        },
    },
    
  2. elgalu commented on Jun 16, 2015

    @elgalu
    OwnerAuthor
  3. added this to the priority-major milestone on Jun 24, 2015
  4. bitliner commented on Jun 28, 2015

    @bitliner

    Same here, using selenium/standalone-chrome:2.46.0

  5. khoaln commented on Jun 30, 2015

    @khoaln

    Same here. I have been trying many docker images built for running selenium+protractor +xvfb (includes one of @elgalu ;) ). Look like this is dues to docker. Everything ok on real machine or vagrant+virtualbox.

  6. bitliner commented on Jun 30, 2015

    @bitliner

    I had to switch to firefox, and it does not happen anymore.

  7. elgalu commented on Jun 30, 2015

    @elgalu
    OwnerAuthor

    Yes, Firefox works ok fortunately.
    I guess Chrome guys would be able to fix the problem if someone gets together a sample project that reproduces the problem and host it somewhere.

  8. smacgaha commented on Jul 1, 2015

    @smacgaha

    When I run my suite without test cases that download files, I don't see this error. Has anyone else tried this?

  9. kkochubey1 commented on Aug 12, 2015

    @kkochubey1

    Chrome 42 - 44 crashes when manually open http://www.google.com/adwords

    Is there issue already opened for Chrome browser in docker. Should I submit a new one for Chromium?

    We are running into similar issue with our application same as with http://www.google.com/adwords
    We use own docker configuration similar to selenium/node-chrome-debug

    Steps to reproduce manually on public selenium image:
    docker run -d -p 4444:4444 --name selenium-hub selenium/hub
    docker run -it -p 5900:5900 --link selenium-hub:hub selenium/node-chrome-debug

    start vnc viewver on default docker IP 127.0.0.1:5900
    or for boot2docker IP at 192.168.69.103:5900
    (default password is 'secret')

    Right mouse click. Open Applications\Terminal Emulators\XTerm
    run following commands

    sudo su - seluser
    google-chrome

    In google chrome window type
    http://www.google.com/adwords

    It loads page and then shows: Aw, Snap!

    It is reproducible in all Chrome browsers starting 42 (till latest 44)
    Currently on Chrome/44.0.2403.155

    It is not reproducible on the our old docker-selenium image with older Chrome/41.0.2272.89

    Please refer correct duplicate or let me know where I can submit this issue?
    I can provide additional details, logs if needed?

  10. kkochubey1 commented on Aug 12, 2015

    @kkochubey1
  11. elgalu commented on Aug 13, 2015

    @elgalu
    OwnerAuthor

    Best chance for this to be fixed here:
    https://code.google.com/p/chromium/issues/detail?id=519952

  12. issuj commented on Aug 20, 2015

    @issuj

    FYI, I have found that recent version(s) of Chrome seem to crash in Docker containers, on certain pages, due to too small /dev/shm. May or may not be relevant to this issue.

  13. elgalu commented on Aug 20, 2015

    @elgalu
    OwnerAuthor

    OMG @issuj you figured this out, I just tried below code and Chrome no longer crashes:

    Simpy mount -v /dev/shm:/dev/shm

    Or, longer, create a big shm

    1. Started in privileged mode: docker run --privileged
    2. Fix small /dev/shm size
    docker exec $id sudo umount /dev/shm
    docker exec $id sudo mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=512M tmpfs /dev/shm

    However it would be nice to avoid privileged mode.
    Any ideas @stonemaster @rongearley @jvermillard ?

    Other refs:
    moby/moby#3505 (comment)
    moby/moby#4981 (comment)
    moby/moby#2606 (comment)

  14. afiestas commented on Aug 22, 2015

    @afiestas

    We were having the same issue, fixed by remounting /dev/shm with bigger size.

  15. 44 remaining items

  16. added a commit that references this issue on Jun 18, 2018
  17. rebendajirijr commented on Jul 19, 2018

    @rebendajirijr

    I also experience this issue when running tests in gitlab CI:
    image

  18. apdarshan commented on Aug 20, 2018

    @apdarshan

    Saved my life! Just shm_size: 2G in my docker-compose file did the trick. 💯

  19. added a commit that references this issue on Sep 15, 2018
  20. CampsiteHelper commented on Dec 27, 2018

    @CampsiteHelper

    Should this not be resolved within the base container definition?

  21. ivasilko commented on Jun 25, 2019

    @ivasilko

    Is there a way to do this in Kubernetes on GCP?
    spec:
    volumes:
    - name: shm-vol
    hostPath:
    path: /dev/shm
    containers:
    volumeMounts:
    - name: shm-vol
    mountPath: /dev/shm

  22. baflQA commented on Jul 8, 2019

    @baflQA
    Collaborator

    Hi. I'm still having this issue on some of the pods spawned by the zalenium. Where should I set this "/dev/shm:/dev/shm" in my yaml when deploying zalenium to K8S?

  23. diemol commented on Jul 9, 2019

    @diemol
    Collaborator

    @baflQA, this should work https://stackoverflow.com/questions/46085748/define-size-for-dev-shm-on-container-engine/46434614#46434614

    Not sure if k8s has a different way to do it these days.

  24. grzegorztomasiak commented on Aug 14, 2019

    @grzegorztomasiak

    Just to add my few cents about this issue.

    None of the solutions given on the internet worked for me. Including increasing /dev/shm.
    The problem in my case was a memory leak in the application that wasn't discovered by real human or browser but was mainly caused by Mink driver.

    I had in my HTML a following piece of code

    <input type="text" name="content" value="{{ a long HTML template string here }}" />

    When this view was tested, Mink tried to execute a step I follow "Close", which was searching the DOM to find Close button. But because the long HTML template was there, I assume Mink could not handle HTML in HTML and it caused memory leak which in result crashed the chrome driver with the error.

    To resolve this, I had to change the way I store the HTML template (via ajax, not form) and no more crashing.

  25. viniciusd commented on Sep 13, 2019

    @viniciusd

    Not sure if k8s has a different way to do it these days.

    Using this stackoverflow solution on Kubernetes, worked like a charm

  26. yuezk commented on Jan 13, 2020

    @yuezk

    I encountered this issue when I calling the executeScript method to try to get an object from the web page and I'm not using selenium in docker. I found a workaround for this, that is calling JSON.stringify() in the web page before returning the object. Something like below.

    const dataStr = await browser.driver.executeScript('return JSON.stringify(obj)');
    // Parse the JSON string.
    const data = JSON.parse(dataStr);
  27. added a commit that references this issue on Sep 9, 2020
  28. saramorsi commented on Jan 14, 2021

    @saramorsi

    OMG @issuj you figured this out, I just tried below code and Chrome no longer crashes:

    Simpy mount -v /dev/shm:/dev/shm

    Or, longer, create a big shm

    1. Started in privileged mode: docker run --privileged
    2. Fix small /dev/shm size
    docker exec $id sudo umount /dev/shm
    docker exec $id sudo mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=512M tmpfs /dev/shm

    However it would be nice to avoid privileged mode.
    Any ideas @stonemaster @rongearley @jvermillard ?

    Other refs:
    moby/moby#3505 (comment)
    moby/moby#4981 (comment)
    moby/moby#2606 (comment)

    How do I run these commands? and what is $id in this case?

  29. added a commit that references this issue on Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions