webdrivermanager: NumberFormatException when running WDM on Hetzner

Description of the problem:

We just migrated part of our CI/CD to Hetzner. Runnin a WDM-managed webdriver test throws a NumberFormatException on parsing linux64.

Browser and version:

Chrome: 119

Operating system and architecture:

Ubuntu 22.04 - 64 bit

Selenium version:

Not sure which version it is. We run it on Docker with this image

https://hub.docker.com/layers/selenium/standalone-chrome/119.0-20231102/images/sha256-9f57cf4eae1b0592c809443d0871d89653e389868f84c63620120fb333c86df7?context=explore

WebDriverManager version:

Currently the latest version with 5.6.1

https://github.com/bonigarcia/webdrivermanager/releases/tag/webdrivermanager-5.6.1

through Maven

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>5.6.1</version>
            <scope>test</scope>
        </dependency>

WebDriverManager call:

WebDriverManager.chromedriver().setup();

final var options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("start-maximized");
// to reduce interferences by installed extensions
options.addArguments("--disable-extensions");
// potential solution for random chrome crashing
// see https://stackoverflow.com/a/50642913
options.addArguments("--disable-dev-shm-usage");
options.addArguments("--no-sandbox");
options.addArguments("window-size=1920,1920");
// default headless webdrivers could accept the alert
// see https://stackoverflow.com/questions/26772793/org-openqa-selenium-unhandledalertexception-unexpected-alert-open
options.setCapability(CapabilityType.UNHANDLED_PROMPT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);

new ChromeDriver(options);

WebDriverManager traces:

Omitted, but I can add it if this really helps in this case. Would be a significant overhead to activate the logging within the pipeline.

Error log:

io.github.bonigarcia.wdm.config.WebDriverManagerException: java.lang.NumberFormatException: For input string: "linux64"
	at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1429)
	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1194)
	at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:1445)
	at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1426)
	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1194)
	at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1419)
	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1194)
	at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:426)
	at de.commodis.ui.common.webdriver.WebDriverTest.setupClass(WebDriverTest.java:29)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.lang.NumberFormatException: For input string: "linux64"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:661)
	at java.base/java.lang.Integer.parseInt(Integer.java:777)
	at io.github.bonigarcia.wdm.online.Downloader.getTarget(Downloader.java:105)
	at io.github.bonigarcia.wdm.online.Downloader.download(Downloader.java:88)
	at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:1281)
	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1188)
	... 9 more

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 30 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Use this code, it worked for me.

WebDriverManager.chromedriver().clearDriverCache().setup();

5.7.0 worked with below code

WebDriverManager.chromedriver().clearDriverCache().setup();

@silverenio & @younessg

You don’t need to be using the WebDriverManager anymore with Selenium 4. x. Can you try removing it and working without it?

Selenium now can manage the web driver binary downloading, browser downloading itself, etc., via SeleniumManager. Selenium Manager by its behavior itself is very transparent to you and you wouldn’t even know that it exists.

Read more about it here: https://www.selenium.dev/documentation/selenium_manager/

I am having the same issue, my project was working fine until I tried to run some tests today

io.github.bonigarcia.wdm.config.WebDriverManagerException: java.lang.NumberFormatException: For input string: “public” at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1445) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1205) at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:1461) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1442) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1205) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1435) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1205) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:427)

    <dependency>
        <groupId>io.github.bonigarcia</groupId>
        <artifactId>webdrivermanager</artifactId>
        <version>${webdrivermanager.version}</version>
    </dependency>

And <webdrivermanager.version>5.6.3</webdrivermanager.version>

The issue happens in my case when this code is called:

WebDriverManager .chromedriver() .setup();

and It didn’t work with <webdrivermanager.version>5.6.4</webdrivermanager.version>

I believe I found the root of the problem, and it should be fixed in the master branch.

@thatsIch You can try the new version bumping WebDriverManager to 5.6.2-SNAPSHOT. This version (which contains the latest fix) is in the sonatype snapshots repositories. If using Maven, you also need to include the following in your pom.xml:

    <repositories>
        <repository>
            <id>oss.sonatype.org-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

… or its equivalent in Gradle:

repositories {
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}