-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key Error Status using remote webdriver #1332
Comments
Same issue running it with docker-compose Bug reportI'm trying to connect to a remote web browser that is contained on a docker image but I keep receive Key Error: 'status' Expected behaviorA successful connection with the remote selenium To Reproduce
Logs filesshell output errorTraceback (most recent call last):
File "/app/project/tests/__init__.py", line 9, in setUp
self.browser = webdriver.Remote(
File "/opt/venv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/opt/venv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/opt/venv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/opt/venv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 130, in check_response
status = value["status"]
KeyError: 'status'
selenium hub docker container{
"traceId":"8a959195b27555f5bb2779d48c63a170",
"eventTime":1626555129793509544,
"eventName":"HTTP request execution complete",
"attributes":{
"http.flavor":1,
"http.handler_class":"org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue",
"http.host":"192.168.144.2:4444",
"http.method":"POST",
"http.request_content_length":"210",
"http.scheme":"HTTP",
"http.status_code":500,
"http.target":"\u002fsession",
"http.user_agent":"selenium\u002f3.141.0 (python linux)"
}
}
selenium node firefox docker container{
"traceId":"8a959195b27555f5bb2779d48c63a170",
"eventTime":1626555129660825168,
"eventName":"exception",
"attributes":{
"driver.url":"http:\u002f\u002flocalhost:20244",
"exception.message":"Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: Process unexpectedly closed with status 11\nBuild info: version: '4.0.0-rc-1', revision: '74745cf081'\nSystem info: host: '4790491a0bf5', ip: '192.168.144.4', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.25-linuxkit', java.version: '11.0.11'\nDriver info: driver.version: unknown",
"exception.stacktrace":"org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Process unexpectedly closed with status 11\nBuild info: version: '4.0.0-rc-1', revision: '74745cf081'\nSystem info: host: '4790491a0bf5', ip: '192.168.144.4', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.25-linuxkit', java.version: '11.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:129)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:63)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:143)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:312)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:52)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:64)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:86)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:240)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.base\u002fjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\n",
"exception.type":"org.openqa.selenium.SessionNotCreatedException",
"logger":"org.openqa.selenium.grid.node.config.DriverServiceSessionFactory",
"session.capabilities":"{\"acceptInsecureCerts\": true,\"browserName\": \"firefox\",\"se:vncEnabled\": true}\n"
}
} test codeimport unittest
from selenium import webdriver
class FunctionalBaseTest(unittest.TestCase):
def setUp(self):
selenium_url = "http://selenium-hub:4444/wd/hub"
options = webdriver.FirefoxOptions()
capabilities = webdriver.DesiredCapabilities.FIREFOX.copy()
self.browser = webdriver.Remote(
command_executor=selenium_url,
options=options,
desired_capabilities=capabilities
)
def test_site_homepage_is_runnign(self):
self.browser.get('http://localhost')
self.assertIn('Django', self.browser.title)
self.browser.close()
def tearDown(self):
self.browser.quit() docker-compose# Selenium Services
firefox:
image: selenium/node-firefox:4
container_name: selenium_grid_firefox_api
shm_size: 2gb
depends_on:
- selenium-hub
environment:
- SE_EVENT_BUS_HOST=selenium-hub
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
ports:
- "6900:5900"
networks:
- vlan
selenium-hub:
image: selenium/hub:4
container_name: selenium_grid_hub
ports:
- "4442:4442"
- "4443:4443"
- "4444:4444"
networks:
- vlan EnvironmentSystem Version: macOS 11.4 (20F71) |
Similar issue here! shell output error
Directory Structure:
Dockerfile
docker-compose.yml
requirements.txt
example.py
Extra Info: macOS Big Sur(version 11.4)
|
Sadly we do not support M1/ARM yet, please follow #1076 for updates. |
🐛 Bug Report
I'm trying to connect to a remote web browser that is contained on a docker image but I keep receive Key Error: 'status'
Docker logs
13:30:35.911 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "b3178fbaced4c4d64730ddfee96c15ac","spanId": "b5f202ef567e1c79","spanKind": "INTERNAL","eventTime": 1626355835821414211,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002flocalhost:4059","exception.message": "Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.\n (chrome not reachable)\n (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)\nBuild info: version: '4.0.0-beta-3', revision: '909239cd9f'\nSystem info: host: 'c4578c827a10', ip: '172.21.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.25-linuxkit', java.version: '1.8.0_282'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.\n (chrome not reachable)\n (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)\nBuild info: version: '4.0.0-beta-3', revision: '909239cd9f'\nSystem info: host: 'c4578c827a10', ip: '172.21.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.25-linuxkit', java.version: '1.8.0_282'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:116)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:60)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:143)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:325)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:52)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:64)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:86)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:240)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"chrome\",\"version\": \"\"}\n"}}
To Reproduce
docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.0.0-rc-1-prerelease-20210713
Expected behavior
A successful connection with the remote selenium
Test script reproducing this issue (when applicable)
Environment
OS: OSX 11.4
Docker-Selenium image version: selenium/standalone-chrome:4.0.0-rc-1-prerelease-20210713
-->
Docker version 20.10.7, build f0df350
The text was updated successfully, but these errors were encountered: