selenium icon indicating copy to clipboard operation
selenium copied to clipboard

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

Open sudo-naim opened this issue 4 years ago • 9 comments

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)

sudo-naim avatar Oct 12 '22 14:10 sudo-naim

@Naim995, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Oct 12 '22 14:10 github-actions[bot]

How do you start the Grid? Is the Grid running on a remote machine with Docker containers?

diemol avatar Oct 12 '22 14:10 diemol

@diemol yes it is running on a remote machine with Docker containers

sudo-naim avatar Oct 12 '22 14:10 sudo-naim

Then please set the SE_NODE_GRID_URL properly.

diemol avatar Oct 12 '22 14:10 diemol

@diemol Thanks to you I managed to fix it. However I am getting the same warning on every saved screenshot. Should I be worried about this? Console logs:

Oct 12, 2022 5:16:26 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected upstream dialect: W3C
Oct 12, 2022 5:18:16 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 5:18:16 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Unable to find CDP implementation matching 106.

sudo-naim avatar Oct 12 '22 15:10 sudo-naim

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

diemol avatar Oct 12 '22 15:10 diemol

@diemol sorry for summoning you again, but upgrade what exactly? I have upgraded all the libraries to their latest version but it didn't go away. Am I missing something: My build.gradle file :

            dependency 'org.seleniumhq.selenium:selenium-java:4.5.0'
            dependency 'org.seleniumhq.selenium:selenium-devtools:4.0.0-rc-1'
            dependency 'org.seleniumhq.selenium:selenium-api:4.5.0'
            dependency 'org.seleniumhq.selenium:selenium-remote-driver:4.5.0'
            dependency 'org.seleniumhq.selenium:selenium-support:4.5.0'
            dependency 'org.seleniumhq.selenium:selenium-chrome-driver:4.5.0'
            dependency 'org.seleniumhq.selenium:selenium-firefox-driver:4.5.0'
            dependency 'org.seleniumhq.selenium:selenium-edge-driver:4.5.0'
            dependency 'org.seleniumhq.selenium:selenium-safari-driver:4.5.0'
            dependency 'io.github.bonigarcia:webdrivermanager:5.3.0'
            dependency 'com.google.guava:guava:31.1-jre'
            dependency 'com.google.guava:guava-gwt:31.1-jre'

Docker image: selenium/node-chrome:4.5.0

sudo-naim avatar Oct 13 '22 11:10 sudo-naim

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.

diemol avatar Oct 13 '22 11:10 diemol

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 13 '22 00:11 github-actions[bot]