ChromeDriver Fails just after launching with the below error

Viewed 817

I'm trying to run protractor e2e tests in pipeline in azure devops, but it keeps on failing just after it loads the chrome webdriver. I'm running the same scripts in my local and its working fine but on azure devops it fails. Can anyone help me to understand why it fails?

Agent Specification: ubuntu-18.04 Agent Pool: Azure Pipelines Node Version: 10.x Using Azure Repos

and using the custom to update webdriver-manger both in root folder and in ./node_modules/protractor

and once that is done using npm running the e2e tests but just after using the chrome driver directly it fails.

2020-09-01T05:29:18.5579903Z [05:29:18] E/launcher - unknown error: Chrome failed to start: exited abnormally
2020-09-01T05:29:18.5580800Z   (unknown error: DevToolsActivePort file doesn't exist)
2020-09-01T05:29:18.5582329Z   (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
2020-09-01T05:29:18.5591888Z   (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 5.3.0-1034-azure x86_64)
2020-09-01T05:29:18.5592529Z [05:29:18] E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally
2020-09-01T05:29:18.5593004Z   (unknown error: DevToolsActivePort file doesn't exist)
2020-09-01T05:29:18.5593565Z   (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
2020-09-01T05:29:18.5594229Z   (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 5.3.0-1034-azure x86_64)
2020-09-01T05:29:18.5594817Z     at Object.checkLegacyResponse (/home/vsts/work/1/s/node_modules/selenium-webdriver/lib/error.js:546:15)
2020-09-01T05:29:18.5595359Z     at parseHttpResponse (/home/vsts/work/1/s/node_modules/selenium-webdriver/lib/http.js:509:13)
2020-09-01T05:29:18.5595916Z     at doSend.then.response (/home/vsts/work/1/s/node_modules/selenium-webdriver/lib/http.js:441:30)
2020-09-01T05:29:18.5596243Z     at process._tickCallback (internal/process/next_tick.js:68:7)
2020-09-01T05:29:18.5596481Z From: Task: WebDriver.createSession()
2020-09-01T05:29:18.5597051Z     at Function.createSession (/home/vsts/work/1/s/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
2020-09-01T05:29:18.5597527Z     at Function.createSession (/home/vsts/work/1/s/node_modules/selenium-webdriver/chrome.js:761:15)
2020-09-01T05:29:18.5597853Z     at Direct.getNewDriver (/home/vsts/work/1/s/node_modules/protractor/built/driverProviders/direct.js:77:33)
2020-09-01T05:29:18.5598181Z     at Runner.createBrowser (/home/vsts/work/1/s/node_modules/protractor/built/runner.js:195:43)
2020-09-01T05:29:18.5598472Z     at q.then.then (/home/vsts/work/1/s/node_modules/protractor/built/runner.js:339:29)
2020-09-01T05:29:18.5598732Z     at _fulfilled (/home/vsts/work/1/s/node_modules/q/q.js:834:54)
2020-09-01T05:29:18.5598967Z     at /home/vsts/work/1/s/node_modules/q/q.js:863:30
2020-09-01T05:29:18.5599328Z     at Promise.promise.promiseDispatch (/home/vsts/work/1/s/node_modules/q/q.js:796:13)
2020-09-01T05:29:18.5599570Z     at /home/vsts/work/1/s/node_modules/q/q.js:556:49
2020-09-01T05:29:18.5599801Z     at runSingle (/home/vsts/work/1/s/node_modules/q/q.js:137:13)
2020-09-01T05:29:18.5600161Z [05:29:18] E/launcher - Process exited with error code 199
2020-09-01T05:29:18.6127107Z An unexpected error occurred: undefined
2020-09-01T05:29:18.6680139Z npm ERR! code ELIFECYCLE
2020-09-01T05:29:18.6740337Z npm ERR! errno 1
2020-09-01T05:29:18.6740709Z npm ERR! minterest@1.0.0 e2e: `ng e2e`
2020-09-01T05:29:18.6740974Z npm ERR! Exit status 1
2020-09-01T05:29:18.6741161Z npm ERR! 
2020-09-01T05:29:18.6741404Z npm ERR! Failed at the minterest@1.0.0 e2e script.
2020-09-01T05:29:18.6742262Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-09-01T05:29:18.6770493Z 
2020-09-01T05:29:18.6770952Z npm ERR! A complete log of this run can be found in:
2020-09-01T05:29:18.6772054Z npm ERR!     /home/vsts/.npm/_logs/2020-09-01T05_29_18_670Z-debug.log

I know there are many solutions out there but nothing is working for me. Solutions that I have tried till now but it keeps on failing are mentioned below

  1. Adding 'args': ["--disable-dev-shm-usage" ], 'args': ["--no-sandbox" ].
  2. Tried and Install Chrome using the terminal commands to make sure it is installed in the correct path as mentioned by Rakesh in this link.
  3. Tried Downgrading to the webdriver-manager version to 2.38.
  4. Tried running in firefox browser(which works in local but not in azure devops).
  5. tried setting directConnect to false and and gave the selenium address
  6. also ran it in incognito mode
  7. tried running in headless mode which fails in local as well as on devops
  8. Also tried to ran a sample code but that also keeps on throwing the error.

What else should I do to solve this error? Can anyone help

0 Answers
Related