AWS Lambda Chrome驱动程序不再运行

时间:2019-11-15 08:58:42

标签: java amazon-web-services selenium aws-lambda selenium-chromedriver

我设法使用WebDriverManager下载了chrome驱动程序,但我不知道为什么会出现此错误。

我听说过使用EC2实例中可用的chrome驱动程序,但是我不确定如何检索。有关此错误或其他解决方案的任何帮助,将不胜感激。

错误

localStorage

代码

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Nov 15, 2019 8:40:15 AM java.util.prefs.FileSystemPreferences$1 run
WARNING: Couldn't create user preferences directory. User preferences are unusable.
Nov 15, 2019 8:40:15 AM java.util.prefs.FileSystemPreferences$1 run
WARNING: java.io.IOException: No such file or directory
/tmp/chromedriver /*This is me detecting the chrome driver was downloaded*/
Starting ChromeDriver 78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}) on port 1804
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1573807217.600][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807217.938][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807217.989][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.040][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.091][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.141][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.192][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.243][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.294][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.345][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.396][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.447][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.497][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.548][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.599][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.650][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.701][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.752][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.802][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.853][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.904][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
[1573807218.955][SEVERE]: CreatePlatformSocket() failed: Address family not supported by protocol (97)
unknown error: Chrome failed to start: exited abnormally
  (chrome not reachable)
  (The process started from chrome location /tmp/chromedriver is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: '169.254.215.13', ip: '169.254.215.13', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.133-97.112.amzn2.x86_64', java.version: '1.8.0_201'
Driver info: driver.version: ChromeDriver
remote stacktrace: #0 0x5602458297e9 <unknown>
: org.openqa.selenium.WebDriverException
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
  (chrome not reachable)
  (The process started from chrome location /tmp/chromedriver is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: '169.254.215.13', ip: '169.254.215.13', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.133-97.112.amzn2.x86_64', java.version: '1.8.0_201'
Driver info: driver.version: ChromeDriver
remote stacktrace: #0 0x5602458297e9 <unknown>

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
    at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
    at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:157)
    at com.test.org.test.ChromeDriverController.<init>(ChromeDriverController.java:132)
    at com.test.org.test.OrgCreate.handleRequest(OrgCreate.java:12)
    at com.test.org.test.OrgCreate.handleRequest(OrgCreate.java:1)

编辑:

重复项不相关。这需要与AWS服务有关的答案,因为驱动程序不能放在tmp文件夹之外。

0 个答案:

没有答案