Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriverError: unknown error: Chrome failed to start: crashed. (unknown error: DevToolsActivePort file doesn't exist) #214

Closed
lhein opened this issue Jan 19, 2021 · 21 comments

Comments

@lhein
Copy link

lhein commented Jan 19, 2021

We are currently facing some errors in our build:

  • WebDriverError: unknown error: Chrome failed to start: crashed.
    (unknown error: DevToolsActivePort file doesn't exist)
  • TypeError: Cannot read property 'manage' of undefined

Please see the error ouput below. It does not happen on every build.
See also https://app.circleci.com/pipelines/github/jboss-fuse/vscode-atlasmap?branch=pull%2F514

Writing code settings to /home/circleci/vscode-atlasmap/test-resources/settings/User/settings.json
  1) "before all" hook in "{root}"
  2) "after all" hook in "{root}"

  0 passing (337ms)
  2 failing

  1) "before all" hook in "{root}":
     WebDriverError: unknown error: Chrome failed to start: crashed.
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /home/circleci/vscode-atlasmap/test-resources/VSCode-linux-x64/code is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}),platform=Linux 4.15.0-1077-aws x86_64)
      at Object.checkLegacyResponse (node_modules/selenium-webdriver/lib/error.js:546:15)
      at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:509:13)
      at /home/circleci/vscode-atlasmap/node_modules/selenium-webdriver/lib/http.js:441:30
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
  From: Task: WebDriver.createSession()
      at Function.createSession (node_modules/selenium-webdriver/lib/webdriver.js:769:24)
      at Function.createSession (node_modules/selenium-webdriver/chrome.js:761:15)
      at createDriver (node_modules/selenium-webdriver/index.js:170:33)
      at Builder.build (node_modules/selenium-webdriver/index.js:642:16)
      at VSBrowser.<anonymous> (node_modules/vscode-extension-tester/out/browser.js:77:18)
      at Generator.next (<anonymous>)
      at fulfilled (node_modules/vscode-extension-tester/out/browser.js:5:58)

  2) "after all" hook in "{root}":
     TypeError: Cannot read property 'manage' of undefined
      at VSBrowser.<anonymous> (node_modules/vscode-extension-tester/out/browser.js:114:48)
      at Generator.next (<anonymous>)
      at /home/circleci/vscode-atlasmap/node_modules/vscode-extension-tester/out/browser.js:8:71
      at new Promise (<anonymous>)
      at __awaiter (node_modules/vscode-extension-tester/out/browser.js:4:12)
      at VSBrowser.quit (node_modules/vscode-extension-tester/out/browser.js:113:16)
      at Context.<anonymous> (node_modules/vscode-extension-tester/out/suite/runner.js:69:35)
      at Generator.next (<anonymous>)
      at /home/circleci/vscode-atlasmap/node_modules/vscode-extension-tester/out/suite/runner.js:8:71
      at new Promise (<anonymous>)
@dcermak
Copy link
Contributor

dcermak commented Jan 20, 2021

Could you retry the test suite with vscode 1.50.0 or older? And did you by any chance introduce webpack or gulp recently?

@jrichter1
Copy link
Collaborator

I've also added a launch argument to chromedriver that should help in some situations. It might not be enough, but it shouldn't hurt. Feel free to try it out in the new micro version.

@apupier
Copy link
Member

apupier commented Feb 10, 2021

And did you by any chance introduce webpack or gulp recently?

No

@apupier
Copy link
Member

apupier commented Feb 10, 2021

I've also added a launch argument to chromedriver that should help in some situations. It might not be enough, but it shouldn't hurt. Feel free to try it out in the new micro version.

Can you point to the launch argument and explain where to add it please?

Note that it doesn't happen all the time. It is random.

@jrichter1
Copy link
Collaborator

Can you point to the launch argument and explain where to add it please?

It gets passed to chromedriver by extester, there is nothing for you to do. Just FYI, it's --disable-dev-shm-usage, apparently the most common solution to this problem.

@apupier
Copy link
Member

apupier commented Feb 10, 2021

Can you point to the launch argument and explain where to add it please?

It gets passed to chromedriver by extester, there is nothing for you to do. Just FYI, it's --disable-dev-shm-usage, apparently the most common solution to this problem.

it is still happenning:
https://app.circleci.com/pipelines/github/jboss-fuse/vscode-atlasmap/137/workflows/d41ccd15-9161-4bb9-9423-ebcfc3580495/jobs/170

@lakxraju
Copy link

I am also facing the same error but only in WSL environment. In mac, it is working fine. Are there any fixes/workarounds found in the meantime?

@apupier
Copy link
Member

apupier commented Jun 21, 2021

up. This issue is still occuring several times per week.

@jrichter1
Copy link
Collaborator

As discussed in #52 , it looks like on some CI systems chromedriver will have trouble launching if the binary is located on a sufficiently long path (and they don't need to be all that long for it to happen). It actually looks like a single path segment can make a difference.

Storing the test resources on a shorter path might help you here. There is a flag to specify just that -s path.

@apupier
Copy link
Member

apupier commented Sep 27, 2021

in #52 , if I understand well, the failure appears all the time, not randomly.
The path used seems to be relatively short already: /home/circleci/vscode-atlasmap/test-resources/VSCode-linux-x64/code
it sounds like a different problem.

(issue is still happening from time to time, for instance https://app.circleci.com/pipelines/github/jboss-fuse/vscode-atlasmap/501/workflows/feef7a96-a475-437f-a233-ed1f15ad1a24/jobs/609 )

@jrichter1
Copy link
Collaborator

Indeed this is a different issue than #52 . From the info I could find around the internet, the root cause is running chrome(driver) as a root user or using sudo.
Even though chromium has two flags that supposedly work around this issue, both are being used by extension tester, and apparently to no success.

Are you by chance running any of the commands using sudo, or as a root user?

@apupier
Copy link
Member

apupier commented Oct 5, 2021

Are you by chance running any of the commands using sudo, or as a root user?

I'm sure that it is not using sudo. I do not think that it is the root user. i tis the user provided by the default image of Circle CI.

@zhfnjust
Copy link

same error:

image

@sbobko
Copy link

sbobko commented Oct 12, 2022

The same:

Launching browser...

  1. "before all" hook in "{root}"
  2. "after all" hook in "{root}"

0 passing (228ms)
2 failing

  1. "before all" hook in "{root}":
    WebDriverError: unknown error: Chrome failed to start: crashed.
    (unknown error: DevToolsActivePort file doesn't exist)
    (The process started from chrome location /home/sergey/repos/frameworks.ide.vscode.extensions.oneapi-gdb-debug/test-resources/VSCode-linux-x64/code is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
    at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:522:15)
    at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:589:13)
    at Executor.execute (node_modules/selenium-webdriver/lib/http.js:514:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

  2. "after all" hook in "{root}":
    TypeError: Cannot read properties of undefined (reading 'manage')
    at VSBrowser. (node_modules/vscode-extension-tester/out/browser.js:126:48)
    at Generator.next ()
    at /home/sergey/repos/frameworks.ide.vscode.extensions.oneapi-gdb-debug/node_modules/vscode-extension-tester/out/browser.js:8:71
    at new Promise ()
    at __awaiter (node_modules/vscode-extension-tester/out/browser.js:4:12)
    at VSBrowser.quit (node_modules/vscode-extension-tester/out/browser.js:125:16)
    at Context. (node_modules/vscode-extension-tester/out/suite/runner.js:82:35)
    at Generator.next ()
    at /home/sergey/repos/frameworks.ide.vscode.extensions.oneapi-gdb-debug/node_modules/vscode-extension-tester/out/suite/runner.js:8:71
    at new Promise ()

Waiting for the debugger to disconnect...

@SlyryD
Copy link

SlyryD commented Oct 14, 2022

Repro'd this by passing a relative path argument user-data-dir=./path/to/dir. Using absolute path worked user-data-dir=/abspath/to/dir

@kiwi-bui
Copy link

I am also experiencing this issue(tried on v4.3.0 and v5.2.1). Has anybody found a solution?

I am running this in a github action linux runner:
extest get-vscode && extest get-chromedriver && extest install-vsix --extensions_dir ./test-resources/extensions --vsix_file ./dist/vscode-extension.vsix && extest install-from-marketplace --extensions_dir ./test-resources/extensions redhat.java vscjava.vscode-java-debug redhat.vscode-yaml && extest run-tests ./out/test/runPackageTests.js

I am getting essentially the same output:

Writing code settings to /home/runner/work/tanzu-developer-tools-for-vscode/tanzu-developer-tools-for-vscode/test-resources/settings/User/settings.json
Launching browser...
  1) "before all" hook in "{root}"
  2) "after all" hook in "{root}"

  0 passing (336ms)
  2 failing

  1) "before all" hook in "{root}":
     WebDriverError: unknown error: Chrome failed to start: crashed.
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /home/runner/work/tanzu-developer-tools-for-vscode/tanzu-developer-tools-for-vscode/test-resources/VSCode-linux-x64/code is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
      at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:524:15)
      at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:587:13)
      at Executor.execute (node_modules/selenium-webdriver/lib/http.js:515:28)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

  2) "after all" hook in "{root}":
     TypeError: Cannot read property 'manage' of undefined
      at VSBrowser.<anonymous> (node_modules/vscode-extension-tester/out/browser.js:126:48)
      at Generator.next (<anonymous>)
      at /home/runner/work/tanzu-developer-tools-for-vscode/tanzu-developer-tools-for-vscode/node_modules/vscode-extension-tester/out/browser.js:8:71
      at new Promise (<anonymous>)
      at __awaiter (node_modules/vscode-extension-tester/out/browser.js:4:12)
      at VSBrowser.quit (node_modules/vscode-extension-tester/out/browser.js:125:16)
      at Context.<anonymous> (node_modules/vscode-extension-tester/out/suite/runner.js:82:35)
      at Generator.next (<anonymous>)
      at /home/runner/work/tanzu-developer-tools-for-vscode/tanzu-developer-tools-for-vscode/node_modules/vscode-extension-tester/out/suite/runner.js:8:71
      at new Promise (<anonymous>)



npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test-package: `npm run test-package-get-resources && npm run test-package-install-extension && extest run-tests ./out/test/runPackageTests.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test-package script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2023-01-24T08_[46](https://github.com/vmware-tanzu/tanzu-developer-tools-for-vscode/actions/runs/3994410146/jobs/6852088986#step:21:47)_21_[63](https://github.com/vmware-tanzu/tanzu-developer-tools-for-vscode/actions/runs/3994410146/jobs/6852088986#step:21:64)4Z-debug.log

@kiwi-bui
Copy link

Repro'd this by passing a relative path argument user-data-dir=./path/to/dir. Using absolute path worked user-data-dir=/abspath/to/dir

What are you passing this argument to?

@Ullises
Copy link

Ullises commented Feb 14, 2023

Hi, I'm also getting the same issue as the last posted here, any suggestion?
image

@github-actions
Copy link

github-actions bot commented Jun 4, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@infiniteregrets
Copy link
Contributor

infiniteregrets commented Jun 7, 2023

experiencing the same issue, except it Error: Server terminated early with status 2

Writing code settings to /home/runner/work/mirrord/mirrord/vscode-ext/out/storage/settings/User/settings.json
Launching browser...
  1) "before all" hook in "{root}"
  2) "after all" hook in "{root}"

  0 passing (25ms)
  2 failing

  1) "before all" hook in "{root}":
     Error: Server terminated early with status 2
      at /home/runner/work/mirrord/mirrord/vscode-ext/node_modules/selenium-webdriver/remote/index.js:260:24
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

  2) "after all" hook in "{root}":
     TypeError: Cannot read properties of undefined (reading 'manage')
      at VSBrowser.<anonymous> (node_modules/vscode-extension-tester/out/browser.js:129:48)
      at Generator.next (<anonymous>)
      at /home/runner/work/mirrord/mirrord/vscode-ext/node_modules/vscode-extension-tester/out/browser.js:8:71
      at new Promise (<anonymous>)
      at __awaiter (node_modules/vscode-extension-tester/out/browser.js:4:12)
      at VSBrowser.quit (node_modules/vscode-extension-tester/out/browser.js:128:16)
      at Context.<anonymous> (node_modules/vscode-extension-tester/out/suite/runner.js:82:35)
      at Generator.next (<anonymous>)
      at /home/runner/work/mirrord/mirrord/vscode-ext/node_modules/vscode-extension-tester/out/suite/runner.js:8:71
      at new Promise (<anonymous>)
      at __awaiter (node_modules/vscode-extension-tester/out/suite/runner.js:4:12)
      at Context.<anonymous> (node_modules/vscode-extension-tester/out/suite/runner.js:80:24)

ci run: https://github.com/metalbear-co/mirrord/actions/runs/5204141829/jobs/9388134176

@djelinek
Copy link
Collaborator

djelinek commented Jun 9, 2023

Duplicates #485

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

No branches or pull requests