aws lambda function chromedriver is not executable

+1 vote

I've been stuck with this error "Caused by: java.lang.IllegalStateException: The driver is not executable: /var/task/chromedriver" When I deploy my jar project into aws lambda function. The project works fine on my local machine, but it seems like aws can't execute chromedriver for some reason. My chromedriver file is placed in the resources folder.

Following is my test config file:

@Configuration
public class TestConfig {

    private static final Logger l = LoggerFactory.getLogger(TestConfig.class);

    private String chromeDriver = org.apache.commons.lang.SystemUtils.IS_OS_WINDOWS ? "chromedriver.exe" : "chromedriver" ;

    public WebDriver getDriver(){
        URL resource = getClass().getClassLoader().getResource(chromeDriver);
        String chromePath = null;
        try {
            chromePath = Paths.get(resource.toURI()).toString();
        } catch (URISyntaxException e) {
            l.info("cannot find chromedriver in resources");
        }
        System.setProperty("webdriver.chrome.driver", chromePath);
        return new ChromeDriver();
    }
}

I have both chromedriver and chromedriver.exe, and I've tried to chmod 777 the file, but have no success.

Oct 4, 2018 in AWS by eatcodesleeprepeat
• 4,670 points
197 views
did you manage to get answer or solved this issue? i am facing the same issue now
@salah, You should do the above task in your remote machine rather than on AWS Lambda Function. This is the solution that I got. Futher, if you want to run webdriver in Lambda I will share you the method. Before that can you share the code you are working with?

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
Lambda has a limit of 300 seconds and memory limit of 1536MB.

It is a very bad approach for you to try and launch a chromedriver in your lambda function. What you should be doing is setting up a Selenium grid and then using RemoteWebDriver to launch a Chrome browser in remote machine
answered Oct 4, 2018 by Priyaj
• 56,140 points

Related Questions In AWS

+2 votes
3 answers
+3 votes
3 answers
0 votes
1 answer

if instance is a part of some AutoScaling Group in AWS or not ?

You can run this command below on ...READ MORE

answered Jun 1, 2018 in AWS by Cloud gunner
• 4,240 points
22 views
0 votes
1 answer
0 votes
1 answer
+1 vote
10 answers
0 votes
4 answers

Renaming AWS Lambda function

Nope- the function name is immutable READ MORE

answered Mar 6 in AWS by anonymous
1,655 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.