Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Browserstack cannot forward the request Failed to connect to xxxxx (our corporate proxy server) java.net.ConnectException: Failed to connect #1206

Open
semihural opened this issue Oct 14, 2020 · 0 comments

Comments

@semihural
Copy link

Hi,

We have zalenium running in our k8s cluster and enable Browserstack for Edge tests. We are using our corporate proxy server otherwise we did not able to connect between zalenium and browserstack or zalenium is not running properly in our cluster...So we able to connect but we received an error as below in somewhere after tests are started to run. It can be vary therefore I could not say it was happened for special moment or special test scenario.

I aware of that zalenium tries to connect http://hub-cloud of https.. I do not have any idea it can cause this but I can say there is no connection limit for our proxy server.

Here is how we set capabilities for edge.

caps.setCapability("browserName", "Edge");
                caps.setCapability("browserVersion", "latest-beta");
                browserstackOptions = new HashMap<String, Object>();
                browserstackOptions.put("os", "Windows");
                browserstackOptions.put("osVersion", "10");
                browserstackOptions.put("local", "false");
                browserstackOptions.put("debug", "true");
                System.setProperty("http.proxyHost","xxxxx");
                System.setProperty("http.proxyPort","xxx");
                caps.setCapability("bstack:options", browserstackOptions);
                webDriver = new RemoteWebDriver(new URL(nodeURL), caps);
                break;

Here is zalenium hub log

Selenium Hub started!
Sauce Labs not enabled...
Starting Browser Stack node...
Picked up _JAVA_OPTIONS: -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xx -Dhttp.nonProxyHosts=localhost|127.*|192.*|172.*|10.*|*.svc.cluster|kubernetes.monitoring.svc.cluster.local
14:24:26.258 [Thread-10] INFO  d.z.e.z.registry.ZaleniumRegistry - Registered a node http://hub-cloud.browserstack.com:80
Browser Stack node started!
TestingBot not enabled...
CBT not enabled...
LambdaTest not enabled...
Zalenium is now ready!

Here is zalenium hub log while tests are running

13:13:22.266 [qtp1364497552-20] INFO  o.o.g.w.s.handler.RequestHandler - Got a request to create a new session: Capabilities {browserName: Edge, browserVersion: latest-beta, bstack:options: {debug: true, local: false, os: Windows, osVersion: 10}}
13:13:22.266 [qtp1364497552-20] INFO  d.z.e.z.registry.ZaleniumRegistry - Adding sessionRequest for {browserName=Edge, browserVersion=latest-beta, bstack:options={debug=true, os=Windows, osVersion=10, local=false}}
13:13:22.267 [BrowserStack] INFO  d.z.e.z.p.CloudTestingRemoteProxy - Test will be forwarded to BrowserStack - {browserName=Edge, browserVersion=latest-beta, bstack:options={debug=true, os=Windows, osVersion=10, local=false}}
13:13:22.267 [http://10.6.20.184:40000] INFO  org.openqa.grid.internal.TestSlot - Trying to create a new session on test slot {browserName=BrowserStack, maxInstances=5, platformName=ANY}
13:13:22.267 [http://10.6.20.184:40000] INFO  d.z.e.z.registry.ZaleniumRegistry - Test session with internal key 2468b518-a608-4178-971c-44b240033cb3 assigned to remote (http://10.6.17.12:30002) after 0 seconds (4 ms).
13:13:22.270 [BrowserStack] INFO  d.z.e.z.p.CloudTestingRemoteProxy - Currently using 5 parallel sessions . Trying to start one more.
13:13:22.664 [BrowserStack addTestToDashboard seleniumSessionId [44fd9df96651c59da9cb88ccc9bf9f0a01b58b6c] testCompleted [true]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131305506_COMPLETED/browserstack.log
13:13:23.419 [BrowserStack addTestToDashboard seleniumSessionId [cee4de7e5f0be62f304b41fc1c9dc54f181f9894] testCompleted [true]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131311975_COMPLETED/cee4de7e5f0be62f304b41fc1c9dc54f181f9894-console-logs-v2.txt
13:13:28.764 [BrowserStack addTestToDashboard seleniumSessionId [44fd9df96651c59da9cb88ccc9bf9f0a01b58b6c] testCompleted [true]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131305506_COMPLETED/selenium.log
13:13:29.647 [BrowserStack addTestToDashboard seleniumSessionId [cee4de7e5f0be62f304b41fc1c9dc54f181f9894] testCompleted [true]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131311975_COMPLETED/browserstack.log
13:13:35.620 [BrowserStack addTestToDashboard seleniumSessionId [cee4de7e5f0be62f304b41fc1c9dc54f181f9894] testCompleted [true]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131311975_COMPLETED/selenium.log
13:13:38.686 [BrowserStack addTestToDashboard seleniumSessionId [4658c7a1d21e8653da0b0eaf2f19572529861286] testCompleted [true]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/browserstack__edge_Windows_20201014131332699_COMPLETED.mp4
13:13:41.110 [BrowserStack] WARN  d.z.e.z.p.CloudTestingRemoteProxy - Releasing slot and terminating session due to inactivity.
13:13:44.091 [BrowserStack addTestToDashboard seleniumSessionId [4658c7a1d21e8653da0b0eaf2f19572529861286] testCompleted [true]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131332699_COMPLETED/4658c7a1d21e8653da0b0eaf2f19572529861286-console-logs-v2.txt
13:13:51.666 [BrowserStack addTestToDashboard seleniumSessionId [4658c7a1d21e8653da0b0eaf2f19572529861286] testCompleted [true]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131332699_COMPLETED/browserstack.log
13:13:58.016 [BrowserStack addTestToDashboard seleniumSessionId [4658c7a1d21e8653da0b0eaf2f19572529861286] testCompleted [true]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131332699_COMPLETED/selenium.log
13:14:07.482 [BrowserStack addTestToDashboard seleniumSessionId [9e7b5382973276e154ba5256c335eafb2322b9e9] testCompleted [false]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/browserstack__edge_Windows_20201014131351457_COMPLETED.mp4
13:14:12.920 [BrowserStack addTestToDashboard seleniumSessionId [9e7b5382973276e154ba5256c335eafb2322b9e9] testCompleted [false]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131351457_COMPLETED/9e7b5382973276e154ba5256c335eafb2322b9e9-console-logs-v2.txt
13:14:18.623 [BrowserStack addTestToDashboard seleniumSessionId [9e7b5382973276e154ba5256c335eafb2322b9e9] testCompleted [false]] INFO  d.z.e.z.util.CommonProxyUtilities - File downloaded to /home/seluser/videos/logs/browserstack__edge_Windows_20201014131351457_COMPLETED/browserstack.log
13:14:21.511 [qtp1364497552-60] ERROR o.o.g.w.s.handler.RequestHandler - cannot forward the request Failed to connect to xxxxx (our corporate proxy server)
java.net.ConnectException: Failed to connect to xxxxx (our corporate proxy server)
	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:247)
	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:165)
	at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
	at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
	at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
	at okhttp3.RealCall.execute(RealCall.java:77)
	at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103)
	at org.openqa.grid.internal.TestSession.sendRequestToNode(TestSession.java:422)
	at org.openqa.grid.internal.TestSession.forward(TestSession.java:229)
	at org.openqa.grid.web.servlet.handler.RequestHandler.forwardRequest(RequestHandler.java:99)
	at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:133)
	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:85)
	at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:69)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:865)
	at org.seleniumhq.jetty9.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
	at io.prometheus.client.filter.MetricsFilter.doFilter(MetricsFilter.java:170)
	at org.seleniumhq.jetty9.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.seleniumhq.jetty9.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.seleniumhq.jetty9.server.handler.StatisticsHandler.handle(StatisticsHandler.java:174)
	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.seleniumhq.jetty9.server.Server.handle(Server.java:503)
	at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:364)
	at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:260)
	at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
	at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:103)
	at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
	at org.seleniumhq.jetty9.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:607)
	at okhttp3.internal.platform.Platform.connectSocket(Platform.java:129)
	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:245)
	... 60 common frames omitted
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant