selenium: [🐛 Bug]: Unable to obtain: Capabilities -> Issue still present in 4.15
What happened?
Occasionally in our tests we get this error. I can’t see any thing special that happens, it is just that sometimes we cant get a session from the grid.
Our setup is like: Kubernetes for 1 hub with selenium/hub:4.15 4 Nodes based on selenium/node-base:4.15 all with different capabilities (3 nodes with mtls certs inserted and 1 node “vanilla”)
All nodes have “manually installed” browsers as in we install chrome, edge and firefox it in the dockerfile.
All nodes are setup with this config:
[node]
session-timeout = "300"
override-max-sessions = true
detect-drivers = false
drain-after-session-count = 0
max-sessions = 3
How can we reproduce the issue?
I am not really sure.. But run large testsuites with the same setup..
Relevant log output
TEST OUTPUT:
Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--start-maximized, --ignore-certificate-errors, --no-default-browser-check, --enable-logging], extensions: [Q3IyNAMAAABFAgAAEqwECqYCMII...]}, goog:loggingPrefs: {browser: ALL, driver: ALL, performance: ALL}, networkname:applicationName: invanare, nodename:applicationName: invanare, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json]
HUB LOGG:
2023-11-02T15:43:03.876406685Z 16:43:03.874 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to create session: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--start-maximized, --ignore-certificate-errors, --no-default-browser-check, --enable-logging], extensions: [Q3IyNAMAAABFAgAAEqwECqYCMII...]}, goog:loggingPrefs: {browser: ALL, driver: ALL, performance: ALL}, networkname:applicationName: invanare, nodename:applicationName: invanare, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json]
2023-11-02T15:43:03.876427114Z
NODE LOGG:
2023-11-02T15:43:03.806141219Z 16:43:03.802 WARN [DriverServiceSessionFactory.apply] - Error while creating sess
ion with the driver service. Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--start-maximized, --ignore-certificate-errors, --no-default-browser-check, --enable-logging], extensions: [Q3IyNAMAAABFAgAAEqwECqYCMII...]}, goog:loggingPrefs: {browser: ALL, driver: ALL, performance: ALL}, networkname:applicationName: invanare, nodename:applicationName: invanare, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json]
2023-11-02T15:43:03.806184939Z
2023-11-02T15:43:03.806188804Z Build info: version: '4.15.0', revision: '1d14b5521b'
2023-11-02T15:43:03.806191602Z System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-148-generic', java.version: '11.0.20.1'
2023-11-02T15:43:03.806194038Z Driver info: driver.version: unknown
2023-11-02T15:43:03.862931362Z 16:43:03.862 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the driver service. Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--start-maximized, --ignore-certificate-errors, --no-default-browser-check, --enable-logging], extensions: [Q3IyNAMAAABFAgAAEqwECqYCMII...]}, goog:loggingPrefs: {browser: ALL, driver: ALL, performance: ALL}, networkname:applicationName: invanare, nodename:applicationName: invanare, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json]
2023-11-02T15:43:03.862962388Z
2023-11-02T15:43:03.862967328Z Build info: version: '4.15.0', revision: '1d14b5521b'
2023-11-02T15:43:03.862971199Z System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-148-generic', java.version: '11.0.20.1'
2023-11-02T15:43:03.862974749Z Driver info: driver.version: unknown
2023-11-02T15:43:03.862995981Z 16:43:03.862 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: Capabilities {browserName: chrome, goog:chromeOpt
ions: {args: [--start-maximized, --ignore-certificate-errors, --no-default-browser-check, --enable-logging], extensions: [Q3IyNAMAAABFAgAAEqwECqYCMII...]}, goog:loggingPrefs: {browser: ALL, driver: ALL, performance: ALL}, networkname:applicationName: invanare, nodename:applicationName: invanare, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json]
2023-11-02T15:43:03.862999390Z
2023-11-02T15:43:03.863002753Z Build info: version: '4.15.0', revision: '1d14b5521b'
2023-11-02T15:43:03.863005955Z System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-148-generic', java.version: '11.0.20.1'
2023-11-02T15:43:03.863009181Z Driver info: driver.version: unknown
2023-11-02T15:43:03.863016145Z at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:25)
2023-11-02T15:43:03.863019378Z at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:13)
2023-11-02T15:43:03.863022575Z at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:135)
2023-11-02T15:43:03.863026075Z at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:72)
2023-11-02T15:43:03.863030038Z at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
2023-11-02T15:43:03.863033489Z at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:464)
2023-11-02T15:43:03.863036588Z at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
2023-11-02T15:43:03.863039667Z at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:193)
2023-11-02T15:43:03.863043314Z at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
2023-11-02T15:43:03.863046561Z at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
2023-11-02T15:43:03.863049787Z at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandle
r.execute(SpanWrappedHttpHandler.java:87)
2023-11-02T15:43:03.863053090Z at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
2023-11-02T15:43:03.863069173Z at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:345)
2023-11-02T15:43:03.863072335Z at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
2023-11-02T15:43:03.863075471Z at org.openqa.selenium.grid.node.Node.execute(Node.java:262)
2023-11-02T15:43:03.863078622Z at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:345)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
2023-11-02T15:43:03.863085184Z at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)
2023-11-02T15:43:03.863088371Z at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
2023-11-02T15:43:03.863092190Z at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
2023-11-02T15:43:03.863095368Z at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
2023-11-02T15:43:03.863098424Z at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
2023-11-02T15:43:03.863101515Z at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)
2023-11-02T15:43:03.863104560Z at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
2023-11-02T15:43:03.863107893Z at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2023-11-02T15:43:03.863111152Z at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2023-11-02T15:43:03.863114379Z at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2023-11-02T15:43:03.863117667Z at java.base/java.lang.Thread.run(Thread.java:829)
2023-11-02T15:43:03.863121464Z Caused by: org.openqa.selenium.WebDriverException: Failed to parse json output, executed: [--browser, chrome, --output, json]
2023-11-02T15:43:03.863124322Z
2023-11-02T15:43:03.863127377Z Build info: version: '4.15.0', revision: '1d14b5521b'
2023-11-02T15:43:03.863130468Z System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-148-generic', java.version: '11.0.20.1'
2023-11-02T15:43:03.863133769Z Driver info: driver.version: unknown
2023-11-02T15:43:03.863137151Z at org.openqa.selenium.manager.SeleniumManager.runCommand(SeleniumManager.java:159)
2023-11-02T15:43:03.863140268Z at org.openqa.selenium.manager.SeleniumManager.getDriverPath(SeleniumManager.java:287)
at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:22)
2023-11-02T15:43:03.863146600Z ... 27 more
2023-11-02T15:43:03.863149498Z
2023-11-02T15:43:03.864350710Z 16:43:03.863 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "07f2c28742f721dd37ba3f618ff800b0","eventTime": 1698939783805096190,"eventName": "exception","attributes": {"exception.message": "Error while creating session with the driver service. Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--start-maximized, --ignore-certificate-errors, --no-default-browser-check, --enable-logging], extensions: [Q3IyNAMAAABFAgAAEqwECqYCMII...]}, goog:loggingPrefs: {browser: ALL, driver: ALL, performance: ALL}, networkname:applicationName: invanare, nodename:applicationName: invanare, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json]\n\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-148-generic', java.version: '11.0.20.1'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--start-maximized, --ignore-certificate-errors, --no-default-browser-check, --enable-logging], extensions: [Q3IyNAMAAABFAgAAEqwECqYCMII...]}, goog:loggingPrefs: {browser: ALL, driver: ALL, performance: ALL}, networkname:applicationName: invanare, nodename:applicationName: invanare, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json]\n\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-148-generic', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFin
der.java:25)\n\tat org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:13)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:135)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:72)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:464)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:193)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:345)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:262)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:345)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\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:63)\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:63)\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)\nCaused by: org.openqa.selenium.WebDriverException: Failed to parse json output, executed: [--browser, chrome, --output, json]\n\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-148-generic', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.manager.SeleniumManager.runCommand(SeleniumManager.java:159)\n\tat org.openqa.selenium.manager.SeleniumManager.getDriverPath(SeleniumManager.java:287)\n\tat org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:22)\n\t... 27 more\n","exception.type": "org.openqa.selenium.remote.NoSuchDriverException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"chrome\",\"goog:chromeOptions\": {\"args\": [\"--start-maximized\",\"--ignore-certificate-errors\",\"--no-default-browser-check\",\"--enable-logging\"],\"extensions\": [\"Q3IyNAMAAABFAgAAEqwECqYCMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyVH9Huxh4Nf2mlfYZNjT0HYTc2OrUUZpSMAQ9mHilPGmkGVnllBpNsStuLC8Df8eL\\u002f0d\\u002fR\\u002fRLuQe2wtPt5A9wYJZ6Pj1r8cQN6cKno6TwzQUdrXteCgkA+dbbkfMXLF9oyBWQiLQZ5S8cmHxjiONr5bLygjDdJD5ayr1VUfYjXxJHMrSnBLRhQLQyROYH4ncEhY40HeEVWuPjOiBzERJHnmMGm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IxMR5n3uxkdgyEAKOsLpD4MqAj3VpIxG4zA6sMegGHniu0rHPFHouidWJFvFYsccu1ssToZBzv95IQXpdLE8QyktHb7dAZTTMgT85QMXeUhOHPotAMTQgb8UnR39QDsxPee\\u002f\\u002fGtzre2rzRtoT0NSFTeVO6trdXv2D0jvcod7rj96SFy5og9YEpmIInUEsBAgAAFAAACAgA73AsT9s0DMv8AAAAgAEAAA0AAAAAAAAAAQAAAAAAAAAAAGJhY2tncm91bmQuanNQSwECAAAUAAAICADqcCxPMpwmx7AAAAAnAQAADQAAAAAAAAABAAAAAAAnAQAAbWFuaWZlc3QuanNvblBLBQYAAAAAAgACAHYAAAACAgAAAAA=\"]},\"goog:loggingPrefs\": {\"browser\": \"ALL\",\"performance\": \"ALL\",\"driver\": \"ALL\"},\"networkname:applicationName\": \"invanare\",\"nodename:applicationName\": \"invanare\",\"platformName\": \"linux\",\"se:noVncPort\": 7900,\"se:vncEnabled\": true}\n"}}
2023-11-02T15:43:03.864404146Z
2023-11-02T15:43:03.865137807Z 16:43:03.864 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "07f2c28742f721dd37ba3f618ff800b0","eventTime": 1698939783863436494,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {browserName: chrome, goog:chromeOptions: {args: [--start-maximized, --ignore-certificate-errors, --no-default-browser-check, --enable-logging], extensions: [Q3IyNAMAAABFAgAAEqwECqYCMII...]}, goog:loggingPrefs: {browser: ALL, driver: ALL, performance: ALL}, networkname:applicationName: invanare, nodename:applicationName: invanare}","session.request.downstreamdialect": "[W3C]"}}
2023-11-02T15:43:03.
865149486Z
2023-11-02T15:43:03.998859466Z 16:43:03.998 WARN [SeleniumManager.lambda$runCommand$1] - Exception managing chrome: Unable to discover proper chromedriver version in offline mode
Operating System
Runs on docker
Selenium version
4.15
What are the browser(s) and version(s) where you see this issue?
Latest Chrome, Edge, Firefox
What are the browser driver(s) and version(s) where you see this issue?
Latest of each
Are you using Selenium Grid?
Yes. 4.15.
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Reactions: 2
- Comments: 90 (42 by maintainers)
Commits related to this issue
- [java] Use process builder to execute SM in Java (fix #13091) — committed to SeleniumHQ/selenium by bonigarcia 8 months ago
- [java] ensure the complete output is read #13091 — committed to SeleniumHQ/selenium by joerg1985 8 months ago
- [java] Use process builder to execute SM in Java (fix #13091) — committed to SeleniumHQ/selenium by bonigarcia 8 months ago
I released a new set of Docker images where the browser driver path is set via properties, and with that, Selenium Manager is avoided. Please try with https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.15.0-20231122
From my point of view it looks like a problem with Chrome Downgrade Selenium does not help but downgrade Chrome from 119 to 116 does. I can give more details on monday.
@giuliohome I confirm that we do not use this option.
@diemol, Great!!! This version fixes this problem! It’s good news 😃 !
@joerg1985 : I tried your latest commit and I get the same problem.
@bonigarcia : I took your branch and added a retry on the process, and it works! I ran all my tests in loop for 2 hours without error.
This is only a PoC, the code needs to be reviewed, but this fixes the second issue with
Text file busy
.The file contains only the
runCommand
method.SeleniumManagerRetry.txt
@titusfortner I understand that Selenium Manager should not be used with Docker, and we should set system properties for driver location. But, if this change is not possible for version 4.16, is it possible to add a retry mechanism as a temporary fix to stabilize the solution (like I did in the code above) ?
https://github.com/SeleniumHQ/selenium/commit/d1787a9d1ed6a3ea643e9d50f393fec02cc6ae2e fixes the issue in my environment.
Yes, I will try it!
It seems to work!
I did not reproduce the problem in standard node mode
I have to test the dynamic grid
I’ll come back today with the official result!
@bonigarcia, making this change results in the issue no longer occurring when running my example project. Let me know if you want any logs or additional information from my setup.
I compiled the SeleniumManager and added debugging in Java.
When the problem occurs, the process output is empty in SeleniumManager.
SeleniumManager.java#L131
Maybe we should be outputting the logs as they happen after all, instead of trying to parse them in the result, in case the result has a bug for some reason.