docker 中运行无头浏览器报错: UnknownError: session deleted because of page crash from tab crashed
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.
解决方法:
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
- Started in privileged mode:
docker run --privileged
- 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
相关文章:
https://github.com/moby/moby/issues/2606#issuecomment-95350288
https://github.com/moby/moby/pull/4981#issuecomment-56052500