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,710 points
2,127 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.

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
• 58,020 points

Related Questions In AWS

0 votes
1 answer

what is aws lambda function

AWS Lambda is a serverless compute service that ...READ MORE

answered Feb 4, 2022 in AWS by Korak
• 5,820 points
512 views
0 votes
1 answer

Add a new item to a Dynamodb using a AWS lambda function each time a function is executed with Cloudwatch

The problem here is that the PutItem ...READ MORE

answered Feb 14, 2022 in AWS by Rahul
• 2,120 points
612 views
0 votes
0 answers

Java snapstart is not available in AWS Lambda

I have started to write Java Lambdas ...READ MORE

Jan 3, 2023 in AWS by Tejashwini
• 3,820 points
657 views
0 votes
1 answer
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 7, 2019 in AWS by anonymous
14,238 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP