Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Running axe on Amazon Linux not finding Chrome #84

Open
simi823 opened this issue Jan 30, 2019 · 7 comments
Open

Running axe on Amazon Linux not finding Chrome #84

simi823 opened this issue Jan 30, 2019 · 7 comments

Comments

@simi823
Copy link

simi823 commented Jan 30, 2019

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.

@stephenmathieson
Copy link
Member

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.

@simi823
Copy link
Author

simi823 commented Jan 31, 2019 via email

@simi823
Copy link
Author

simi823 commented Jan 31, 2019

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???

@giuliastro
Copy link

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

@straker
Copy link
Contributor

straker commented Dec 3, 2019

Thanks to @michael-siek, we think it might be related to this issue: SeleniumHQ/selenium#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 straker mentioned this issue Dec 3, 2019
2 tasks
@straker
Copy link
Contributor

straker commented Dec 4, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@stephenmathieson @simi823 @straker @giuliastro and others