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]: ERROR: Failed to export spans. The request could not be executed. Error message: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:4117 #2423

Closed e-dsouza closed 1 month ago

e-dsouza commented 1 month ago

What happened?

When updated hub, chrome, firefox and edge images to 4.25.0-20240922, the OCP containers has following repeatative error in log, however it doesnt seems to be impacting execution

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

OC deploy - deployed in Openshift

Relevant log output

note this log data is scaped data from image:

14:27:35-153 ERROR (ThrottlingLogger.dolog) Failed to export spans. The request could not be executed. Error message: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:4117

java.net.ConnectException: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:4317 
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:297)
at okhttp3.internal.connection. ExchangeFinder.findConnection (Exchangefinder.kt: 226)
at okhttp3.internal.connection.okhttps.internal.connection.RealConnection.connect(RealConnection.kt:207)

at ukhttp3.internal.connection. Exchangefinder.findfiealthy Connection(Exchangefinder.kt:106) okhttp.internal.connection.Exchangefinder.find(Exchangefinder.kt:74)

at okhttp.internal.connection. RealCall.initExchangeSokhttp(RealCall.kt/255) ckhttp.internal.connection.Connestinterceptor. Intercept (ConnectInterceptor.kt:32)

at okhttp3.internal.http.RealinterceptorChain.proceed (Real InterceptorChain.it:189) okhttp3.internal.cache.CacheInterceptor. intercept (Cache Interceptor.kt:95)

at okhttp3.internal.nttp. RealinterceptorChain.proceed (RealInterceptorChain.kt:100)

at okhttp3.internal.http.BridgeInterceptor. Intercept(BridgeInterceptor.kt:83)

at okhttp.internal.http.RealinterceptorChain.proceed(RealInterceptorChain.kt:100) okhttp3.Internal.http.RetryAndFollowUpInterceptor, intercept(RetryAndFisllodipinterceptor.kt:76)

at okhttp3.internal.http.RealInterceptorChain.proceed (Real InterceptorChain.kt:1059)

okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)

io.opentelemetry.exporter sender.okhttp.internal.BetryInterceptor. Intercept (RetryInterceptor.java:91)

okhttp3.internal.connection.RealCall.getResponsewithinterceptorChainsokhttp(RealCall.kt:201)

at ukhttp3.internal.connection.RealCall AsyncCall.run(RealCall.kt:517)

at java.base/java.util.concurrent.ThreadPoolExecutor.runiorker (ThreadPoolExecutor.java:1136) at java.base/jeve.util.concurrent.ThreadPoolExecutor Surker.run(ThreadPoolExecutor.java (635)

at jave.base/java.lang.Thread.run(Thread.

ad.java:40) Suppressed: Jave.net.ConnectException: Failed to connect to localhost/127.0.0.1:4117

21 more

Caused by:

java.net.ConnertException: Connection refused

at jave.base/sun.nio.ch.rt.g pollConnect (Native Method) at java.base/Sun.nio.ch.Net.pollConnection(het.java:672)

at java.hase/sun.nio.ch.laSocketImpl.timedPinishConnect(NiosocketImpl.java:547)

at java.lhase/sun.nio.ch. NiaSocketImpl.connect(NiosocketImpl.java:602) Jave.base/jave.cet. SocksSocketImpl.connect(Sockssoc (SocksSocketing. I-java:

at java.base/java.net.Socket.connect(Socket.java:633) at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:128)

327)

at okhttp).internal.connection RealConnection.connectSocket(RealConnection.ht:295)

20 more

Caused by: java.net.ConnectExceptioni Connection refused at

jave.hase/sun. sum.nio.ch.Net.pollConnect (Native Method)

at java.base/sum.nio.ch.Net.pollConnectNow(Net.java:672)

at java.hase/sum.nia.ch. NiosocketImpl.timedinishConnect (NloSocketImpl.java:547) at java.base/sum.i.ch. NiasocketImpl.connect(iSocketImpl.java:602)

at

java.hase/java.net.SocksSocketImpl connect(SockaSocketImpl.java:327) at java.hase/java.net.Socket.connect(Socket.java:633)

at http.internal.platform.platform.connectSocket(Platform,kt:128) at akhttp3, Internal.connection, RealConnection.connectSocket(RealConnection.kt:295)

Operating System

Ubuntu

Docker Selenium version (image tag)

4.25.0-20240922

Selenium Grid chart version (chart version)

None

github-actions[bot] commented 1 month ago

@e-dsouza, 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!

VietND96 commented 1 month ago

It is looking for a local Otel backend to push trace due to tracing is enabled by default. To disable it, set SE_ENABLE_TRACING=false

e-dsouza commented 1 month ago

@VietND96 Thank you for the response. I added SE_ENABLE_TRACING: 'false' to ConfigMap, it did remove the ERROR: Failed to export spans. The request could not be executed. Error message: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:4117, from Chrome, Firefox and Edge nodes however it had no impact on hub container(image: selenium-hub:4.25.0-20240922), I still see the error in log.

VietND96 commented 1 month ago

If you are adding to ConfigMap, ensure that all component containers should refer to that CM. Since every component will send its traces data separately. If you are using Helm chart delivered in this repo, just to set tracing.enabled: false

e-dsouza commented 1 month ago

okay, the hub yaml didnt have configMap configuration in it. Thank you.

Aniketvaidhya commented 1 month ago

Hello @e-dsouza @VietND96

I am also facing similar issue. In my case I am getting this error: 11:56:51.331 ERROR [ThrottlingLogger.doLog] - Failed to export spans. The request could not be executed. Error message: Failed to connect to localhost/127.0.0.1:4317 java.net.ConnectException: Failed to connect to localhost/127.0.0.1:4317 at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:297) at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)

Since you have mention about the configMap, I guess you are using K8s for running the cluster. But in my case, I am using the ECS fargate which is using the Task Definition for defining the container configuration.

Can you please confirm where exactly in you Config Map you did the modifications. So, that I can update the same changes i n the Task Definition file that I am using!

VietND96 commented 1 month ago

Hi, if not using K8s, you can directly set env var SE_ENABLE_TRACING=false to all components (in docker compose or docker command). If Task Definition has the concept to share common config across containers, then add a config for env var SE_ENABLE_TRACING to false

Aniketvaidhya commented 1 month ago

Hello @VietND96 I have added the environment variable SE_ENABLE_TRACING=false in my task definition for both the selenium hub and selenium firefox services. This has resolved the issue for selenium firefox but I am still getting the same error for selenium hub container. Thanks for help!

github-actions[bot] commented 1 week 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.