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.99k stars 2.51k forks source link

[🐛 Bug]: Helm Chart: Router and Browser nodes failing with OpenTelemetryTracer #1758

Closed arunkumar-muthusamy-personal closed 1 year ago

arunkumar-muthusamy-personal commented 1 year ago

What happened?

Deployed the helm chart as is helm install selenium-grid docker-selenium/selenium-grid --set isolateComponents=true on OpenShift v4.9 (Kubernetes version # v1.22.8), router and browser node deployments are failing. Other components are running healthy.

image

Command used to start Selenium Grid with Docker

Followed steps outlined in: https://github.com/SeleniumHQ/docker-selenium/tree/trunk/charts/selenium-grid

$`helm install selenium-grid docker-selenium/selenium-grid --set isolateComponents=true`

Relevant log output

Router failed with following error

2022-12-28 01:44:16,702 INFO Included extra file "/etc/supervisor/conf.d/selenium-grid-router.conf" during parsing
2022-12-28 01:44:16,706 INFO RPC interface 'supervisor' initialized
2022-12-28 01:44:16,706 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2022-12-28 01:44:16,706 INFO supervisord started with pid 9
2022-12-28 01:44:17,709 INFO spawned: 'selenium-grid-router' with pid 11
Starting Selenium Grid Router...
2022-12-28 01:44:17,723 INFO success: selenium-grid-router entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Tracing is disabled
01:44:26.802 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
01:44:26.812 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.dynatrace.agent.util.classvalue.InstrumentedClassValueAccess$1 to field java.lang.Class.dynatraceClassValue
WARNING: Please consider reporting this to the maintainers of com.dynatrace.agent.util.classvalue.InstrumentedClassValueAccess$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.openqa.selenium.grid.Bootstrap.runMain(Bootstrap.java:77)
    at org.openqa.selenium.grid.Bootstrap.main(Bootstrap.java:70)
Caused by: java.lang.UnsatisfiedLinkError: 'void com.dynatrace.agent.AgentNative.addProcessGroupTech(java.lang.String, java.lang.String, java.lang.String)'
    at com.dynatrace.agent.AgentNative.addProcessGroupTech(Native Method)
    at com.dynatrace.agent.Agent.addProcessGroupTech(Agent.java:337)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospectionUtils.reportDetectedVersion(TechnologyDetectionIntrospectionUtils.java:94)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospectionUtils.reportDetectedVersion(TechnologyDetectionIntrospectionUtils.java:78)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospectionUtils.reportDetectedVersion(TechnologyDetectionIntrospectionUtils.java:74)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospection.OpenTelemetryConstructorExit(TechnologyDetectionIntrospection.java:622)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospectionWrapper.OpenTelemetryConstructorExit(TechnologyDetectionIntrospectionWrapper.java:270)
    at io.opentelemetry.sdk.OpenTelemetrySdk.<init>(OpenTelemetrySdk.java:37)
    at io.opentelemetry.sdk.OpenTelemetrySdkBuilder.build(OpenTelemetrySdkBuilder.java:114)
    at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:333)
    at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.createTracer(OpenTelemetryTracer.java:81)
    at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.getInstance(OpenTelemetryTracer.java:60)
    at org.openqa.selenium.grid.log.LoggingOptions.getTracer(LoggingOptions.java:94)
    at org.openqa.selenium.grid.router.httpd.RouterServer.createHandlers(RouterServer.java:121)
    at org.openqa.selenium.grid.TemplateGridServerCommand.asServer(TemplateGridServerCommand.java:41)
    at org.openqa.selenium.grid.router.httpd.RouterServer.execute(RouterServer.java:204)
    at org.openqa.selenium.grid.TemplateGridCommand.lambda$configure$4(TemplateGridCommand.java:129)
    at org.openqa.selenium.grid.Main.launch(Main.java:83)
    at org.openqa.selenium.grid.Main.go(Main.java:57)
    at org.openqa.selenium.grid.Main.main(Main.java:42)
    ... 6 more
2022-12-28 01:44:28,017 INFO exited: selenium-grid-router (exit status 1; not expected)
Trapped SIGTERM/SIGINT/x so shutting down supervisord...
2022-12-28 01:46:06,122 WARN received SIGTERM indicating exit request
Shutdown complete

browser nodes (example node-chome) failed with following errors:

2022-12-28 01:46:10,987 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
2022-12-28 01:46:10,991 INFO RPC interface 'supervisor' initialized
2022-12-28 01:46:10,991 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2022-12-28 01:46:10,992 INFO supervisord started with pid 9
2022-12-28 01:46:11,995 INFO spawned: 'xvfb' with pid 11
2022-12-28 01:46:12,000 INFO spawned: 'vnc' with pid 12
2022-12-28 01:46:12,004 INFO spawned: 'novnc' with pid 13
2022-12-28 01:46:12,007 INFO spawned: 'selenium-node' with pid 14
E: [pulseaudio] main.c: Daemon startup failed.
2022-12-28 01:46:12,044 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
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...
Setting up SE_NODE_GRID_URL...
Tracing is disabled
Selenium Grid Node configuration:
[events]
publish = "tcp://selenium-event-bus:4442"
subscribe = "tcp://selenium-event-bus:4443"

[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": "108.0", "platformName": "Linux"}'
max-sessions = 1

Starting Selenium Grid Node...
2022-12-28 01:46:13,149 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-12-28 01:46:13,149 INFO success: vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-12-28 01:46:13,149 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
01:46:21.136 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
01:46:21.146 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.dynatrace.agent.util.classvalue.InstrumentedClassValueAccess$1 to field java.lang.Class.dynatraceClassValue
WARNING: Please consider reporting this to the maintainers of com.dynatrace.agent.util.classvalue.InstrumentedClassValueAccess$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.openqa.selenium.grid.Bootstrap.runMain(Bootstrap.java:77)
    at org.openqa.selenium.grid.Bootstrap.main(Bootstrap.java:70)
Caused by: java.lang.UnsatisfiedLinkError: 'void com.dynatrace.agent.AgentNative.addProcessGroupTech(java.lang.String, java.lang.String, java.lang.String)'
    at com.dynatrace.agent.AgentNative.addProcessGroupTech(Native Method)
    at com.dynatrace.agent.Agent.addProcessGroupTech(Agent.java:337)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospectionUtils.reportDetectedVersion(TechnologyDetectionIntrospectionUtils.java:94)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospectionUtils.reportDetectedVersion(TechnologyDetectionIntrospectionUtils.java:78)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospectionUtils.reportDetectedVersion(TechnologyDetectionIntrospectionUtils.java:74)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospection.OpenTelemetryConstructorExit(TechnologyDetectionIntrospection.java:622)
    at com.dynatrace.agent.introspection.agentcore.TechnologyDetectionIntrospectionWrapper.OpenTelemetryConstructorExit(TechnologyDetectionIntrospectionWrapper.java:270)
    at io.opentelemetry.sdk.OpenTelemetrySdk.<init>(OpenTelemetrySdk.java:37)
    at io.opentelemetry.sdk.OpenTelemetrySdkBuilder.build(OpenTelemetrySdkBuilder.java:114)
    at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:333)
    at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.createTracer(OpenTelemetryTracer.java:81)
    at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.getInstance(OpenTelemetryTracer.java:60)
    at org.openqa.selenium.grid.log.LoggingOptions.getTracer(LoggingOptions.java:94)
    at org.openqa.selenium.grid.node.httpd.NodeServer.createHandlers(NodeServer.java:115)
    at org.openqa.selenium.grid.node.httpd.NodeServer.asServer(NodeServer.java:184)
    at org.openqa.selenium.grid.node.httpd.NodeServer.execute(NodeServer.java:239)
    at org.openqa.selenium.grid.TemplateGridCommand.lambda$configure$4(TemplateGridCommand.java:129)
    at org.openqa.selenium.grid.Main.launch(Main.java:83)
    at org.openqa.selenium.grid.Main.go(Main.java:57)
    at org.openqa.selenium.grid.Main.main(Main.java:42)
    ... 6 more
Exception in thread "Thread-1" java.lang.NullPointerException
    at org.openqa.selenium.grid.node.httpd.NodeServer.lambda$new$0(NodeServer.java:80)
    at java.base/java.lang.Thread.run(Thread.java:829)
2022-12-28 01:46:21,758 INFO exited: selenium-node (exit status 1; not expected)
2022-12-28 01:46:21,758 WARN received SIGINT indicating exit request
2022-12-28 01:46:21,758 INFO waiting for xvfb, vnc, novnc to die
2022-12-28 01:46:23,761 INFO stopped: novnc (terminated by SIGTERM)
2022-12-28 01:46:24,763 INFO stopped: vnc (terminated by SIGTERM)
2022-12-28 01:46:24,764 INFO waiting for xvfb to die
2022-12-28 01:46:25,765 INFO stopped: xvfb (terminated by SIGTERM)


### Operating System

Linux

### Docker Selenium version (tag)

4.7.2-20221219
jaspreetssethi commented 1 year ago

Any update on this issue? I am facing same issue when deploying anything past app version 4.5.0. Deployment is setting isolateComponents=false in my case while deploying to EKS.

Any help regarding this would be greatly appreciated.

diemol commented 1 year ago

@jaspreetssethi we have not had time to triage this. What happens if you make changes to the chart locally? Does it work?

jaspreetssethi commented 1 year ago

@diemol Changing the cart seems to have no effect... tried adding annotation "dynatrace.com/inject: false" and also environment variable of OTEL_SDK_DISABLED="true".

The only thing that worked was to disable Dynatrace deep monitoring on the selenium-* pods entirely. But that is not a good solution IMO.

diemol commented 1 year ago

The only thing that worked was to disable Dynatrace deep monitoring on the selenium-* pods entirely.

Is that something you added to the pods? I am not aware we offer Dynatrace monitoring out of the box.

jaspreetssethi commented 1 year ago

You provide OpenTelemetry Instrumentation and Dynatrace is one such agent that is configured on our cluster.

diemol commented 1 year ago

How are you enabling the instrumentation? We provide now this docker compose as an example https://github.com/SeleniumHQ/docker-selenium/blob/trunk/docker-compose-v3-tracing.yml

diemol commented 1 year ago

Closing as we did not get an answer.

github-actions[bot] commented 11 months ago

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.