Get remote host/node name from Selenium Grid Hub on error

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Get remote host/node name from Selenium Grid Hub on error

Kendall Schmidt
Occasionally when running tests in a Selenium Grid, some tests get the following error:

org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:  <blah>...

I don't really care about this error, per say, but I do want to know what 'node' the hub was trying to communicate with when this error happens.

I don't necessarily need the 'node' name in the stack trace. I'd be perfectly fine if it was logged somewhere (console?) that I can then direct to my logs via log4j/logback.

Currently I have my logback root level=INFO.  Would it be as simple as changing this to something else like DEBUG?

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/9a2ca799-6a45-4a4f-b6e8-f9eafe969b5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Get remote host/node name from Selenium Grid Hub on error

Steven Zaluk
You can call the following endpoint once the test is initialized:

http://[grid]:4444/grid/api/testsession?session=[sessionid]

This returns a JSON with info on the test session, including which node the test is running on.  I am not sure if this changed in Selenium Grid 3.x.x or not.  I also don't know of anyway to do that if the hub can't establish a connection to the node at all.

--Steve

On Wed, Mar 8, 2017 at 1:45 PM, Kendall Schmidt <[hidden email]> wrote:
Occasionally when running tests in a Selenium Grid, some tests get the following error:

org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:  <blah>...

I don't really care about this error, per say, but I do want to know what 'node' the hub was trying to communicate with when this error happens.

I don't necessarily need the 'node' name in the stack trace. I'd be perfectly fine if it was logged somewhere (console?) that I can then direct to my logs via log4j/logback.

Currently I have my logback root level=INFO.  Would it be as simple as changing this to something else like DEBUG?

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/9a2ca799-6a45-4a4f-b6e8-f9eafe969b5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/CADPXkqyKecEir5NEBj1V6nP-vQ1Y5RJ9wxhzVNdEouMrY4ysug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Get remote host/node name from Selenium Grid Hub on error

Kendall Schmidt
Steve,

Thanks for this info but I think in this case the key issue is that the test didn't successfully initialized, therefore, I have no access to the sessionId to hit the endpoint.

The exception is being thrown during the creation of the RemoteWebDriver (i.e. new RemoteWebDriver(hubUrl, capabilities) call) and the message is relative to the webdriver running on the remote node, hence the 'Unable to connect to host 127.0.0.1' - i.e. localhost.

Ultimately, development teams want to know what host/node in the grid threw the exception to investigate the root cause of the error. Getting back just 127.0.0.1/localhost from the remote webdriver doesn't help.

Am I missing something in your response?

Thanks,
Kendall

On Wednesday, March 8, 2017 at 6:27:47 PM UTC-6, Steven Zaluk wrote:
You can call the following endpoint once the test is initialized:

http://[grid]:4444/grid/api/testsession?session=[sessionid]

This returns a JSON with info on the test session, including which node the test is running on.  I am not sure if this changed in Selenium Grid 3.x.x or not.  I also don't know of anyway to do that if the hub can't establish a connection to the node at all.

--Steve

On Wed, Mar 8, 2017 at 1:45 PM, Kendall Schmidt <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nWAsm0rDEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">kendall....@...> wrote:
Occasionally when running tests in a Selenium Grid, some tests get the following error:

org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:  <blah>...

I don't really care about this error, per say, but I do want to know what 'node' the hub was trying to communicate with when this error happens.

I don't necessarily need the 'node' name in the stack trace. I'd be perfectly fine if it was logged somewhere (console?) that I can then direct to my logs via log4j/logback.

Currently I have my logback root level=INFO.  Would it be as simple as changing this to something else like DEBUG?


--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Get remote host/node name from Selenium Grid Hub on error

Bill Ross

Kendall,

> http://[grid]:4444/grid/api/testsession?session=[sessionid]

This notation implies that you put your grid server's address where indicated, likewise with the session id that your test hopefully has given you, and hit that endpoint with your browser to see the info you want.

Bill

On 3/8/17 4:51 PM, Kendall Schmidt wrote:
Steve,

Thanks for this info but I think in this case the key issue is that the test didn't successfully initialized, therefore, I have no access to the sessionId to hit the endpoint.

The exception is being thrown during the creation of the RemoteWebDriver (i.e. new RemoteWebDriver(hubUrl, capabilities) call) and the message is relative to the webdriver running on the remote node, hence the 'Unable to connect to host 127.0.0.1' - i.e. localhost.

Ultimately, development teams want to know what host/node in the grid threw the exception to investigate the root cause of the error. Getting back just 127.0.0.1/localhost from the remote webdriver doesn't help.

Am I missing something in your response?

Thanks,
Kendall

On Wednesday, March 8, 2017 at 6:27:47 PM UTC-6, Steven Zaluk wrote:
You can call the following endpoint once the test is initialized:

http://[grid]:4444/grid/api/testsession?session=[sessionid]

This returns a JSON with info on the test session, including which node the test is running on.  I am not sure if this changed in Selenium Grid 3.x.x or not.  I also don't know of anyway to do that if the hub can't establish a connection to the node at all.

--Steve

On Wed, Mar 8, 2017 at 1:45 PM, Kendall Schmidt <<a moz-do-not-send="true" href="javascript:" target="_blank" gdf-obfuscated-mailto="nWAsm0rDEAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">kendall....@...> wrote:
Occasionally when running tests in a Selenium Grid, some tests get the following error:

org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:  <blah>...

I don't really care about this error, per say, but I do want to know what 'node' the hub was trying to communicate with when this error happens.

I don't necessarily need the 'node' name in the stack trace. I'd be perfectly fine if it was logged somewhere (console?) that I can then direct to my logs via log4j/logback.

Currently I have my logback root level=INFO.  Would it be as simple as changing this to something else like DEBUG?

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/576b9ed2-9e15-3512-b728-6fda2e87eab0%40cgl.ucsf.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Get remote host/node name from Selenium Grid Hub on error

Steven Zaluk
Hey Kendall,

You are correct - if the hub can't establish a connection to the node at all then this method won't work.  I am not sure how to pull that data back in a situation like that.

--Steve

On Wed, Mar 8, 2017 at 8:12 PM, Bill Ross <[hidden email]> wrote:

Kendall,

> http://[grid]:4444/grid/api/testsession?session=[sessionid]

This notation implies that you put your grid server's address where indicated, likewise with the session id that your test hopefully has given you, and hit that endpoint with your browser to see the info you want.

Bill


On 3/8/17 4:51 PM, Kendall Schmidt wrote:
Steve,

Thanks for this info but I think in this case the key issue is that the test didn't successfully initialized, therefore, I have no access to the sessionId to hit the endpoint.

The exception is being thrown during the creation of the RemoteWebDriver (i.e. new RemoteWebDriver(hubUrl, capabilities) call) and the message is relative to the webdriver running on the remote node, hence the 'Unable to connect to host 127.0.0.1' - i.e. localhost.

Ultimately, development teams want to know what host/node in the grid threw the exception to investigate the root cause of the error. Getting back just 127.0.0.1/localhost from the remote webdriver doesn't help.

Am I missing something in your response?

Thanks,
Kendall

On Wednesday, March 8, 2017 at 6:27:47 PM UTC-6, Steven Zaluk wrote:
You can call the following endpoint once the test is initialized:

http://[grid]:4444/grid/api/testsession?session=[sessionid]

This returns a JSON with info on the test session, including which node the test is running on.  I am not sure if this changed in Selenium Grid 3.x.x or not.  I also don't know of anyway to do that if the hub can't establish a connection to the node at all.

--Steve

On Wed, Mar 8, 2017 at 1:45 PM, Kendall Schmidt <[hidden email]> wrote:
Occasionally when running tests in a Selenium Grid, some tests get the following error:

org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:  <blah>...

I don't really care about this error, per say, but I do want to know what 'node' the hub was trying to communicate with when this error happens.

I don't necessarily need the 'node' name in the stack trace. I'd be perfectly fine if it was logged somewhere (console?) that I can then direct to my logs via log4j/logback.

Currently I have my logback root level=INFO.  Would it be as simple as changing this to something else like DEBUG?

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/576b9ed2-9e15-3512-b728-6fda2e87eab0%40cgl.ucsf.edu.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/CADPXkqzrWmbEMR8WgQ9PqgoAtv9gdKr29GCgN_SqbsQxZG0YuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Get remote host/node name from Selenium Grid Hub on error

Bill Ross
In reply to this post by Bill Ross

> the key issue is that the test didn't successfully initialized,

Oops, my mistake.

Bill


On 3/8/17 5:12 PM, Bill Ross wrote:

Kendall,

> http://[grid]:4444/grid/api/testsession?session=[sessionid]

This notation implies that you put your grid server's address where indicated, likewise with the session id that your test hopefully has given you, and hit that endpoint with your browser to see the info you want.

Bill

On 3/8/17 4:51 PM, Kendall Schmidt wrote:
Steve,

Thanks for this info but I think in this case the key issue is that the test didn't successfully initialized, therefore, I have no access to the sessionId to hit the endpoint.

The exception is being thrown during the creation of the RemoteWebDriver (i.e. new RemoteWebDriver(hubUrl, capabilities) call) and the message is relative to the webdriver running on the remote node, hence the 'Unable to connect to host 127.0.0.1' - i.e. localhost.

Ultimately, development teams want to know what host/node in the grid threw the exception to investigate the root cause of the error. Getting back just 127.0.0.1/localhost from the remote webdriver doesn't help.

Am I missing something in your response?

Thanks,
Kendall

On Wednesday, March 8, 2017 at 6:27:47 PM UTC-6, Steven Zaluk wrote:
You can call the following endpoint once the test is initialized:

http://[grid]:4444/grid/api/testsession?session=[sessionid]

This returns a JSON with info on the test session, including which node the test is running on.  I am not sure if this changed in Selenium Grid 3.x.x or not.  I also don't know of anyway to do that if the hub can't establish a connection to the node at all.

--Steve

On Wed, Mar 8, 2017 at 1:45 PM, Kendall Schmidt <<a moz-do-not-send="true" href="javascript:" target="_blank" gdf-obfuscated-mailto="nWAsm0rDEAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">kendall....@...> wrote:
Occasionally when running tests in a Selenium Grid, some tests get the following error:

org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:  <blah>...

I don't really care about this error, per say, but I do want to know what 'node' the hub was trying to communicate with when this error happens.

I don't necessarily need the 'node' name in the stack trace. I'd be perfectly fine if it was logged somewhere (console?) that I can then direct to my logs via log4j/logback.

Currently I have my logback root level=INFO.  Would it be as simple as changing this to something else like DEBUG?

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/576b9ed2-9e15-3512-b728-6fda2e87eab0%40cgl.ucsf.edu.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/73f229fe-2080-f2fb-9811-14af257b760c%40cgl.ucsf.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Get remote host/node name from Selenium Grid Hub on error

⇜Krishnan Mahadevan⇝
Kendall,

In normal terms you should be able to use the Grid APIs (I built a library called Talk2Grid which makes it more easy) to get details about the node to which the test was routed to.

On a side note, the Grid APIs are all set to go through a major overhaul and you should see a much more RESTish APIs once this PR gets merged.

But in this case, the new session itself has conked. So you wouldn't be able to get information.
The lack of a proper error message being rendered back to you could also be due to the fact that Selenium now prunes through the error message and only if it finds a "Session not created" does it pack the actual reason.

I recently raised a PR for fixing this so that this error bubbles up (just as it used to earlier). This fix should be part of the upcoming Selenium 3.3.0 release. 

So for now, in order to figure out what went wrong with a failed new session, the only option is to look at the console logs.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Thu, Mar 9, 2017 at 7:39 AM, Bill Ross <[hidden email]> wrote:

> the key issue is that the test didn't successfully initialized,

Oops, my mistake.

Bill


On 3/8/17 5:12 PM, Bill Ross wrote:

Kendall,

> http://[grid]:4444/grid/api/testsession?session=[sessionid]

This notation implies that you put your grid server's address where indicated, likewise with the session id that your test hopefully has given you, and hit that endpoint with your browser to see the info you want.

Bill

On 3/8/17 4:51 PM, Kendall Schmidt wrote:
Steve,

Thanks for this info but I think in this case the key issue is that the test didn't successfully initialized, therefore, I have no access to the sessionId to hit the endpoint.

The exception is being thrown during the creation of the RemoteWebDriver (i.e. new RemoteWebDriver(hubUrl, capabilities) call) and the message is relative to the webdriver running on the remote node, hence the 'Unable to connect to host 127.0.0.1' - i.e. localhost.

Ultimately, development teams want to know what host/node in the grid threw the exception to investigate the root cause of the error. Getting back just 127.0.0.1/localhost from the remote webdriver doesn't help.

Am I missing something in your response?

Thanks,
Kendall

On Wednesday, March 8, 2017 at 6:27:47 PM UTC-6, Steven Zaluk wrote:
You can call the following endpoint once the test is initialized:

http://[grid]:4444/grid/api/testsession?session=[sessionid]

This returns a JSON with info on the test session, including which node the test is running on.  I am not sure if this changed in Selenium Grid 3.x.x or not.  I also don't know of anyway to do that if the hub can't establish a connection to the node at all.

--Steve

On Wed, Mar 8, 2017 at 1:45 PM, Kendall Schmidt <[hidden email]> wrote:
Occasionally when running tests in a Selenium Grid, some tests get the following error:

org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:  <blah>...

I don't really care about this error, per say, but I do want to know what 'node' the hub was trying to communicate with when this error happens.

I don't necessarily need the 'node' name in the stack trace. I'd be perfectly fine if it was logged somewhere (console?) that I can then direct to my logs via log4j/logback.

Currently I have my logback root level=INFO.  Would it be as simple as changing this to something else like DEBUG?

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/576b9ed2-9e15-3512-b728-6fda2e87eab0%40cgl.ucsf.edu.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/73f229fe-2080-f2fb-9811-14af257b760c%40cgl.ucsf.edu.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/CANikZLk7iQWdskqCSom80p-Sbh8ZvVyJohWGjcYjiuBhPohfiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Get remote host/node name from Selenium Grid Hub on error

Kendall Schmidt
Kishnan,

I've been watching your pull requests for your new grid hub api's.  I wrote my own about a year ago to get info about the hub queue that I needed to use in conjunction with AWS AutoScaling.

As for Selenium pruning through the error messages and packing the actual reason only if it finds a "Session not created", it seems that a reasonable and possible simple change would be to include the remote host node's hostname and/or IP address in the current message.

Something like:

org.openqa.selenium.WebDriverException: Unable to connect to host <hostname|ip_address> on port 7055 after 45000 ms. Firefox console output:  <blah>...

instead of 'Unable to connect to host 127.0.0.1' ...

I assume this exception is being thrown from the remote host and therefore can obtain it's own hostname and add it to the message.

Maybe?


On Wednesday, March 8, 2017 at 9:22:14 PM UTC-6, Krishnan Mahadevan wrote:
Kendall,

In normal terms you should be able to use the Grid APIs (I built a library called <a href="https://github.com/RationaleEmotions/talk2grid" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FRationaleEmotions%2Ftalk2grid\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJxKOJoOpJNqIonJSb9At_EWrF6A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FRationaleEmotions%2Ftalk2grid\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJxKOJoOpJNqIonJSb9At_EWrF6A&#39;;return true;">Talk2Grid which makes it more easy) to get details about the node to which the test was routed to.

On a side note, the Grid APIs are all set to go through a major overhaul and you should see a much more RESTish APIs once <a href="https://github.com/SeleniumHQ/selenium/pull/3460" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FSeleniumHQ%2Fselenium%2Fpull%2F3460\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFp5K6kHf3e15oy1BaVYSFXZUeesg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FSeleniumHQ%2Fselenium%2Fpull%2F3460\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFp5K6kHf3e15oy1BaVYSFXZUeesg&#39;;return true;">this PR gets merged.

But in this case, the new session itself has conked. So you wouldn't be able to get information.
The lack of a proper error message being rendered back to you could also be due to the fact that Selenium now prunes through the error message and only if it finds a "Session not created" does it pack the actual reason.

I recently raised a <a href="https://github.com/SeleniumHQ/selenium/commit/e6207a6345068a569d8f2f62bd269beaa66d3061" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FSeleniumHQ%2Fselenium%2Fcommit%2Fe6207a6345068a569d8f2f62bd269beaa66d3061\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHWZPTVNBkGVI9p6_y18kf_mg_cDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FSeleniumHQ%2Fselenium%2Fcommit%2Fe6207a6345068a569d8f2f62bd269beaa66d3061\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHWZPTVNBkGVI9p6_y18kf_mg_cDw&#39;;return true;">PR for fixing this so that this error bubbles up (just as it used to earlier). This fix should be part of the upcoming Selenium 3.3.0 release. 

So for now, in order to figure out what went wrong with a failed new session, the only option is to look at the console logs.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/
My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

On Thu, Mar 9, 2017 at 7:39 AM, Bill Ross <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="IGH0w8_MEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ro...@...> wrote:

> the key issue is that the test didn't successfully initialized,

Oops, my mistake.

Bill


On 3/8/17 5:12 PM, Bill Ross wrote:

Kendall,

> http://[grid]:4444/grid/api/testsession?session=[sessionid]

This notation implies that you put your grid server's address where indicated, likewise with the session id that your test hopefully has given you, and hit that endpoint with your browser to see the info you want.

Bill

On 3/8/17 4:51 PM, Kendall Schmidt wrote:
Steve,

Thanks for this info but I think in this case the key issue is that the test didn't successfully initialized, therefore, I have no access to the sessionId to hit the endpoint.

The exception is being thrown during the creation of the RemoteWebDriver (i.e. new RemoteWebDriver(hubUrl, capabilities) call) and the message is relative to the webdriver running on the remote node, hence the 'Unable to connect to host 127.0.0.1' - i.e. localhost.

Ultimately, development teams want to know what host/node in the grid threw the exception to investigate the root cause of the error. Getting back just <a href="http://127.0.0.1/localhost" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F127.0.0.1%2Flocalhost\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEXEEdFq7zCNGUifCmkp5CWeaaczw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F127.0.0.1%2Flocalhost\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEXEEdFq7zCNGUifCmkp5CWeaaczw&#39;;return true;">127.0.0.1/localhost from the remote webdriver doesn't help.

Am I missing something in your response?

Thanks,
Kendall

On Wednesday, March 8, 2017 at 6:27:47 PM UTC-6, Steven Zaluk wrote:
You can call the following endpoint once the test is initialized:

http://[grid]:4444/grid/api/testsession?session=[sessionid]

This returns a JSON with info on the test session, including which node the test is running on.  I am not sure if this changed in Selenium Grid 3.x.x or not.  I also don't know of anyway to do that if the hub can't establish a connection to the node at all.

--Steve

On Wed, Mar 8, 2017 at 1:45 PM, Kendall Schmidt <[hidden email]> wrote:
Occasionally when running tests in a Selenium Grid, some tests get the following error:

org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:  <blah>...

I don't really care about this error, per say, but I do want to know what 'node' the hub was trying to communicate with when this error happens.

I don't necessarily need the 'node' name in the stack trace. I'd be perfectly fine if it was logged somewhere (console?) that I can then direct to my logs via log4j/logback.

Currently I have my logback root level=INFO.  Would it be as simple as changing this to something else like DEBUG?

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="IGH0w8_MEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">selenium-developers+unsubscribe@....
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="IGH0w8_MEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">selenium-developers+unsubscribe@....
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-developers/576b9ed2-9e15-3512-b728-6fda2e87eab0%40cgl.ucsf.edu?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-developers/576b9ed2-9e15-3512-b728-6fda2e87eab0%40cgl.ucsf.edu?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-developers/576b9ed2-9e15-3512-b728-6fda2e87eab0%40cgl.ucsf.edu?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-developers/576b9ed2-9e15-3512-b728-6fda2e87eab0%40cgl.ucsf.edu.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="IGH0w8_MEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">selenium-developers+unsubscribe@....
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-developers/73f229fe-2080-f2fb-9811-14af257b760c%40cgl.ucsf.edu?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-developers/73f229fe-2080-f2fb-9811-14af257b760c%40cgl.ucsf.edu?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-developers/73f229fe-2080-f2fb-9811-14af257b760c%40cgl.ucsf.edu?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-developers/73f229fe-2080-f2fb-9811-14af257b760c%40cgl.ucsf.edu.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/1f85ac6e-c166-4022-8b31-25b2a94a006b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Get remote host/node name from Selenium Grid Hub on error

⇜Krishnan Mahadevan⇝
Kendall,

As for Selenium pruning through the error messages and packing the actual reason only if it finds a "Session not created", it seems that a reasonable and possible simple change would be to include the remote host node's hostname and/or IP address in the current message.

This sounds like a valid request and should be doable. Let me see if I can get to this over the weekend if no one else beats me to it before that :)


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Thu, Mar 9, 2017 at 9:19 AM, Kendall Schmidt <[hidden email]> wrote:
Kishnan,

I've been watching your pull requests for your new grid hub api's.  I wrote my own about a year ago to get info about the hub queue that I needed to use in conjunction with AWS AutoScaling.

As for Selenium pruning through the error messages and packing the actual reason only if it finds a "Session not created", it seems that a reasonable and possible simple change would be to include the remote host node's hostname and/or IP address in the current message.

Something like:

org.openqa.selenium.WebDriverException: Unable to connect to host <hostname|ip_address> on port 7055 after 45000 ms. Firefox console output:  <blah>...

instead of 'Unable to connect to host 127.0.0.1' ...

I assume this exception is being thrown from the remote host and therefore can obtain it's own hostname and add it to the message.

Maybe?


On Wednesday, March 8, 2017 at 9:22:14 PM UTC-6, Krishnan Mahadevan wrote:
Kendall,

In normal terms you should be able to use the Grid APIs (I built a library called Talk2Grid which makes it more easy) to get details about the node to which the test was routed to.

On a side note, the Grid APIs are all set to go through a major overhaul and you should see a much more RESTish APIs once this PR gets merged.

But in this case, the new session itself has conked. So you wouldn't be able to get information.
The lack of a proper error message being rendered back to you could also be due to the fact that Selenium now prunes through the error message and only if it finds a "Session not created" does it pack the actual reason.

I recently raised a PR for fixing this so that this error bubbles up (just as it used to earlier). This fix should be part of the upcoming Selenium 3.3.0 release. 

So for now, in order to figure out what went wrong with a failed new session, the only option is to look at the console logs.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Thu, Mar 9, 2017 at 7:39 AM, Bill Ross <[hidden email]> wrote:

> the key issue is that the test didn't successfully initialized,

Oops, my mistake.

Bill


On 3/8/17 5:12 PM, Bill Ross wrote:

Kendall,

> http://[grid]:4444/grid/api/testsession?session=[sessionid]

This notation implies that you put your grid server's address where indicated, likewise with the session id that your test hopefully has given you, and hit that endpoint with your browser to see the info you want.

Bill

On 3/8/17 4:51 PM, Kendall Schmidt wrote:
Steve,

Thanks for this info but I think in this case the key issue is that the test didn't successfully initialized, therefore, I have no access to the sessionId to hit the endpoint.

The exception is being thrown during the creation of the RemoteWebDriver (i.e. new RemoteWebDriver(hubUrl, capabilities) call) and the message is relative to the webdriver running on the remote node, hence the 'Unable to connect to host 127.0.0.1' - i.e. localhost.

Ultimately, development teams want to know what host/node in the grid threw the exception to investigate the root cause of the error. Getting back just 127.0.0.1/localhost from the remote webdriver doesn't help.

Am I missing something in your response?

Thanks,
Kendall

On Wednesday, March 8, 2017 at 6:27:47 PM UTC-6, Steven Zaluk wrote:
You can call the following endpoint once the test is initialized:

http://[grid]:4444/grid/api/testsession?session=[sessionid]

This returns a JSON with info on the test session, including which node the test is running on.  I am not sure if this changed in Selenium Grid 3.x.x or not.  I also don't know of anyway to do that if the hub can't establish a connection to the node at all.

--Steve

On Wed, Mar 8, 2017 at 1:45 PM, Kendall Schmidt <[hidden email]> wrote:
Occasionally when running tests in a Selenium Grid, some tests get the following error:

org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:  <blah>...

I don't really care about this error, per say, but I do want to know what 'node' the hub was trying to communicate with when this error happens.

I don't necessarily need the 'node' name in the stack trace. I'd be perfectly fine if it was logged somewhere (console?) that I can then direct to my logs via log4j/logback.

Currently I have my logback root level=INFO.  Would it be as simple as changing this to something else like DEBUG?

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developers+unsubscrib[hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/711578d7-26ed-41bf-9ce8-3b906b7c0914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developers+unsubscrib[hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/576b9ed2-9e15-3512-b728-6fda2e87eab0%40cgl.ucsf.edu.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developers+unsubscrib[hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/73f229fe-2080-f2fb-9811-14af257b760c%40cgl.ucsf.edu.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/1f85ac6e-c166-4022-8b31-25b2a94a006b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/CANikZL%3DNWpaVFdp133oicvE36NyJC3BERDDdaJwBfu8TX3krag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.