SeleniumHQ / docker-selenium

Provides a simple way to run Selenium Grid with Chrome, Firefox, and Edge using Docker, making it easier to perform browser automation
http://www.selenium.dev/docker-selenium/
Other
7.86k stars 2.51k forks source link

[🐛 Bug]: Firefox Blank or White Screen in OpenShift Container Platform when runnung exeutions #2273

Open varsha-rav opened 3 months ago

varsha-rav commented 3 months ago

What happened?

Hi, We've set up selenium 4 hub along with selenium/node-firefox, selenium/node-chrome and selenium/node-edge. On running executions on selenium/node-firefox, we're noticing a blank screen as below 217753380-6ce623dd-ada3-49f2-b14e-f4f57ac77f37

The below issue shows that adding allowPrivilegeEscalation: true is the fix but we have limited privileges in client environment and this permission is not allowed https://github.com/SeleniumHQ/docker-selenium/issues/1786

Is there any alternative to fix this issue or any update on this bug?

PS: Executions on edge and chrome are working as expected

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

containers:
        - resources:
            limits:
              cpu: 700m
              memory: 850Mi
            requests:
              cpu: 700m
              memory: 850Mi
          terminationMessagePath: /dev/termination-log
          name: selenium-firefox
          env:
            - name: SE_EVENT_BUS_HOST
              valueFrom:
                configMapKeyRef:
                  name: seleniumhub
                  key: SE_EVENT_BUS_HOST
            - name: SE_EVENT_BUS_PUBLISH_PORT
              valueFrom:
                configMapKeyRef:
                  name: seleniumhub
                  key: SE_EVENT_BUS_PUBLISH_PORT
            - name: SE_EVENT_BUS_SUBSCRIBE_PORT
              valueFrom:
                configMapKeyRef:
                  name: seleniumhub
                  key: SE_EVENT_BUS_SUBSCRIBE_PORT
            - name: SE_NODE_MAX_SESSIONS
              valueFrom:
                configMapKeyRef:
                  name: seleniumhub
                  key: SE_NODE_MAX_SESSIONS
            - name: SE_NODE_OVERRIDE_MAX_SESSIONS
              valueFrom:
                configMapKeyRef:
                  name: seleniumhub
                  key: SE_NODE_OVERRIDE_MAX_SESSIONS
            - name: SE_SESSION_REQUEST_TIMEOUT
              value: '900'
            - name: SE_NODE_GRID_URL
              valueFrom:
                configMapKeyRef:
                  name: seleniumhub
                  key: SE_NODE_GRID_URL
            - name: SE_VNC_NO_PASSWORD
              valueFrom:
                configMapKeyRef:
                  name: seleniumhub
                  key: SE_VNC_NO_PASSWORD
            - name: SE_NODE_SESSION_TIMEOUT
              valueFrom:
                configMapKeyRef:
                  name: seleniumhub
                  key: SE_NODE_SESSION_TIMEOUT
          securityContext: {}
          ports:
            - containerPort: 5555
              protocol: TCP

Relevant log output

2024-05-22 20:12:46,923 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
2024-05-22 20:12:46,928 INFO RPC interface 'supervisor' initialized
2024-05-22 20:12:46,928 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-05-22 20:12:46,929 INFO supervisord started with pid 9
2024-05-22 20:12:47,931 INFO spawned: 'xvfb' with pid 11
2024-05-22 20:12:47,933 INFO spawned: 'vnc' with pid 12
2024-05-22 20:12:47,934 INFO spawned: 'novnc' with pid 13
2024-05-22 20:12:47,936 INFO spawned: 'selenium-node' with pid 14
2024-05-22 20:12:48,047 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
E: [pulseaudio] main.c: Daemon startup failed.
Home directory not accessible: Permission denied
No PulseAudio daemon running, or not running as session daemon.
Home directory not accessible: Permission denied
No PulseAudio daemon running, or not running as session daemon.
Home directory not accessible: Permission denied
No PulseAudio daemon running, or not running as session daemon.
Generating Selenium Config
Configuring server...
Setting up SE_NODE_HOST...
Setting up SE_NODE_PORT...
2024-05-22 20:12:49,130 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-22 20:12:49,130 INFO success: vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-22 20:12:49,130 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Tracing is disabled
Selenium Grid Node configuration: 
[events]
publish = "tcp://selenium-hub:4442"
subscribe = "tcp://selenium-hub:4443"

[node]
grid-url = "https://selenium-hub-iqp-qa-main.apps.gp2-ocp4-qa.pncint.net/4444"
session-timeout = "300"
override-max-sessions = true
detect-drivers = false
drain-after-session-count = 0
max-sessions = 5

[[node.driver-configuration]]
display-name = "firefox"
stereotype = '{"browserName": "firefox", "browserVersion": "119.0", "platformName": "Linux"}'
max-sessions = 5

Starting Selenium Grid Node...
May 22, 2024 8:12:52 PM org.openqa.selenium.grid.Bootstrap createExtendedClassLoader
WARNING: Extension file or directory does not exist: /opt/selenium/selenium-http-jdk-client.jar
20:12:54.932 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
20:12:55.032 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
20:12:56.535 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://selenium-hub:4442 and tcp://selenium-hub:4443
20:12:56.837 INFO [UnboundZmqEventBus.<init>] - Sockets created
20:12:57.845 INFO [UnboundZmqEventBus.<init>] - Event bus ready
20:12:58.522 INFO [NodeServer.createHandlers] - Reporting self as: http://10.168.10.33:5555
20:12:58.638 INFO [NodeOptions.getSessionFactories] - Detected 1 available processors
20:12:58.641 WARN [NodeOptions.getSessionFactories] - Overriding max recommended number of 1 concurrent sessions. Session stability and reliability might suffer!
20:12:58.641 WARN [NodeOptions.getSessionFactories] - One browser session is recommended per available processor. Safari is always limited to 1 session per host.
20:12:58.641 WARN [NodeOptions.getSessionFactories] - Overriding this value for Internet Explorer is not recommended. Issues related to parallel testing with Internet Explored won't be accepted.
20:12:58.641 WARN [NodeOptions.getSessionFactories] - Double check if enabling 'override-max-sessions' is really needed
20:12:58.642 WARN [NodeOptions.getSessionFactories] - Max sessions set to 5 
20:12:58.941 INFO [NodeOptions.report] - Adding firefox for {"browserName": "firefox","browserVersion": "119.0","platformName": "linux","se:noVncPort": 7900,"se:vncEnabled": true} 5 times
20:12:59.227 INFO [Node.<init>] - Binding additional locator mechanisms: relative
20:13:00.324 INFO [NodeServer$1.start] - Starting registration process for Node http://10.168.10.33:5555
20:13:00.328 INFO [NodeServer.execute] - Started Selenium node 4.15.0 (revision 1d14b5521b): http://10.168.10.33:5555
20:13:00.430 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
20:13:01.434 INFO [NodeServer.lambda$createHandlers$2] - Node has been added
20:20:59.561 INFO [NodeServer.lambda$createHandlers$2] - Node has been added
10:48:06.064 WARN [SeleniumManager.lambda$runCommand$1] - Exception managing firefox: Unable to discover proper geckodriver version in offline mode
10:48:19.537 INFO [LocalNode.newSession] - Session created by the Node. Id: 7b9670f0-1192-4ed5-8000-b3b04f43c6c6, Caps: Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 119.0.1, moz:accessibilityChecks: false, moz:buildID: 20231106151204, moz:debuggerAddress: 127.0.0.1:22644, moz:firefoxOptions: {binary: /usr/bin/firefox, profile: UEsDBBQACAgIAAJWvFgAAAAAAAA...}, moz:geckodriverVersion: 0.33.0, moz:headless: false, moz:platformVersion: 5.14.0-284.48.1.el9_2.x86_64, moz:processID: 52655, moz:profile: /tmp/rust_mozprofiledEMCRv, moz:shutdownTimeout: 60000, moz:webdriverClick: true, moz:windowless: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: wss://selenium-hub-iqp-qa-m..., se:cdpVersion: 85.0, se:name: saurav.kumar288__sanityQAUR..., se:noVncPort: 7900, se:vnc: wss://selenium-hub-iqp-qa-m..., se:vncEnabled: true, se:vncLocalAddress: ws://10.168.10.33:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
10:48:19.744 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "ff4b56c51961e201ac2833a93277fafd","eventTime": 1716893299738741277,"eventName": "HTTP request execution complete","attributes": {"http.client_ip": "10.12.83.139","http.flavor": 1,"http.handler_class": "org.openqa.selenium.remote.http.Route$PredicatedRoute","http.host": "10.168.10.33:5555","http.method": "GET","http.request_content_length": "0","http.scheme": "HTTP","http.status_code": 404,"http.target": "\u002fsession\u002f7b9670f0-1192-4ed5-8000-b3b04f43c6c6\u002falert\u002ftext","http.user_agent": "selenium\u002f4.8.3 (java unix)"}}

10:48:26.192 INFO [ProxyNodeWebsockets.createWsEndPoint] - Establishing connection to ws://10.168.10.33:7900

Operating System

Openshift version: 4.11

Docker Selenium version (image tag)

selenium/node-firefox:4.15

Selenium Grid chart version (chart version)

No response

github-actions[bot] commented 3 months ago

@varsha-rav, 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!

varsha-rav commented 3 months ago

Hi any update one this?

VietND96 commented 3 months ago

Hi @varsha-rav, in your case, the Grid is deployed by sys-admin, and as user/client, you don't have permission to do the workaround, right?

varsha-rav commented 3 months ago

Hi @VietND96 thats correct, we do not have the permissions to apply the workaround in client env

github-actions[bot] commented 3 weeks ago

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.