{"action":"created","issue":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/4271","repository_url":"https://api.github.com/repos/SeleniumHQ/selenium","labels_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/4271/labels{/name}","comments_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/4271/comments","events_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/4271/events","html_url":"https://github.com/SeleniumHQ/selenium/issues/4271","id":241088307,"number":4271,"title":"Selenium hub wd/hub/status route returns status:13","user":{"login":"abaird","id":31722,"avatar_url":"https://avatars0.githubusercontent.com/u/31722?v=4","gravatar_id":"","url":"https://api.github.com/users/abaird","html_url":"https://github.com/abaird","followers_url":"https://api.github.com/users/abaird/followers","following_url":"https://api.github.com/users/abaird/following{/other_user}","gists_url":"https://api.github.com/users/abaird/gists{/gist_id}","starred_url":"https://api.github.com/users/abaird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abaird/subscriptions","organizations_url":"https://api.github.com/users/abaird/orgs","repos_url":"https://api.github.com/users/abaird/repos","events_url":"https://api.github.com/users/abaird/events{/privacy}","received_events_url":"https://api.github.com/users/abaird/received_events","type":"User","site_admin":false},"labels":[{"id":182486689,"url":"https://api.github.com/repos/SeleniumHQ/selenium/labels/A-needs%20decision","name":"A-needs decision","color":"e10c02","default":false},{"id":182484652,"url":"https://api.github.com/repos/SeleniumHQ/selenium/labels/C-grid","name":"C-grid","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-06T21:15:36Z","updated_at":"2017-07-20T16:27:33Z","closed_at":null,"body":"OS:  OSX 10.12.5 (Sierra)\r\nSelenium Version: 3.4 latest (since docker run gets the latest version)\r\nDocker-Selenium\r\n\r\nI'm testing the wd/hub/status route for Selenium Grid. I want to be able to use the response as a polling mechanism for when the grid is able to accept requests. I have been lead to believe that a proper response should look something like:\r\n```\r\n{\"state\":\"success\",\"sessionId\":null,\"hCode\":541329526,\"value\":{\"build\":{\"version\":\"3.4.0\",\"revision\":\"unknown\",\"time\":\"unknown\"},\"os\":{\"name\":\"Linux\",\"arch\":\"amd64\",\"version\":\"4.9.31-moby\"},\"java\":{\"version\":\"1.8.0_131\"}},\"class\":\"org.openqa.selenium.remote.Response\",\"status\":0}\r\n```\r\n...and this is the response that I get when I bring up a selenium/standalone-chrome instance. However, when I do this for a grid setup, I get the following:\r\n```\r\n~ % docker run -d -p 4444:4444 --name selenium-hub selenium/hub\r\ncbf61c1f695ac21fae699c24c47f234fa0253413477f4426476a735569b0fa38\r\n~ % docker run -d --link selenium-hub:hub selenium/node-chrome\r\nc712e997620f111b3f45161ad576f05690e076174a069218c9a7e50adff76050\r\n~ % docker run -d --link selenium-hub:hub selenium/node-chrome\r\n9c08bc5b6fe5e665c72dbf7d1df281725351a046c60ebd685adf55205db3cc1c\r\n~ % curl http://localhost:4444/wd/hub/status\r\n{\"status\":13,\"value\":{\"message\":\"Session [(null externalkey)] not available and is not among the last 1000 terminated sessions.\\nActive sessions are[]\",\"class\":\"org.openqa.grid.common.exception.GridException\",\r\n\"stackTrace\":[{\"fileName\":\"ActiveTestSessions.java\",\"className\":\"org.openqa.grid.internal.ActiveTestSessions\",\"methodName\":\"getExistingSession\",\"lineNumber\":110},\r\n{\"fileName\":\"Registry.java\",\"className\":\"org.openqa.grid.internal.Registry\",\"methodName\":\"getExistingSession\",\"lineNumber\":404},\r\n{\"fileName\":\"RequestHandler.java\",\"className\":\"org.openqa.grid.web.servlet.handler.RequestHandler\",\"methodName\":\"getSession\",\"lineNumber\":232},\r\n{\"fileName\":\"RequestHandler.java\",\"className\":\"org.openqa.grid.web.servlet.handler.RequestHandler\",\"methodName\":\"process\",\"lineNumber\":117},\r\n{\"fileName\":\"DriverServlet.java\",\"className\":\"org.openqa.grid.web.servlet.DriverServlet\",\"methodName\":\"process\",\"lineNumber\":83},\r\n{\"fileName\":\"DriverServlet.java\",\"className\":\"org.openqa.grid.web.servlet.DriverServlet\",\"methodName\":\"doGet\",\"lineNumber\":61},\r\n{\"fileName\":\"HttpServlet.java\",\"className\":\"javax.servlet.http.HttpServlet\",\"methodName\":\"service\",\"lineNumber\":687},\r\n{\"fileName\":\"HttpServlet.java\",\"className\":\"javax.servlet.http.HttpServlet\",\"methodName\":\"service\",\"lineNumber\":790},\r\n{\"fileName\":\"ServletHolder.java\",\"className\":\"org.seleniumhq.jetty9.servlet.ServletHolder\",\"methodName\":\"handle\",\"lineNumber\":841},\r\n{\"fileName\":\"ServletHandler.java\",\"className\":\"org.seleniumhq.jetty9.servlet.ServletHandler\",\"methodName\":\"doHandle\",\"lineNumber\":543},\r\n{\"fileName\":\"ScopedHandler.java\",\"className\":\"org.seleniumhq.jetty9.server.handler.ScopedHandler\",\"methodName\":\"nextHandle\",\"lineNumber\":188},\r\n{\"fileName\":\"SessionHandler.java\",\"className\":\"org.seleniumhq.jetty9.server.session.SessionHandler\",\"methodName\":\"doHandle\",\"lineNumber\":1584},\r\n{\"fileName\":\"ScopedHandler.java\",\"className\":\"org.seleniumhq.jetty9.server.handler.ScopedHandler\",\"methodName\":\"nextHandle\",\"lineNumber\":188},\r\n{\"fileName\":\"ContextHandler.java\",\"className\":\"org.seleniumhq.jetty9.server.handler.ContextHandler\",\"methodName\":\"doHandle\",\"lineNumber\":1228},\r\n{\"fileName\":\"ScopedHandler.java\",\"className\":\"org.seleniumhq.jetty9.server.handler.ScopedHandler\",\"methodName\":\"nextScope\",\"lineNumber\":168},\r\n{\"fileName\":\"ServletHandler.java\",\"className\":\"org.seleniumhq.jetty9.servlet.ServletHandler\",\"methodName\":\"doScope\",\"lineNumber\":481},\r\n{\"fileName\":\"SessionHandler.java\",\"className\":\"org.seleniumhq.jetty9.server.session.SessionHandler\",\"methodName\":\"doScope\",\"lineNumber\":1553},\r\n{\"fileName\":\"ScopedHandler.java\",\"className\":\"org.seleniumhq.jetty9.server.handler.ScopedHandler\",\"methodName\":\"nextScope\",\"lineNumber\":166},\r\n{\"fileName\":\"ContextHandler.java\",\"className\":\"org.seleniumhq.jetty9.server.handler.ContextHandler\",\"methodName\":\"doScope\",\"lineNumber\":1130},\r\n{\"fileName\":\"ScopedHandler.java\",\"className\":\"org.seleniumhq.jetty9.server.handler.ScopedHandler\",\"methodName\":\"handle\",\"lineNumber\":141},\r\n{\"fileName\":\"HandlerWrapper.java\",\"className\":\"org.seleniumhq.jetty9.server.handler.HandlerWrapper\",\"methodName\":\"handle\",\"lineNumber\":132},\r\n{\"fileName\":\"Server.java\",\"className\":\"org.seleniumhq.jetty9.server.Server\",\"methodName\":\"handle\",\"lineNumber\":564},\r\n{\"fileName\":\"HttpChannel.java\",\"className\":\"org.seleniumhq.jetty9.server.HttpChannel\",\"methodName\":\"handle\",\"lineNumber\":320},\r\n{\"fileName\":\"HttpConnection.java\",\"className\":\"org.seleniumhq.jetty9.server.HttpConnection\",\"methodName\":\"onFillable\",\"lineNumber\":251},\r\n{\"fileName\":\"AbstractConnection.java\",\"className\":\"org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback\",\"methodName\":\"succeeded\",\"lineNumber\":279},\r\n{\"fileName\":\"FillInterest.java\",\"className\":\"org.seleniumhq.jetty9.io.FillInterest\",\"methodName\":\"fillable\",\"lineNumber\":112},\r\n{\"fileName\":\"ChannelEndPoint.java\",\"className\":\"org.seleniumhq.jetty9.io.ChannelEndPoint$2\",\"methodName\":\"run\",\"lineNumber\":124},\r\n{\"fileName\":\"Invocable.java\",\"className\":\"org.seleniumhq.jetty9.util.thread.Invocable\",\"methodName\":\"invokePreferred\",\"lineNumber\":122},\r\n{\"fileName\":\"ExecutingExecutionStrategy.java\",\"className\":\"org.seleniumhq.jetty9.util.thread.strategy.ExecutingExecutionStrategy\",\"methodName\":\"invoke\",\"lineNumber\":58},\r\n{\"fileName\":\"ExecuteProduceConsume.java\",\"className\":\"org.seleniumhq.jetty9.util.thread.strategy.ExecuteProduceConsume\",\"methodName\":\"produceConsume\",\"lineNumber\":201},\r\n{\"fileName\":\"ExecuteProduceConsume.java\",\"className\":\"org.seleniumhq.jetty9.util.thread.strategy.ExecuteProduceConsume\",\"methodName\":\"run\",\"lineNumber\":133},\r\n{\"fileName\":\"QueuedThreadPool.java\",\"className\":\"org.seleniumhq.jetty9.util.thread.QueuedThreadPool\",\"methodName\":\"runJob\",\"lineNumber\":672},\r\n{\"fileName\":\"QueuedThreadPool.java\",\"className\":\"org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2\",\"methodName\":\"run\",\"lineNumber\":590},\r\n{\"fileName\":\"Thread.java\",\"className\":\"java.lang.Thread\",\"methodName\":\"run\",\"lineNumber\":748}]}}\r\n```\r\nMaybe I have the wrong expectations about the response for selenium/hub, but it doesn't seem like the route should return a stacktrace.\r\n\r\nIs this a bug that needs to be fixed or is there another valid way of getting the status of selenium/hub? I would expect to get {\"status\":0...} or {\"state\":\"success\"...} out of the /wd/hub/status route for selenium/hub."},"comment":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/comments/316757448","html_url":"https://github.com/SeleniumHQ/selenium/issues/4271#issuecomment-316757448","issue_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/4271","id":316757448,"user":{"login":"abaird","id":31722,"avatar_url":"https://avatars0.githubusercontent.com/u/31722?v=4","gravatar_id":"","url":"https://api.github.com/users/abaird","html_url":"https://github.com/abaird","followers_url":"https://api.github.com/users/abaird/followers","following_url":"https://api.github.com/users/abaird/following{/other_user}","gists_url":"https://api.github.com/users/abaird/gists{/gist_id}","starred_url":"https://api.github.com/users/abaird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abaird/subscriptions","organizations_url":"https://api.github.com/users/abaird/orgs","repos_url":"https://api.github.com/users/abaird/repos","events_url":"https://api.github.com/users/abaird/events{/privacy}","received_events_url":"https://api.github.com/users/abaird/received_events","type":"User","site_admin":false},"created_at":"2017-07-20T16:27:33Z","updated_at":"2017-07-20T16:27:33Z","body":"@krmahadevan - thank you for the information. For the /grid/api/hub/status route, if I get a success true out of that what does that mean, that just the hub is up or that the nodes are operational as well? I'm using the docker images of both selenium-standalone and selenium-hub and I want to write a poller to make sure the grid is ready for business before I send jobs to it. Is using /grid/api/hub/status for hub and wd/hub/status route for standalone the right way to pursue this?"}}
{"actor":{"display_login":"abaird"}}