Skip to content
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

There was an error managing geckodriver (latest version) #1408

Open
alexsabau86 opened this issue Dec 30, 2024 · 3 comments
Open

There was an error managing geckodriver (latest version) #1408

alexsabau86 opened this issue Dec 30, 2024 · 3 comments
Labels

Comments

@alexsabau86
Copy link

13:17:31 446 [main] WARN i.g.bonigarcia.wdm.WebDriverManager - There was an error managing geckodriver (latest version) (Exception reading resolution cache as a properties file) ... trying again using latest driver stored in cache
13:17:31 456 [main] ERROR i.g.bonigarcia.wdm.WebDriverManager - There was an error managing geckodriver (latest version) (Exception reading resolution cache as a properties file)
13:17:31 io.github.bonigarcia.wdm.config.WebDriverManagerException: Exception reading resolution cache as a properties file
13:17:31 at io.github.bonigarcia.wdm.cache.ResolutionCache.(ResolutionCache.java:86)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.lambda$getResolutionCache$2(WebDriverManager.java:1661)
13:17:31 at java.util.Optional.orElseGet(Optional.java:267)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.getResolutionCache(WebDriverManager.java:1660)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.useResolutionCacheWithKey(WebDriverManager.java:1361)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.getValueFromResolutionCache(WebDriverManager.java:1306)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(WebDriverManager.java:1201)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1155)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:1437)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1415)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1190)
13:17:31 at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:427)
13:17:31 at selenium.automation.project.base.WebDriverUtil.initWebDriver(WebDriverUtil.java:59)
13:17:31 at selenium.automation.project.steps.hooks.Hook.InitializeTest(Hook.java:38)
13:17:31 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:17:31 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:17:31 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:17:31 at java.lang.reflect.Method.invoke(Method.java:498)
13:17:31 at cucumber.runtime.Utils$1.call(Utils.java:26)
13:17:31 at cucumber.runtime.Timeout.timeout(Timeout.java:16)
13:17:31 at cucumber.runtime.Utils.invoke(Utils.java:20)
13:17:31 at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60)
13:17:31 at cucumber.runner.HookDefinitionMatch.runStep(HookDefinitionMatch.java:16)
13:17:31 at cucumber.runner.TestStep.executeStep(TestStep.java:63)
13:17:31 at cucumber.runner.TestStep.run(TestStep.java:49)
13:17:31 at cucumber.runner.TestCase.run(TestCase.java:40)
13:17:31 at cucumber.runner.Runner.runPickle(Runner.java:40)
13:17:31 at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:146)
13:17:31 at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
13:17:31 at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
13:17:31 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
13:17:31 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
13:17:31 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
13:17:31 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
13:17:31 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
13:17:31 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
13:17:31 at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
13:17:31 at cucumber.api.junit.Cucumber.runChild(Cucumber.java:124)
13:17:31 at cucumber.api.junit.Cucumber.runChild(Cucumber.java:65)
13:17:31 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
13:17:31 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
13:17:31 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
13:17:31 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
13:17:31 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
13:17:31 at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:133)
13:17:31 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
13:17:31 at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
13:17:31 at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
13:17:31 at org.testng.junit.JUnit4TestRunner.start(JUnit4TestRunner.java:82)
13:17:31 at org.testng.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:70)
13:17:31 at org.testng.TestRunner$1.run(TestRunner.java:570)
13:17:31 at org.testng.TestRunner.runJUnitWorkers(TestRunner.java:717)
13:17:31 at org.testng.TestRunner.privateRunJUnit(TestRunner.java:601)
13:17:31 at org.testng.TestRunner.run(TestRunner.java:502)
13:17:31 at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
13:17:31 at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
13:17:31 at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
13:17:31 at org.testng.SuiteRunner.run(SuiteRunner.java:364)
13:17:31 at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
13:17:31 at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
13:17:31 at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
13:17:31 at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
13:17:31 at org.testng.TestNG.runSuites(TestNG.java:1049)
13:17:31 at org.testng.TestNG.run(TestNG.java:1017)
13:17:31 at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:135)
13:17:31 at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:112)
13:17:31 at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
13:17:31 at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:146)
13:17:31 at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
13:17:31 at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
13:17:31 at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
13:17:31 at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
13:17:31 Caused by: java.io.IOException: No such file or directory
13:17:31 at java.io.UnixFileSystem.createFileExclusively(Native Method)
13:17:31 at java.io.File.createNewFile(File.java:1023)
13:17:31 at io.github.bonigarcia.wdm.cache.ResolutionCache.(ResolutionCache.java:75)
13:17:31 ... 71 common frames omitted

Using latest version of WebdriverManager: 5.9.2

@bonigarcia
Copy link
Owner

I have just tried WebDriverManager 5.9.2 to manage geckodriver and it seems to work nicely:

2024-12-30 18:54:28 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.<init>(227) - Using WebDriverManager 5.9.2
2024-12-30 18:54:28 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.<init>(77) - Created new resolution cache file at C:\Users\boni\.cache\selenium\resolution.properties
2024-12-30 18:54:28 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(252) - Detecting firefox version using online commands.properties
2024-12-30 18:54:28 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Mozilla, Firefox\\firefox.exe", get, Version, /value]
2024-12-30 18:54:28 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=133.0.3.387
2024-12-30 18:54:28 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.getDriverVersionFromRepository(136) - Reading https://raw.githubusercontent.com/SeleniumHQ/selenium/trunk/common/geckodriver/geckodriver-support.json to discover geckodriver version
2024-12-30 18:54:29 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1220) - Using geckodriver 0.35.0 (resolved driver for Firefox 133)
2024-12-30 18:54:29 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution firefox=133 in cache (valid until 19:54:29 30/12/2024 CET)
2024-12-30 18:54:29 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution firefox133=0.35.0 in cache (valid until 18:54:29 31/12/2024 CET)
2024-12-30 18:54:29 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.logSeekRepo(1594) - Reading https://raw.githubusercontent.com/bonigarcia/webdrivermanager/master/docs/mirror/geckodriver to seek geckodriver
2024-12-30 18:54:29 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1469) - Driver to be downloaded geckodriver 0.35.0
2024-12-30 18:54:29 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(128) - Downloading https://github.com/mozilla/geckodriver/releases/download/v0.35.0/geckodriver-v0.35.0-win64.zip
2024-12-30 18:54:31 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.extract(189) - Extracting driver from compressed file geckodriver-v0.35.0-win64.zip
2024-12-30 18:54:31 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1282) - Exporting webdriver.gecko.driver as C:\Users\boni\.cache\selenium\geckodriver\win64\0.35.0\geckodriver.exe
Dec 30, 2024 6:54:33 PM org.openqa.selenium.firefox.FirefoxDriver <init>
WARNING: CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi.

It seems your resolution cache is corrupted for some reason: Exception reading resolution cache as a properties file. So. I recommend you to clean your cache once, i.e. delete the file <HOME>\.cache\selenium\resolution.properties, or run the following:

WebDriverManager.firefoxdriver().clearResolutionCache().setup();

@alexsabau86
Copy link
Author

alexsabau86 commented Dec 30, 2024

@bonigarcia The tests are running in a docker container triggered from a jenkins pipeline, so it's getting built from scratch each time. I've added the clearResolutionCache line and got kinda the same error. Note that this is only happening when trying to run on firefox. On Chrome there is no such issue.

22:16:19 io.github.bonigarcia.wdm.config.WebDriverManagerException: Exception reading resolution cache as a properties file
22:16:19 at io.github.bonigarcia.wdm.cache.ResolutionCache.(ResolutionCache.java:86)
22:16:19 at io.github.bonigarcia.wdm.WebDriverManager.lambda$getResolutionCache$2(WebDriverManager.java:1661)
22:16:19 at java.util.Optional.orElseGet(Optional.java:267)
22:16:19 at io.github.bonigarcia.wdm.WebDriverManager.getResolutionCache(WebDriverManager.java:1660)
22:16:19 at io.github.bonigarcia.wdm.WebDriverManager.clearResolutionCache(WebDriverManager.java:817)
22:16:19 at selenium.automation.project.base.WebDriverUtil.initWebDriver(WebDriverUtil.java:59)
22:16:19 at selenium.automation.project.steps.hooks.Hook.InitializeTest(Hook.java:38)
22:16:19 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
22:16:19 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
22:16:19 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
22:16:19 at java.lang.reflect.Method.invoke(Method.java:498)
22:16:19 at cucumber.runtime.Utils$1.call(Utils.java:26)
22:16:19 at cucumber.runtime.Timeout.timeout(Timeout.java:16)
22:16:19 at cucumber.runtime.Utils.invoke(Utils.java:20)
22:16:19 at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60)
22:16:19 at cucumber.runner.HookDefinitionMatch.runStep(HookDefinitionMatch.java:16)
22:16:19 at cucumber.runner.TestStep.executeStep(TestStep.java:63)
22:16:19 at cucumber.runner.TestStep.run(TestStep.java:49)
22:16:19 at cucumber.runner.TestCase.run(TestCase.java:40)
22:16:19 at cucumber.runner.Runner.runPickle(Runner.java:40)
22:16:19 at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:146)
22:16:19 at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
22:16:19 at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
22:16:19 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
22:16:19 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
22:16:19 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
22:16:19 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
22:16:19 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
22:16:19 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
22:16:19 at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
22:16:19 at cucumber.api.junit.Cucumber.runChild(Cucumber.java:124)
22:16:19 at cucumber.api.junit.Cucumber.runChild(Cucumber.java:65)
22:16:19 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
22:16:19 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
22:16:19 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
22:16:19 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
22:16:19 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
22:16:19 at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:133)
22:16:19 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
22:16:19 at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
22:16:19 at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
22:16:19 at org.testng.junit.JUnit4TestRunner.start(JUnit4TestRunner.java:82)
22:16:19 at org.testng.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:70)
22:16:19 at org.testng.TestRunner$1.run(TestRunner.java:570)
22:16:19 at org.testng.TestRunner.runJUnitWorkers(TestRunner.java:717)
22:16:19 at org.testng.TestRunner.privateRunJUnit(TestRunner.java:601)
22:16:19 at org.testng.TestRunner.run(TestRunner.java:502)
22:16:19 at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
22:16:19 at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
22:16:19 at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
22:16:19 at org.testng.SuiteRunner.run(SuiteRunner.java:364)
22:16:19 at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
22:16:19 at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
22:16:19 at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
22:16:19 at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
22:16:19 at org.testng.TestNG.runSuites(TestNG.java:1049)
22:16:19 at org.testng.TestNG.run(TestNG.java:1017)
22:16:19 at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:135)
22:16:19 at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:112)
22:16:19 at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
22:16:19 at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:146)
22:16:19 at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
22:16:19 at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
22:16:19 at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
22:16:19 at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
22:16:19 Caused by: java.io.IOException: No such file or directory
22:16:19 at java.io.UnixFileSystem.createFileExclusively(Native Method)
22:16:19 at java.io.File.createNewFile(File.java:1023)
22:16:19 at io.github.bonigarcia.wdm.cache.ResolutionCache.(ResolutionCache.java:75)
22:16:19 ... 64 more

@alexsabau86
Copy link
Author

alexsabau86 commented Dec 31, 2024

Another weird issue is that when I run the tests locally I get another error:

Testing started at 11:10 ...
275 [main] INFO i.g.b.wdm.cache.ResolutionCache - Clearing WebDriverManager resolution cache
2001 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Using geckodriver 0.35.0 (resolved driver for Firefox 133)
2050 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Reading https://raw.githubusercontent.com/bonigarcia/webdrivermanager/master/docs/mirror/geckodriver to seek geckodriver
2116 [main] INFO i.g.b.wdm.online.Downloader - Downloading https://github.com/mozilla/geckodriver/releases/download/v0.35.0/geckodriver-v0.35.0-macos.tar.gz
3044 [main] INFO i.g.b.wdm.online.Downloader - Extracting driver from compressed file geckodriver-v0.35.0-macos.tar.gz

java.lang.NoSuchMethodError: 'org.apache.commons.compress.archivers.tar.TarArchiveEntry org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry()'
at io.github.bonigarcia.wdm.online.Downloader.unTarGz(Downloader.java:280)
at io.github.bonigarcia.wdm.online.Downloader.extract(Downloader.java:192)
at io.github.bonigarcia.wdm.online.Downloader.downloadAndExtract(Downloader.java:139)
at io.github.bonigarcia.wdm.online.Downloader.download(Downloader.java:91)
at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:1273)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1184)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:427)
at selenium.automation.project.base.WebDriverUtil.initWebDriver(WebDriverUtil.java:59)
at selenium.automation.project.steps.hooks.Hook.InitializeTest(Hook.java:38)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at cucumber.runtime.Utils$1.call(Utils.java:26)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:20)
at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60)
at cucumber.runner.HookDefinitionMatch.runStep(HookDefinitionMatch.java:16)
at cucumber.runner.TestStep.executeStep(TestStep.java:63)
at cucumber.runner.TestStep.run(TestStep.java:49)
at cucumber.runner.TestCase.run(TestCase.java:40)
at cucumber.runner.Runner.runPickle(Runner.java:40)
at cucumber.runtime.Runtime$1.run(Runtime.java:84)
at cucumber.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:220)
at cucumber.runtime.Runtime.run(Runtime.java:81)
at cucumber.api.cli.Main.run(Main.java:26)
at cucumber.api.cli.Main.main(Main.java:8)

line 59 is:
WebDriverManager.firefoxdriver().clearResolutionCache().setup();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants