blackboard / lambda-selenium

Use Selenium Webdriver and Chrome inside AWS Lambda
MIT License
230 stars 51 forks source link

java.lang.Throwable: The driver is not executable: /var/task/lib/chromedriver #35

Open ashwiniananthaswamy opened 6 years ago

ashwiniananthaswamy commented 6 years ago

Hi,

I cloned the project locally and I tried the below steps:

  1. Installed serverless on my windows 10 machine 2, CD into lambda-selenium-java
  2. Ran command: gradle clean unzipLibs shadowJar Note: I did not use gradle task deploy in the above command since it wasn't working on windows.
  3. Deployed the code to AWS using the below serverless command: serverless deploy --force
  4. I was successfully able to deploy the code to AWS and I was able to verify that the lambda function, S3 bucket and the cloudWatch logs were created
  5. I run the tests I get the following error:

    java.lang.IllegalStateException: The driver is not executable: /var/task/lib/chromedriver at com.google.common.base.Preconditions.checkState(Preconditions.java:534) at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:140) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:131) at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32) at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:

Note: I downloaded the latest release(Alpha 0.13) from the project, uploaded to S3 and pointed Lambda to the uploaded release version after which I am able to successfully run the tests. Not sure what is different from the release version on github and locally building and deploying the jar files using serverless.

Thank you for your help.

wesmcouch commented 6 years ago

Hello, the package in the release isn't quite synced up to master and the latest tutorial. The instructions on https://blackboard.github.io/lambda-selenium/java-tutorial.html don't require the release, if you just run those commands it should get you up and running.

BanjoFromCurlwaa commented 6 years ago

Hi I am also getting this error. When I try to follow the instructions exactly (ie cloning directly using git), I get the error

Cloning into 'lambda-selenium'... The authenticity of host 'github.com (192.30.255.113)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? Y Please type 'yes' or 'no': yes Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

Cloning using the URL in github seemed to go through fine but as reported in the issue I get the 'The driver is not executable' error.

java.lang.RuntimeException: java.lang.Throwable: The driver is not executable: /var/task/lib/chromedriver at com.blackboard.testing.lambda.LambdaTestSuite.logTestResult(LambdaTestSuite.java:68) at com.blackboard.testing.tests.ExampleTestSuite.runTest(ExampleTestSuite.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.Throwable: The driver is not executable: /var/task/lib/chromedriver at com.google.common.base.Preconditions.checkState(Preconditions.java:534) at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:140) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:131) at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32) at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:329) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:157) at com.blackboard.testing.driver.LambdaWebDriverFactory.createWebDriver(LambdaWebDriverFactory.java:36) at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.createDriver(WebDriverThreadLocalContainer.java:227) at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.getAndCheckWebDriver(WebDriverThreadLocalContainer.java:111) at com.codeborne.selenide.WebDriverRunner.getAndCheckWebDriver(WebDriverRunner.java:142) at com.codeborne.selenide.impl.Navigator.navigateToAbsoluteUrl(Navigator.java:69) at com.codeborne.selenide.impl.Navigator.open(Navigator.java:32) at com.codeborne.selenide.Selenide.open(Selenide.java:79) at com.codeborne.selenide.Selenide.open(Selenide.java:53) at com.blackboard.testing.tests.LambdaTest.blackboardTest(LambdaTest.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.blackboard.testing.lambda.LambdaTestHandler.handleRequest(LambdaTestHandler.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at lambdainternal.EventHandlerLoader$PojoMethodRequestHandler.handleRequest(EventHandlerLoader.java:259) at lambdainternal.EventHandlerLoader$PojoHandlerAsStreamHandler.handleRequest(EventHandlerLoader.java:178) at lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:888) at lambdainternal.AWSLambda.startRuntime(AWSLambda.java:283) at lambdainternal.AWSLambda.(AWSLambda.java:64) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:94)

Has anyone got this working following the java tutorial instructions on windows?

wesmcouch commented 6 years ago

@BanjoFromCurlwaa, this wasn't designed to ever run on windows, you can checkout my comments here regarding windows setup that worked for someone else https://github.com/blackboard/lambda-selenium/issues/32

BanjoFromCurlwaa commented 6 years ago

Hi thanks, I will move to following the instructions in Ubuntu once the IT team have created an environment for me.

BanjoFromCurlwaa commented 6 years ago

Hi, could the error: java.lang.RuntimeException: java.lang.Throwable: The driver is not executable: /var/task/lib/chromedriver be related to my not having set up internet access on my aws account? (given that it failed when I ran through the docker instructions provided in thread #32 with the same error)

ramonview commented 5 years ago

Hello, looks like this issue is still open, I am getting "The driver is not executable: /var/task/lib/chromedriver" exactly same as above. I have tried this from both Windows and mac...no luck. Any solution available ? Please help me, overall this framework shows promising, want to get the solution for this chromedriver issue.

sashagam commented 5 years ago

Hi! Faced same issue with The driver is not executable: /var/task/lib/chromedriver Found the root cause in windows zip/unzip. In my case when I unzip and zip on windows the permissions on chromedriver where empty. But if you unzip and zip on linux permissions remained alright.

tsu-denim commented 5 years ago

https://github.com/blackboard/lambda-selenium/issues/19

In regards to zipping ^. Sorry, have been out of the Selenium biz, but still can't believe nobody is integrating Lambda/Selenium in a better way. Will try to find some time to support this more.

On Fri, Aug 23, 2019 at 8:09 AM sashagam notifications@github.com wrote:

Hi! Faced same issue with The driver is not executable: /var/task/lib/chromedriver Found the root cause in windows zip/unzip. In my case when I unzip and zip on windows the permissions on chromedriver where empty. But if you unzip and zip on linux permissions remained alright.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blackboard/lambda-selenium/issues/35?email_source=notifications&email_token=AGBNECVINDZ7F4DIIIM4CC3QF7HQPA5CNFSM4FGV2KQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5AA2EI#issuecomment-524291345, or mute the thread https://github.com/notifications/unsubscribe-auth/AGBNECSMCBZVKJ6V4X6H3A3QF7HQPANCNFSM4FGV2KQQ .

mrajendrac commented 4 years ago

This issue is about permissions set to chromedriver during shadowJar gradle task, I am still searching for a solution.

Thanks, Rajendra

anirseven commented 3 years ago

Hi, I am facing the same issue, was trying to recreate running the Selenium Tests on AWS Lambda and followed the instruction as in https://aws.amazon.com/blogs/devops/ui-testing-at-scale-with-aws-lambda/

One doubt on the above documentation is I am unable to find libgconf-2.so.4 and libORBit-2.so.0 from the AWS Linux AMI in order to place them in the java/resources/lib folder of the project.

Can you let know what has changed since the article was published? @wesmcouch

Getting below error { "errorMessage": "The driver is not executable: /var/task/lib/chromedriver", "errorType": "java.lang.IllegalStateException",