question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛 Bug]: Unable to find an exact match for CDP version 106, so returning the closest version found: a no-op implementation

See original GitHub issue

What happened?

I am trying to save a screenshot from my RemoteWebDriver session (GRID 4 distributed mode) and it looks like there is an issue with the websocket connection or the cdp version is not compatiable with selenium-java version: 4.5.0

How can we reproduce the issue?

Java code:


driver = WebDriverManager.chromedriver()
                        .remoteAddress("http://seleniumgridtest.check24tech.de:4444")
                        .capabilities(DesiredCapabilitiesFactory.createChromeOptions())
                        .create();

WebDriver augmentedDriver = new Augmenter().augment(driver);
                srcFile = ((TakesScreenshot) augmentedDriver).getScreenshotAs(OutputType.FILE);


### Relevant log output

```shell
Connected to the target VM, address: '127.0.0.1:64835', transport: 'socket'
Oct 12, 2022 3:58:12 PM org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer createTracer
INFO: Using OpenTelemetry for tracing
Oct 12, 2022 3:58:25 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected upstream dialect: W3C
Oct 12, 2022 4:02:05 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 106, so returning the closest version found: a no-op implementation
Oct 12, 2022 4:02:05 PM org.openqa.selenium.devtools.CdpVer

Oct 12, 2022 4:20:19 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 106, so returning the closest version found: a no-op implementation
Oct 12, 2022 4:20:19 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Unable to find CDP implementation matching 106.
Oct 12, 2022 4:20:29 PM org.openqa.selenium.remote.http.netty.NettyWebSocket lambda$new$0
WARNING: connection timed out: /172.20.0.5:4444
java.net.ConnectException: connection timed out: /172.20.0.5:4444
	at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:179)
	at org.asynchttpclient.netty.channel.NettyChannelConnector$1.onFailure(NettyChannelConnector.java:108)
	at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:28)
	at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:20)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
	at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616)
	at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609)
	at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:262)
	at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask$$$capture(AbstractEventExecutor.java:174)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:167)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /172.20.0.5:4444
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
	... 12 more

Oct 12, 2022 4:20:29 PM org.openqa.selenium.remote.http.WebSocket$Listener onError
WARNING: connection timed out: /172.20.0.5:4444
java.net.ConnectException: connection timed out: /172.20.0.5:4444
	at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:179)
	at org.asynchttpclient.netty.channel.NettyChannelConnector$1.onFailure(NettyChannelConnector.java:108)
	at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:28)
	at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:20)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
	at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616)
	at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609)
	at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:262)
	at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask$$$capture(AbstractEventExecutor.java:174)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:167)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /172.20.0.5:4444
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
	... 12 more

org.openqa.selenium.remote.http.ConnectionFailedException: Unable to establish websocket connection to http://172.20.0.5:4444/session/b47bfd6fa8d3d37c813e127f67f8cb0d/se/cdp
Build info: version: '4.5.0', revision: 'fe167b119a'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '12.5', java.version: '15.0.8'
Driver info: driver.version: unknown
	at org.openqa.selenium.remote.http.netty.NettyWebSocket.<init>(NettyWebSocket.java:102)
	at org.openqa.selenium.remote.http.netty.NettyWebSocket.lambda$create$3(NettyWebSocket.java:128)
	at org.openqa.selenium.remote.http.netty.NettyClient.openSocket(NettyClient.java:107)
	at org.openqa.selenium.devtools.Connection.<init>(Connection.java:77)
	at org.openqa.selenium.devtools.SeleniumCdpConnection.<init>(SeleniumCdpConnection.java:34)
	at org.openqa.selenium.devtools.SeleniumCdpConnection.lambda$create$0(SeleniumCdpConnection.java:56)
	at java.base/java.util.Optional.map(Optional.java:258)
	at org.openqa.selenium.devtools.SeleniumCdpConnection.create(SeleniumCdpConnection.java:54)
	at org.openqa.selenium.devtools.SeleniumCdpConnection.create(SeleniumCdpConnection.java:47)
	at org.openqa.selenium.devtools.DevToolsProvider.getImplementation(DevToolsProvider.java:50)
	at org.openqa.selenium.devtools.DevToolsProvider.getImplementation(DevToolsProvider.java:31)
	at org.openqa.selenium.remote.Augmenter.augment(Augmenter.java:186)
	at de.check24.testumgebung.TestListener.savePng(TestListener.java:64)
	at de.check24.testumgebung.TestListener.createScreenshot(TestListener.java:42)
	at de.check24.testumgebung.TestListener.onTestFailure(TestListener.java:160)
	at org.testng.internal.TestListenerHelper.runTestListeners(TestListenerHelper.java:96)
	at org.testng.internal.TestInvoker.runTestResultListener(TestInvoker.java:219)
	at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:834)
	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:146)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.testng.TestRunner.privateRun(TestRunner.java:794)
	at org.testng.TestRunner.run(TestRunner.java:596)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:377)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:371)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:332)
	at org.testng.SuiteRunner.run(SuiteRunner.java:276)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1212)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1134)
	at org.testng.TestNG.runSuites(TestNG.java:1063)
	at org.testng.TestNG.run(TestNG.java:1031)
	at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
	at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)
Disconnected from the target VM, address: '127.0.0.1:64835', transport: 'socket'

Process finished with exit code 255

Operating System

macOS Monterey Version 12.5

Selenium version

Selenium 4.5.0 | openjdk 15.0.8 2022-07-19 | Chrome-driver 4.5.0

What are the browser(s) and version(s) where you see this issue?

Chrome v.106.0

What are the browser driver(s) and version(s) where you see this issue?

browserVersion= v.106.0.5249.91

Are you using Selenium Grid?

Selenium Grid 4.5.0 (revision fe167b119a)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
diemolcommented, Oct 13, 2022

org.seleniumhq.selenium:selenium-devtools:4.0.0-rc-1

Upgrade everything to 4.5.0, for more questions please join us in the IRC/Slack channel where the community can help you as well.

1reaction
diemolcommented, Oct 12, 2022

The warning will go away if you upgrade to 4.5.0 on the client side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[🐛 Bug]: Unable to find an exact match for CDP version 102 ...
[ 🐛 Bug]: Unable to find an exact match for CDP version 102, so returning the closest version found: a no-op implementation #10733....
Read more >
Selenium Chromedriver: Unable to find an exact match for ...
CdpVersionFinder findNearestMatch WARNING: Unable to find an exact match for CDP version 98, so returning the closest version found: 97 Feb.
Read more >
Unable to find an exact match for CDP version 107, so ...
I am using latest chromedriver 107.0.5304.62 yet all the scripts fail to load page. Scripts working on lower version of chrome browser.
Read more >
Java - Selenium - open browser is not working , getting an ...
WARNING : Unable to find an exact match for CDP version 99, so returning the closest version found: a no-op implementation
Read more >
Error when running selenium on Eclipse - Reddit
CdpVersionFinder findNearestMatch WARNING: Unable to find an exact match for CDP version 88, so returning the closest version found: a no-op ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found