CreatePlatformSocket() failed: Address family not supported by protocol and cannot find chrome binary using WebDriverManager in AWS Lambda CreatePlatformSocket() failed: Address family not supported by protocol and cannot find chrome binary using WebDriverManager in AWS Lambda selenium selenium

CreatePlatformSocket() failed: Address family not supported by protocol and cannot find chrome binary using WebDriverManager in AWS Lambda


This error message...

[1572601288.635][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)unknown error: cannot find Chrome binaryBuild info: version: 'unknown', revision: 'unknown', time: 'unknown'System info: host: 'ip-10-128-128-181.eu-west-2.compute.internal', ip: '10.128.128.181', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.146-93.123.amzn1.x86_64', java.version: '1.8.0_201'Driver info: driver.version: ChromeDriverremote stacktrace: #0 0x563e5f6197e9 <unknown>: org.openqa.selenium.WebDriverExceptionorg.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binaryBuild info: version: 'unknown', revision: 'unknown', time: 'unknown'System info: host: 'ip-10-128-128-181.eu-west-2.compute.internal', ip: '10.128.128.181', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.146-93.123.amzn1.x86_64', java.version: '1.8.0_201'Driver info: driver.version: ChromeDriverremote stacktrace: #0 0x563e5f6197e9 <unknown>

...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • As you are using:

    <dependency>    <groupId>io.github.bonigarcia</groupId>    <artifactId>webdrivermanager</artifactId>    <version>3.7.1</version></dependency>
  • Presumably this would in-turn download and use the latest chromedriver=78.0

  • Release Notes of chromedriver=78.0 clearly mentions the following :

Supports Chrome version 78

  • Presumably you are using chrome= 78.0.
  • But your Selenium Client version is 3.10.0 which is almost 2 years older.
  • Your JDK version is 1.8.0_201 is a bit older.

So there is a clear mismatch between the JDK v8u201 , Selenium Client v3.10.0 , ChromeDriver v78.0 and the Chrome Browser v78.0


Solution

Ensure that:

  • Selenium is upgraded to current levels Version 3.141.59.
  • JDK is upgraded to current levels JDK 8u222.
  • ChromeDriver is updated to current ChromeDriver v78.0 level.
  • Chrome is updated to current Chrome Version 78.0 level. (as per ChromeDriver v78.0 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test as non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

Outro

CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726) when trying to access chromedriver through network path