axe-cli icon indicating copy to clipboard operation
axe-cli copied to clipboard

Running axe on Amazon Linux not finding Chrome

Open simi823 opened this issue 6 years ago • 7 comments

Hello -- I've been trying to upgrade to the new version of axe-cli but installing it on Amazon Linux does not seem to find the chrome driver. I have tried various things to install headless chrome to no avail.

This is the error I get: `bash-4.2# axe https://www.nj.com Running axe-core 3.1.2 in chrome-headless /root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/promise.js:2626 throw error; ^

WebDriverError: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.9.125-linuxkit x86_64) at WebDriverError (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/error.js:27:5) at Object.checkLegacyResponse (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/error.js:546:15) at parseHttpResponse (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/http.js:509:13) at doSend.then.response (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/http.js:441:30) at process._tickCallback (internal/process/next_tick.js:109:7) From: Task: WebDriver.createSession() at Function.createSession (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/webdriver.js:769:24) at Function.createSession (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/node_modules/selenium-webdriver/chrome.js:761:15) at createDriver (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/node_modules/selenium-webdriver/index.js:170:33) at Builder.build (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/node_modules/selenium-webdriver/index.js:642:16) at startDriver (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/lib/webdriver.js:33:27) at testPages (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/lib/axe-test-urls.js:11:10) at Object. (/root/.nvm/versions/node/v6.11.5/lib/node_modules/axe-cli/index.js:73:1) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) ` Any resources that may help me figure this issue would be greatly appreciated.

simi823 avatar Jan 30 '19 20:01 simi823

Running Chrome/axe on AWS is tricky.

I haven't had luck with axe-cli, but suggest axe-puppeteer instead. This also gives us the benefit of being able to script "actions" before/after running an accessibility analysis.

As far as Chrome, it's generally expected that you "bring your own" (especially in a lambda environment). For this, I use chrome-aws-lambda. It's got basically everything you'll need packaged up into a single npm installable thing.

stephenmathieson avatar Jan 31 '19 14:01 stephenmathieson

Hi Stephen,

Thank you for the quick reply. I will try out your options and hopefully I will have some luck.

Thanks, --simi

From: Stephen Mathieson [email protected] Reply-To: dequelabs/axe-cli [email protected] Date: Thursday, January 31, 2019 at 9:15 AM To: dequelabs/axe-cli [email protected] Cc: Simi Asaro [email protected], Author [email protected] Subject: Re: [dequelabs/axe-cli] Running axe on Amazon Linux not finding Chrome (#84)

Running Chrome/axe on AWS is tricky.

I haven't had luck with axe-cli, but suggest axe-puppeteerhttps://github.com/dequelabs/axe-puppeteer instead. This also gives us the benefit of being able to script "actions" before/after running an accessibility analysis.

As far as Chrome, it's generally expected that you "bring your own" (especially in a lambda environment). For this, I use chrome-aws-lambdahttps://github.com/alixaxel/chrome-aws-lambda. It's got basically everything you'll need packaged up into a single npm installable thing.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dequelabs/axe-cli/issues/84#issuecomment-459359243, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABsCJgp9Wr4IlEd3xROIytV0tUH8QFnUks5vIvqLgaJpZM4aa9cP.

simi823 avatar Jan 31 '19 14:01 simi823

I've tried it on Ubuntu as well, but I keep getting this error:

root@1c99a09bbfbe:~# axe https://www.nj.com Running axe-core 3.1.2 in chrome-headless /usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/promise.js:2626 throw error; ^

WebDriverError: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.9.125-linuxkit x86_64) at Object.checkLegacyResponse (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/error.js:546:15) at parseHttpResponse (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/http.js:509:13) at doSend.then.response (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/http.js:441:30) at at process._tickCallback (internal/process/next_tick.js:188:7) From: Task: WebDriver.createSession() at Function.createSession (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/webdriver.js:769:24) at Function.createSession (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/chrome.js:761:15) at createDriver (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/index.js:170:33) at Builder.build (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/index.js:642:16) at startDriver (/usr/local/lib/node_modules/axe-cli/lib/webdriver.js:33:27) at testPages (/usr/local/lib/node_modules/axe-cli/lib/axe-test-urls.js:11:10) at Object. (/usr/local/lib/node_modules/axe-cli/index.js:73:1) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32)

From what I read here: https://stackoverflow.com/questions/53073411/selenium-webdriverexceptionchrome-failed-to-start-crashed-as-google-chrome-is

But the location of chrome is in the right place: root@1c99a09bbfbe:~# which google-chrome /usr/bin/google-chrome

Any suggestions on how to fix this???

simi823 avatar Jan 31 '19 16:01 simi823

Use webdriver-manager.

thedrow avatar Aug 20 '19 07:08 thedrow

Same error on Ubuntu even trying with webdriver-manager too.

giuliastro avatar Nov 20 '19 14:11 giuliastro

Thanks to @michael-siek, we think it might be related to this issue: https://github.com/SeleniumHQ/selenium/issues/4961. A few comments suggest that adding --no-sandbox when we start chromedriver will fix the problem. I'll go ahead and make a pr to do so and hopefully it will fix this issue.

straker avatar Dec 03 '19 15:12 straker

Scratch that, we already have a way you can do this without a pr. You can use the --chrome-options flag to add --no-sandbox. That should hopefully fix it for you.

$ axe --chrome-options="no-sandbox" www.deque.com

CC: @simi823 @giuliastro

straker avatar Dec 04 '19 15:12 straker