handleException(1413) - There was an error managing chromedriver (latest version) (Connection reset)
ramendranamdev opened this issue · 4 comments
Socket Exception is thrown while
2024-11-22 12:58:59 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.<init>(77) - Created new resolution cache file at C:\Users\ramendra.namdev\.cache\selenium\resolution.properties 2024-11-22 12:59:01 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(238) - Detecting chrome version using online commands.properties 2024-11-22 12:59:01 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value] 2024-11-22 12:59:01 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=131.0.6778.85 2024-11-22 12:59:05 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(129) - Exception reading CfT URL ('https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json') to get version of chromedriver (Connection reset) 2024-11-22 12:59:08 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(155) - Exception reading https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_131 to get latest version of chromedriver (Connection reset) 2024-11-22 12:59:08 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1244) - The driver version for CHROME 131 is unknown ... trying with latest 2024-11-22 12:59:11 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(129) - Exception reading CfT URL ('https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json') to get version of chromedriver (Connection reset) 2024-11-22 12:59:14 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(155) - Exception reading https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE to get latest version of chromedriver (Connection reset) 2024-11-22 12:59:17 [main] WARN i.g.bonigarcia.wdm.WebDriverManager.fallback(1424) - There was an error managing chromedriver (latest version) (Connection reset) ... trying again using latest driver stored in cache 2024-11-22 12:59:17 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1244) - The driver version for CHROME is unknown ... trying with latest 2024-11-22 12:59:20 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(129) - Exception reading CfT URL ('https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json') to get version of chromedriver (Connection reset) 2024-11-22 12:59:23 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(155) - Exception reading https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE to get latest version of chromedriver (Connection reset) 2024-11-22 12:59:26 [main] ERROR i.g.bonigarcia.wdm.WebDriverManager.handleException(1413) - There was an error managing chromedriver (latest version) (Connection reset) java.net.SocketException: Connection reset at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186) at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140) at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:484) at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:478) at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160) at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111) at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1383) at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1296) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:416) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:388) at org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory.executeHandshake(SSLConnectionSocketFactory.java:303) at org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:275) at org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:251) at org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:181) at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:447) at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:162) at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:172) at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:142) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:96) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:115) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170) at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87) at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:55) at org.apache.hc.client5.http.classic.HttpClient.executeOpen(HttpClient.java:183) at io.github.bonigarcia.wdm.online.HttpClient.execute(HttpClient.java:157) at io.github.bonigarcia.wdm.online.Parser.parseJson(Parser.java:54) at io.github.bonigarcia.wdm.managers.ChromeDriverManager.getDriverUrls(ChromeDriverManager.java:119) at io.github.bonigarcia.wdm.WebDriverManager.createUrlHandler(WebDriverManager.java:1435) at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:1267) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1183) at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:1430) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1408) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1189) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:426) at a1qa.selenium.browser.factory.LocalWebDriverFactory.getBrowserDriver(LocalWebDriverFactory.java:24) at a1qa.selenium.browser.Browser.<init>(Browser.java:41) at a1qa.selenium.browser.Browser.getInstance(Browser.java:61) at Practise.run(Practise.java:35) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133) at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:584) at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:172) at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46) at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:804) at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:145) 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:1541) at org.testng.TestRunner.privateRun(TestRunner.java:770) at org.testng.TestRunner.run(TestRunner.java:591) at org.testng.SuiteRunner.runTest(SuiteRunner.java:402) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:396) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:355) at org.testng.SuiteRunner.run(SuiteRunner.java:304) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1180) at org.testng.TestNG.runSuitesLocally(TestNG.java:1102) at org.testng.TestNG.runSuites(TestNG.java:1032) at org.testng.TestNG.run(TestNG.java:1000) at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:65) at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)
Selenium is trying to fetch driver metadata/details from below 2 apis but both the apis are not responding that is leading to socketTimeout
https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json
It seems googlechromelabs has moved above endpoints to a new repo [https://github.com/GoogleChromeLabs].
https://github.com/GoogleChromeLabs/chrome-for-testing/blob/main/data/known-good-versions-with-downloads.json
https://github.com/GoogleChromeLabs/chrome-for-testing/blob/main/data/last-known-good-versions-with-downloads.json
I tried overriding these 2 properties wdm.chromeGoodVersionsUrl & wdm.chromeLastGoodVersionsUrl with above new urls, but it failed a below Bad Json Format exception
2024-11-22 13:07:16 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.<init>(77) - Created new resolution cache file at C:\Users\ramendra.namdev\.cache\selenium\resolution.properties 2024-11-22 13:07:17 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(238) - Detecting chrome version using online commands.properties 2024-11-22 13:07:17 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value] 2024-11-22 13:07:18 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=131.0.6778.85 2024-11-22 13:07:20 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(129) - Exception reading CfT URL ('https://github.com/GoogleChromeLabs/chrome-for-testing/blob/main/data/known-good-versions-with-downloads.json') to get version of chromedriver (Bad JSON. First 100 chars <!DOCTYPE html><html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme=") 2024-11-22 13:07:23 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(155) - Exception reading https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_131 to get latest version of chromedriver (Connection reset) 2024-11-22 13:07:23 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1244) - The driver version for CHROME 131 is unknown ... trying with latest 2024-11-22 13:07:23 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(129) - Exception reading CfT URL ('https://github.com/GoogleChromeLabs/chrome-for-testing/blob/main/data/last-known-good-versions-with-downloads.json') to get version of chromedriver (Bad JSON. First 100 chars <!DOCTYPE html><html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme=") 2024-11-22 13:07:26 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(155) - Exception reading https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE to get latest version of chromedriver (Connection reset) 2024-11-22 13:07:27 [main] WARN i.g.bonigarcia.wdm.WebDriverManager.fallback(1424) - There was an error managing chromedriver (latest version) (Bad JSON. First 100 chars <!DOCTYPE html><html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme=") ... trying again using latest driver stored in cache 2024-11-22 13:07:27 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1244) - The driver version for CHROME is unknown ... trying with latest 2024-11-22 13:07:30 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(129) - Exception reading CfT URL ('https://github.com/GoogleChromeLabs/chrome-for-testing/blob/main/data/last-known-good-versions-with-downloads.json') to get version of chromedriver (Bad JSON. First 100 chars <!DOCTYPE html><html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme=") 2024-11-22 13:07:33 [main] WARN i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(155) - Exception reading https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE to get latest version of chromedriver (Connection reset) 2024-11-22 13:07:34 [main] ERROR i.g.bonigarcia.wdm.WebDriverManager.handleException(1413) - There was an error managing chromedriver (latest version) (Bad JSON. First 100 chars <!DOCTYPE html><html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme=") io.github.bonigarcia.wdm.config.WebDriverManagerException: Bad JSON. First 100 chars <!DOCTYPE html><html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme=" at io.github.bonigarcia.wdm.online.Parser.parseJson(Parser.java:62) at io.github.bonigarcia.wdm.managers.ChromeDriverManager.getDriverUrls(ChromeDriverManager.java:119) at io.github.bonigarcia.wdm.WebDriverManager.createUrlHandler(WebDriverManager.java:1435) at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:1267) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1183) at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:1430) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1408) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1189) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:426) at a1qa.selenium.browser.factory.LocalWebDriverFactory.getBrowserDriver(LocalWebDriverFactory.java:24) at a1qa.selenium.browser.Browser.<init>(Browser.java:41) at a1qa.selenium.browser.Browser.getInstance(Browser.java:61) at Practise.run(Practise.java:35) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133) at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:584) at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:172) at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46) at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:804) at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:145) 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:1541) at org.testng.TestRunner.privateRun(TestRunner.java:770) at org.testng.TestRunner.run(TestRunner.java:591) at org.testng.SuiteRunner.runTest(SuiteRunner.java:402) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:396) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:355) at org.testng.SuiteRunner.run(SuiteRunner.java:304) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1180) at org.testng.TestNG.runSuitesLocally(TestNG.java:1102) at org.testng.TestNG.runSuites(TestNG.java:1032) at org.testng.TestNG.run(TestNG.java:1000) at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:65) at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105) Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226) at com.google.gson.Gson.fromJson(Gson.java:932) at com.google.gson.Gson.fromJson(Gson.java:897) at com.google.gson.Gson.fromJson(Gson.java:846) at com.google.gson.Gson.fromJson(Gson.java:817) at io.github.bonigarcia.wdm.online.Parser.parseJson(Parser.java:59) ... 39 common frames omitted Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:386) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215) ... 44 common frames omitted
The url I was passing earlier to override wdm.chromeGoodVersionsUrl property was wrong
Instead, with below updated property, its returning the expected json response.
wdm.chromeGoodVersionsUrl=https://raw.githubusercontent.com/GoogleChromeLabs/chrome-for-testing/refs/heads/main/data/known-good-versions-with-downloads.json
We also getting error with latest chrome version- 131.0.6778.86. Can you please help to check it?
with message: io.github.bonigarcia.wdm.config.WebDriverManagerException: Error HTTP 403 executing https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.85/win64/chromedriver-win64.zip