Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Xvfb and VNC crash under M1 Mac when using AMD64 image #2298

Closed
slhck opened this issue Jul 8, 2024 · 13 comments
Closed

[🐛 Bug]: Xvfb and VNC crash under M1 Mac when using AMD64 image #2298

slhck opened this issue Jul 8, 2024 · 13 comments
Labels
G-chromedriver Report this issue to ChromeDriver

Comments

@slhck
Copy link
Contributor

slhck commented Jul 8, 2024

What happened?

I am running the standalone Chrome Docker image to run some tests against. The first test always works fine, but any subsequent tests fail with an error:

session not created: DevToolsActivePort file doesn't exist

My test consists of a simple set of steps:

let builder: webdriver.Builder;
const chromeOptions = new chrome.Options().addArguments(
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-dev-shm-usage',
        '--mute-audio',
        '--disable-web-security',
        '--autoplay-policy=no-user-gesture-required',
        '--safebrowsing-disable-download-protection',
      );
builder = new webdriver.Builder()
        .forBrowser('chrome')
        .usingServer(process.env.SELENIUM_HUB_URL)
        .setChromeOptions(chromeOptions)
const driver = await driver.get('https://www.google.com');
const title = await driver.getTitle();
await driver.quit();
await driver.close();

When I run the test once, all is fine. The second time I run it, it errors out.

Command used to start Selenium Grid with Docker (or Kubernetes)

docker run --platform linux/amd64 -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:126.0-20240621

Relevant log output

Unable to find image 'selenium/standalone-chrome:126.0-20240621' locally
126.0-20240621: Pulling from selenium/standalone-chrome
Digest: sha256:a6dbdd1eb16f67e9e927f9c48a29d480250b3dd1364a8c9d9d0d354f2d86c230
Status: Downloaded newer image for selenium/standalone-chrome:126.0-20240621
2024-07-08 08:50:32,976 INFO Included extra file "/etc/supervisor/conf.d/chrome-cleanup.conf" during parsing
2024-07-08 08:50:32,977 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
2024-07-08 08:50:32,980 INFO RPC interface 'supervisor' initialized
2024-07-08 08:50:32,980 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-07-08 08:50:32,980 INFO supervisord started with pid 8
2024-07-08 08:50:33,984 INFO spawned: 'xvfb' with pid 9
2024-07-08 08:50:33,986 INFO spawned: 'vnc' with pid 10
2024-07-08 08:50:33,987 INFO spawned: 'novnc' with pid 11
2024-07-08 08:50:33,989 INFO spawned: 'selenium-standalone' with pid 12
2024-07-08 08:50:34,048 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-07-08 08:50:34,048 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-07-08 08:50:34,048 INFO success: novnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-07-08 08:50:34,048 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Appending Selenium options: --heartbeat-period 30
Appending Selenium options: --reject-unsupported-caps false
Setting up SE_NODE_GRID_URL...
Selenium Grid Standalone configuration: 
[network]
relax-checks = true

[node]
session-timeout = "300"
override-max-sessions = false
detect-drivers = false
drain-after-session-count = 0
max-sessions = 1

[[node.driver-configuration]]
display-name = "chrome"
stereotype = '{"browserName": "chrome", "browserVersion": "126.0", "platformName": "Linux", "goog:chromeOptions": {"binary": "/usr/bin/google-chrome"}}'
max-sessions = 1

Starting Selenium Grid Standalone...
Tracing is disabled
08:50:35.944 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
08:50:35.963 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
08:50:37.076 INFO [NodeOptions.getSessionFactories] - Detected 8 available processors
08:50:37.150 INFO [NodeOptions.report] - Adding chrome for {"browserName": "chrome","browserVersion": "126.0","goog:chromeOptions": {"binary": "\u002fusr\u002fbin\u002fgoogle-chrome"},"platformName": "linux","se:noVncPort": 7900,"se:vncEnabled": true} 1 times
08:50:37.194 INFO [Node.<init>] - Binding additional locator mechanisms: relative
08:50:37.229 INFO [GridModel.setAvailability] - Switching Node 01b6239c-1cd2-4445-984a-371cf033eb56 (uri: http://172.17.0.5:4444) from DOWN to UP
08:50:37.231 INFO [LocalDistributor.add] - Added node 01b6239c-1cd2-4445-984a-371cf033eb56 at http://172.17.0.5:4444. Health check every 120s
08:50:37.391 INFO [Standalone.execute] - Started Selenium Standalone 4.22.0 (revision c5f3146703): http://172.17.0.5:4444
08:50:42.503 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 
 [Capabilities {browserName: chrome, goog:chromeOptions: {args: [--no-sandbox, --disable-setuid-sandbox, --disable-dev-shm-usage, --mute-audio, --disable-web-security, --autoplay-policy=no-user-g..., --safebrowsing-disable-down...]}, goog:loggingPrefs: {}}]
08:50:45.984 INFO [LocalNode.newSession] - Session created by the Node. Id: d47b3bc2291f697a29cedae3e4080cee, Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 126.0.6478.114, chrome: {chromedriverVersion: 126.0.6478.63 (df799988fdc9..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:45551}, goog:loggingPrefs: {}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://172.17.0.5:4444/sessio..., se:cdpVersion: 126.0.6478.114, se:vnc: ws://172.17.0.5:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.17.0.5:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
08:50:45.993 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: d47b3bc2291f697a29cedae3e4080cee 
 Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 126.0.6478.114, chrome: {chromedriverVersion: 126.0.6478.63 (df799988fdc9..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:45551}, goog:loggingPrefs: {}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://172.17.0.5:4444/sessio..., se:cdpVersion: 126.0.6478.114, se:vnc: ws://172.17.0.5:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.17.0.5:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
2024-07-08 08:50:48,440 INFO exited: xvfb (exit status 1; not expected)
08:50:48.513 INFO [LocalSessionMap.lambda$new$0] - Deleted session from local Session Map, Id: d47b3bc2291f697a29cedae3e4080cee
08:50:48.514 INFO [GridModel.release] - Releasing slot for session id d47b3bc2291f697a29cedae3e4080cee
08:50:48.516 INFO [SessionSlot.stop] - Stopping session d47b3bc2291f697a29cedae3e4080cee
2024-07-08 08:50:48,541 INFO exited: vnc (exit status 133; not expected)
08:50:51.207 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 
 [Capabilities {browserName: chrome, goog:chromeOptions: {args: [--no-sandbox, --disable-setuid-sandbox, --disable-dev-shm-usage, --mute-audio, --disable-web-security, --autoplay-policy=no-user-g..., --safebrowsing-disable-down...]}, goog:loggingPrefs: {}}]
08:50:51.870 WARN [DriverServiceSessionFactory.apply] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
Host info: host: '641b9b714df9', ip: '172.17.0.5'
Build info: version: '4.22.0', revision: 'c5f3146703'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'
Driver info: driver.version: unknown
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
Host info: host: '641b9b714df9', ip: '172.17.0.5'
Build info: version: '4.22.0', revision: 'c5f3146703'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
        at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:161)
        at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)
        at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
        at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:652)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:571)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:834)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:791)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
08:50:51.889 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
Host info: host: '641b9b714df9', ip: '172.17.0.5'
Build info: version: '4.22.0', revision: 'c5f3146703'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'
Driver info: driver.version: unknown
08:50:51.889 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
Host info: host: '641b9b714df9', ip: '172.17.0.5'
Build info: version: '4.22.0', revision: 'c5f3146703'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
        at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:161)
        at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)
        at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
        at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:652)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:571)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:834)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:791)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)

08:50:51.894 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "ad85858331bd0bfb14d2af10b728a09d","eventTime": 1720428651871128922,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002flocalhost:11913","exception.message": "Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.\n  (session not created: DevToolsActivePort file doesn't exist)\n  (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) \nHost info: host: '641b9b714df9', ip: '172.17.0.5'\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.\n  (session not created: DevToolsActivePort file doesn't exist)\n  (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) \nHost info: host: '641b9b714df9', ip: '172.17.0.5'\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:161)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:652)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:571)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:834)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:791)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.base\u002fjava.lang.Thread.run(Unknown Source)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"chrome\",\"browserVersion\": \"126.0\",\"goog:chromeOptions\": {\"args\": [\"--no-sandbox\",\"--disable-setuid-sandbox\",\"--disable-dev-shm-usage\",\"--mute-audio\",\"--disable-web-security\",\"--autoplay-policy=no-user-gesture-required\",\"--safebrowsing-disable-download-protection\"],\"binary\": \"\\u002fusr\\u002fbin\\u002fgoogle-chrome\"},\"goog:loggingPrefs\": {},\"platformName\": \"linux\",\"se:noVncPort\": 7900,\"se:vncEnabled\": true}\n"}}

08:50:51.898 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "ad85858331bd0bfb14d2af10b728a09d","eventTime": 1720428651896385839,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {browserName: chrome, goog:chromeOptions: {args: [--no-sandbox, --disable-setuid-sandbox, --disable-dev-shm-usage, --mute-audio, --disable-web-security, --autoplay-policy=no-user-g..., --safebrowsing-disable-down...]}, goog:loggingPrefs: {}}","session.request.downstreamdialect": "[W3C]"}}

08:50:51.901 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "ad85858331bd0bfb14d2af10b728a09d","eventTime": 1720428651207125797,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--no-sandbox, --disable-setuid-sandbox, --disable-dev-shm-usage, --mute-audio, --disable-web-security, --autoplay-policy=no-user-g..., --safebrowsing-disable-down...]}, goog:loggingPrefs: {}}]"}}

08:50:51.901 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to create session: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
Host info: host: '641b9b714df9', ip: '172.17.0.5'
Build info: version: '4.22.0', revision: 'c5f3146703'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'
Driver info: driver.version: unknown
Build info: version: '4.22.0', revision: 'c5f3146703'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'
Driver info: driver.version: unknown
08:50:51.901 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
Host info: host: '641b9b714df9', ip: '172.17.0.5'
Build info: version: '4.22.0', revision: 'c5f3146703'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'
Driver info: driver.version: unknown
Build info: version: '4.22.0', revision: 'c5f3146703'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'
Driver info: driver.version: unknown
        at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:221)
        at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)
        at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
        at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:652)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:571)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:834)
        at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:791)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)

08:50:51.902 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "ad85858331bd0bfb14d2af10b728a09d","eventTime": 1720428651900287547,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.\n  (session not created: DevToolsActivePort file doesn't exist)\n  (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) \nHost info: host: '641b9b714df9', ip: '172.17.0.5'\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.\n  (session not created: DevToolsActivePort file doesn't exist)\n  (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) \nHost info: host: '641b9b714df9', ip: '172.17.0.5'\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:221)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:652)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:571)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:834)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:791)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.base\u002fjava.lang.Thread.run(Unknown Source)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--no-sandbox, --disable-setuid-sandbox, --disable-dev-shm-usage, --mute-audio, --disable-web-security, --autoplay-policy=no-user-g..., --safebrowsing-disable-down...]}, goog:loggingPrefs: {}}]"}}

08:50:51.920 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "ad85858331bd0bfb14d2af10b728a09d","eventTime": 1720428651919477172,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue","http.host": "localhost:4444","http.method": "POST","http.request_content_length": "610","http.scheme": "HTTP","http.status_code": 500,"http.target": "\u002fsession","http.user_agent": "selenium\u002f4.4.0 (js mac)"}}

Operating System

macOS

Docker Selenium version (image tag)

126.0-20240621

Selenium Grid chart version (chart version)

No response

Copy link

github-actions bot commented Jul 8, 2024

@slhck, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol
Copy link
Member

diemol commented Jul 8, 2024

This issue has been reported several times. Please check the comments of the reports history and if you are still facing it after trying out the different suggestions, report it to the Chrome folks.

https://github.com/SeleniumHQ/docker-selenium/issues?q=is%3Aissue+DevToolsActivePort+file+doesn%27t+exist

@diemol diemol added G-chromedriver Report this issue to ChromeDriver and removed needs-triaging labels Jul 8, 2024
Copy link

github-actions bot commented Jul 8, 2024

Hi, @slhck.
This issue has been determined to require fixes in ChromeDriver.

You can see if the feature is passing in the Web Platform Tests.

If it is something new, please create an issue with the ChromeDriver team.
Feel free to comment the issues that you raise back in this issue. Thank you.

@github-actions github-actions bot closed this as completed Jul 8, 2024
@slhck
Copy link
Contributor Author

slhck commented Jul 8, 2024

Thanks for the quick answer, and sorry, I somehow didn't see those. Based on my Internet searches most issues had to do with the --no-sandbox flag.

Can you please let me know which specific solution from these other issues you had in mind? Because you are of course right about the same error message, and quick to close the issue, yet the problem is only occurring after a first successful test. It's not like this issue is exhibited from the first startup.

Specifically, after the first session is stopped, I see:

2024-07-08 11:02:59,770 INFO exited: xvfb (exit status 1; not expected)
11:02:59.833 INFO [LocalSessionMap.lambda$new$0] - Deleted session from local Session Map, Id: 28b8c47fdb3c8e0940b305076c94d370
11:02:59.834 INFO [GridModel.release] - Releasing slot for session id 28b8c47fdb3c8e0940b305076c94d370
11:02:59.835 INFO [SessionSlot.stop] - Stopping session 28b8c47fdb3c8e0940b305076c94d370
2024-07-08 11:02:59,937 INFO exited: vnc (exit status 133; not expected)

If indeed XVFB is not running, I would expect Chrome not being able to even launch. So this seems to be a different issue than the other ones — just the same final error message.

More specifically:

@diemol
Copy link
Member

diemol commented Jul 8, 2024

This one is also giving information about this SeleniumHQ/selenium#14076

@slhck
Copy link
Contributor Author

slhck commented Jul 9, 2024

What specifically do you mean with respect to the other issue? As far as I can tell the session itself is closed properly in my case, and the resource consumption is normal. It's also just one test, so it's not only occurring with multiple parallel executions like the OP mentioned. The underlying reason seems to be the VNC and XVFB session crashing. What could cause that?

I have also tried with more shared memory (4G) but that did not help.

@diemol
Copy link
Member

diemol commented Jul 9, 2024

What do you see in the XVFB and VNC logs?

https://github.com/SeleniumHQ/docker-selenium/blob/trunk/NodeBase/selenium.conf#L13

@slhck
Copy link
Contributor Author

slhck commented Jul 9, 2024

When I dump the Xvfb logs during the first test I get:

➜ docker exec zen_wozniak tail -f /var/log/supervisor/xvfb-stdout.log
Failed to read: session.screen0.iconbar.mode
Setting default value
Failed to read: session.screen0.iconbar.alignment
Setting default value
Failed to read: session.screen0.iconbar.iconWidth
Setting default value
Failed to read: session.screen0.iconbar.iconTextPadding
Setting default value
Failed to read: session.screen0.iconbar.usePixmap
Setting default value
Failed to read: session.screen0.titlebar.left
Setting default value
Failed to read: session.screen0.titlebar.right
Setting default value
X connection to :99.0 broken (explicit kill or server shutdown).

The "explicit kill or server shutdown" message appears when the test has finished. No subsequent sessions can be started.

I wonder if the supervisord configuration should be changed to restart Xvfb in case of failure? Still, I do not see any explicit calls to kill in this repository.

@diemol
Copy link
Member

diemol commented Jul 9, 2024

Are you using a macOS M1/M2/M3?

@slhck
Copy link
Contributor Author

slhck commented Jul 9, 2024

Yes, I am using a M1 Mac. This is from VNC:

➜ docker exec gallant_morse tail -f /var/log/supervisor/vnc-stdout.log /var/log/supervisor/vnc-stderr.log
==> /var/log/supervisor/vnc-stdout.log <==
Centering wallpaper
Trying to update the open file descriptor limit from 1048576 to 100000.
Successfully updated the open file descriptor limit.

==> /var/log/supervisor/vnc-stderr.log <==
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

    x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

caught XIO error:
assertion failed [rem_idx != -1]: Unable to find existing allocation for shared memory segment to unmap
(VMAllocationTracker.cpp:745 remove_shared_mem)
 /opt/bin/start-vnc.sh: line 67:   123 Trace/breakpoint trap   x11vnc ${X11VNC_OPTS} -forever -shared -rfbport ${VNC_PORT:-$SE_VNC_PORT} -rfbportv6 ${VNC_PORT:-$SE_VNC_PORT} -display ${DISPLAY}

Apparently it's the:

Unable to find existing allocation for shared memory segment to unmap

So apparently running the Linux/AMD64 image itself with Chrome is not possible?

When I run the Chromium image natively, it works:

➜ docker run -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chromium:126.0-20240621

@diemol
Copy link
Member

diemol commented Jul 9, 2024

@slhck slhck changed the title [🐛 Bug]: [🐛 Bug]: Xvfb and VNC crash under M1 Mac when using AMD64 image Jul 9, 2024
@slhck
Copy link
Contributor Author

slhck commented Jul 9, 2024

Yes, although there is no information that this wouldn't work, as x64 is just being emulated here, and so far I have also been able to run other images if they weren't available as multi-arch images. I think that the README is a bit unclear in that regard. I fixed the title of the issue and will provide a PR to update the README.

Copy link

github-actions bot commented Aug 9, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
G-chromedriver Report this issue to ChromeDriver
Projects
None yet
Development

No branches or pull requests

2 participants