Selenium grid : I/O exception (java.net.SocketException) caught when processing request: Permission denied: connect

Today, in this write-up, I am going to share the resolution of an issue which is not a frequent one and will not come rapidly, but yeah I have seen this issue while working with the Selenium grid, so I am sharing this with you all.

Today, in this write-up, I am going to share the resolution of an issue which is not a frequent one and will not come rapidly, but yeah I have seen this issue while working with the Selenium grid, so I am sharing this with you all.


ERROR Stack Trace

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\mjain>cd Downloads\Jar
C:\Users\mjain\Downloads\Jar>java -jar selenium-server-standalone-2.42.2.jar -role hub
Sep 01, 2014 1:57:42 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid server
2014-09-01 13:57:45.752:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT
2014-09-01 13:57:45.907:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null}
2014-09-01 13:57:45.939:INFO:osjs.AbstractConnector:Started SocketConnector@0.0.0.0:4444
Sep 01, 2014 2:26:08 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request: Permission denied: connect
Sep 01, 2014 2:26:08 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request
Sep 01, 2014 2:26:08 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request: Permission denied: connect
Sep 01, 2014 2:26:08 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request
Sep 01, 2014 2:26:08 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request: Permission denied: connect
Sep 01, 2014 2:26:08 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request
Sep 01, 2014 2:26:09 PM org.openqa.grid.selenium.proxy.DefaultRemoteProxy isAlive
WARNING: Failed to check status of node: Permission denied: connect
Sep 01, 2014 2:26:14 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request: Permission denied: connect
Sep 01, 2014 2:26:14 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request
Sep 01, 2014 2:26:14 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request: Permission denied: connect
Sep 01, 2014 2:26:14 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request
Sep 01, 2014 2:26:14 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request: Permission denied: connect
Sep 01, 2014 2:26:14 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request
Sep 01, 2014 2:26:14 PM org.openqa.grid.selenium.proxy.DefaultRemoteProxy isAlive
WARNING: Failed to check status of node: Permission denied: connect
Sep 01, 2014 2:26:14 PM org.openqa.grid.selenium.proxy.DefaultRemoteProxy onEvent
WARNING: Marking the node as down. Cannot reach the node for 2 tries.

Steps which I have taken when I got this issue

  • Step1 Start selenium grid hub
java -jar selenium-server-standalone-3.4.0.jar -role hub
  • Step2 Start a node
java -Dwebdriver.chrome.driver=E:chromedriver.exe -jar selenium-server-standalone-3.4.0.jar -role node -hub http://192.168.1.XX:4444/grid/register
  • Step 3 Start executing test scripts.
  • Step4 You will get the above error.

Solution

You will get this error only and only when some other Virtual Private Network is connected on your machine. Such that there is some conflict in the IP which is causing the problems in re-directions of requests.

So to avoid this Error make sure you are not on any VPN connectivity, or for that matter, if you want to work on VPN then make sure you are providing the whole IP(192.168.1.23) rather than Host-name(localhost or MyMachine, etc).

Once you will apply any of the above steps then, you can easily get rid of this issue. This worked for me, I will be more than happy to answer your queries/feedback/revert over the same.

Author: Khyati Sehgal

Khyati has more than 12 years of experience in quality assurance engineering. Khyati has worked extensively on Manual and Automation testing of various technologies and domains like data quality. From last 6 years, She is leading QA Activities on Agile/Scrum projects while continuously contributing in playing role as a Scrum master, continuous integration, iteration planning, facilitating requirement analysis and closure. On automation front, She has explored gui, web services and mobile automation. Tools/ Technologies used:- Selenium/WebDriver, Core Java, JUnit, TestNG, Maven, SoapUI. Jenkins, Appium, Selenium backed and selenium remote driver. Have delve into android phone/tab of verison upto 6 (marshmallow), ios phone/i pad, and mobile websites

4 thoughts on “Selenium grid : I/O exception (java.net.SocketException) caught when processing request: Permission denied: connect”

    1. we can change the default port by adding an optional parameter port, using

      -host
      To view the status of the hub, open a browser window and navigate to https://localhost:4444/grid/console
      Type the following command

      java -jar selenium-server-standalone-.jar -role node -hub https://localhost:4444/grid/register
      NOTE: We can change this and other browser settings as well by passing the parameters to each -browser switch (each switch represents a node based on your parameters). If you use the -browser parameter, the default browsers will be ignored and only what you specify command line will be used. The node can be configured in two different ways, One is by specifying command-line parameters, the other is by specifying by a json file.

      Like

Leave a comment