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

cypress crash during long test run with error thrown by plugin / IPC channel closed #1953

Closed
bsmithEG opened this issue Jun 14, 2018 · 20 comments

Comments

@bsmithEG
Copy link

bsmithEG commented Jun 14, 2018

Current behavior:

After updating to 3.0.1 (from 3.0.0), after running a fairly large test run of 50 specs (compiled with the ts plugin), I've started to encounter these errors about 2/3 of the way through the suite. Every test afterwards fails immediately with the below stack trace:

Error: The following error was thrown by a plugin. We've stopped running your tests because a plugin crashed.

Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
    at ChildProcess.target.send (internal/child_process.js:584:16)
    at Object.send (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/util.js:34:27)
    at /root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/index.js:74:28
    at /root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/util.js:77:16
    at Promise.cancellationExecute [as _execute] (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/debuggability.js:321:9)
    at Promise._resolveFromExecutor (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:481:18)
    at new Promise (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:77:14)
    at Object.wrapParentPromise (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/util.js:61:14)
    at Object.before:browser:launch (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/index.js:67:27)
    at Object.execute (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/index.js:109:38)
    at /root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/browsers/electron.js:137:28
    at tryCatcher (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)
    at /root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/browsers/electron.js:133:32
    at tryCatcher (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)

    at Object.get (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/errors.js:129:13)
    at Object.wrapper [as get] (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/lodash/lodash.js:4968:19)
    at ChildProcess.handleError (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/index.js:92:24)
    at emitOne (events.js:115:13)
    at ChildProcess.emit (events.js:210:7)
    at ChildProcess.target.send (internal/child_process.js:588:12)
    at Object.send (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/util.js:34:27)
    at /root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/index.js:74:28
    at /root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/util.js:77:16
    at Promise.cancellationExecute [as _execute] (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/debuggability.js:321:9)
    at Promise._resolveFromExecutor (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:481:18)
    at new Promise (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:77:14)
    at Object.wrapParentPromise (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/util.js:61:14)
    at Object.before:browser:launch (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/index.js:67:27)
    at Object.execute (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/plugins/index.js:109:38)
    at /root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/browsers/electron.js:137:28
    at tryCatcher (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)
    at /root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/lib/browsers/electron.js:133:32
    at tryCatcher (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)

Desired behavior:

Steps to reproduce:

I'm not sure if it's specific to my suite -- I've tried on a repo of simple tests (in the 50 or some odd range), but I think it has more to do with the size or complexity of the tests. I'll have to do some work to get an example of the crash.

Versions

Cypress 3.0.1
CircleCI 2.0 Config
cypress/browsers:chrome65-ff57
using the cypress run --browser chrome option

@bsmithEG
Copy link
Author

I know that's not a lot to go on, is there some debug logging or something I could collect by configuring my cypress run so I could have them exported as artifacts from my build? I'm unable to reproduce this issue locally, and haven't tried to run locally with the container myself yet.

@bsmithEG
Copy link
Author

It seems like I'm using some incorrect command line options with the cypress command, specifically:

--spec **/*.spec.ts

If I drop that from my command line args, cypress runs with Chrome as I'd expect. I'll update the issue accordingly after a few CI runs if it seems that this fixes the problem with me (and it's electron specific -- I'm having a ton of issues across the board using Cypress with Electron and CI in general).

@bsmithEG
Copy link
Author

It looks like I also see this in the logs right before the above stack trace:

  Running: ds/ds-sitewide.spec.ts...                                 (22 of 37) 
(node:706) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exitEarlyWithErr listeners added. Use emitter.setMaxListeners() to increase limit

@brian-mann
Copy link
Member

brian-mann commented Jun 14, 2018

You need to quote the --spec argument.

https://on.cypress.io/command-line#cypress-run-spec-lt-spec-gt

As per the IPC channel dying, the stack trace is actually quite helpful here since its Cypress emitting this. @chrisbreiding can you take a look?

You can add a DEBUG env var and Cypress will output an absolutely massive stream of information in CI.

https://on.cypress.io/command-line#Debugging-commands

DEBUG=cypress:* cypress run <...>

@yknx4
Copy link

yknx4 commented Jan 24, 2019

👍 facing same issue

@jennifer-shehane jennifer-shehane added the stage: awaiting response Potential fix was proposed; awaiting response label Jan 24, 2019
@jennifer-shehane
Copy link
Member

Hey @yknx4, did you try to place quotes around the --spec arguments like cypress run --spec 'cypress/integration/login/**/*'?

If yes, and you're still facing this issue, can you provide the debug logs and also provide the content of your plugins folder?

@jennifer-shehane jennifer-shehane changed the title CircleCI + Cypress -- cypress crash during long test run, all tests afterwards fail immediately with stack trace cypress crash during long test run with error thrown by plugin / IPC channel closed Jan 24, 2019
@yknx4
Copy link

yknx4 commented Jan 24, 2019

@jennifer-shehane I'm not even using '--spec' arguments.

Plugins files

const browserify = require('@cypress/browserify-preprocessor')
const path = require('path')

module.exports = on => {
  const options = {
    browserifyOptions: {
      extensions: ['.js', '.ts'],
      plugin: [['tsify', { project: path.join(__dirname, 'tsconfig.json') }]]
    }
  }

  on('file:preprocessor', browserify(options))
}

I can give you a copy of the debug log given a more private channel, like email or IM, I don't want to have the log public on Github ~

@jennifer-shehane
Copy link
Member

@yknx4 Were you able to resolve your issue? If you still need, you can email us at [email protected] to send logs outside of GitHub.

@jennifer-shehane
Copy link
Member

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

@jennifer-shehane jennifer-shehane removed the stage: awaiting response Potential fix was proposed; awaiting response label Jul 11, 2019
@ZoroQualityAutomata
Copy link

@jennifer-shehane I was 12 hours too late! I'm seeing this issue too after converting my Cypress project to Typescript. I'll email the logs I have

@jennifer-shehane jennifer-shehane added the type: duplicate This issue or pull request already exists label Jul 12, 2019
@jennifer-shehane jennifer-shehane marked this as a duplicate of #1968 Jul 12, 2019
@jennifer-shehane jennifer-shehane removed the type: duplicate This issue or pull request already exists label Jul 12, 2019
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jul 12, 2019

Hey @ZoroQualityAutomata - after looking at your issue, it looks different from this one.

@ghost
Copy link

ghost commented Aug 5, 2019

I believe we're seeing something extremely similar to this and it's really hurting us in CI. It's intermittent - sometimes our full suite of E2E tests succeeds. However, quite often we'll have one test in the suite fail with:

[2019-08-05T07:44:57.780Z] Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
[2019-08-05T07:44:57.780Z]     at ChildProcess.target.send (internal/child_process.js:584:16)
[2019-08-05T07:44:57.780Z]     at Object.send (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/plugins/util.js:34:27)
[2019-08-05T07:44:57.780Z]     at EventEmitter.<anonymous> (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:60:18)
[2019-08-05T07:44:57.780Z]     at emitOne (events.js:120:20)
[2019-08-05T07:44:57.780Z]     at EventEmitter.emit (events.js:210:7)
[2019-08-05T07:44:57.780Z]     at Object.removeFile (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:108:19)
[2019-08-05T07:44:57.780Z]     at Object.options.onBrowserClose (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/open_project.js:98:30)
[2019-08-05T07:44:57.780Z]     at EventEmitter.<anonymous> (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/browsers/index.js:111:21)
[2019-08-05T07:44:57.780Z]     at Object.onceWrapper (events.js:314:30)
[2019-08-05T07:44:57.780Z]     at emitNone (events.js:110:20)
[2019-08-05T07:44:57.780Z]     at EventEmitter.emit (events.js:207:7)
[2019-08-05T07:44:57.780Z]     at BrowserWindow.<anonymous> (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/browsers/electron.js:248:29)
[2019-08-05T07:44:57.780Z]     at Object.onceWrapper (events.js:316:30)
[2019-08-05T07:44:57.780Z]     at emitOne (events.js:120:20)
[2019-08-05T07:44:57.780Z]     at BrowserWindow.emit (events.js:210:7)
[2019-08-05T07:44:57.780Z]     at tryToCall (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/browsers/electron.js:29:29)
[2019-08-05T07:44:57.780Z]     at EventEmitter.kill (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/browsers/electron.js:253:24)
[2019-08-05T07:44:57.780Z]     at /root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/browsers/index.js:33:16
[2019-08-05T07:44:57.780Z]     at Promise.cancellationExecute [as _execute] (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/debuggability.js:321:9)
[2019-08-05T07:44:57.780Z]     at Promise._resolveFromExecutor (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:481:18)
[2019-08-05T07:44:57.780Z]     at new Promise (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:77:14)
[2019-08-05T07:44:57.780Z]     at Object.kill [as close] (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/browsers/index.js:24:12)
[2019-08-05T07:44:57.780Z]     at Object.closeBrowser (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/open_project.js:161:25)
[2019-08-05T07:44:57.780Z]     at /root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/modes/run.js:661:30
[2019-08-05T07:44:57.780Z]     at tryCatcher (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
[2019-08-05T07:44:57.780Z]     at Promise._settlePromiseFromHandler (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:510:31)
[2019-08-05T07:44:57.780Z]     at Promise._settlePromise (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:567:18)
[2019-08-05T07:44:57.780Z]     at Promise._settlePromise0 (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
[2019-08-05T07:44:57.780Z]     at Promise._settlePromises (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
[2019-08-05T07:44:57.780Z]     at Async._drainQueue (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:133:16)
[2019-08-05T07:44:57.780Z]     at Async._drainQueues (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:143:10)
[2019-08-05T07:44:57.780Z]     at Immediate.Async.drainQueues (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:17:14)
[2019-08-05T07:44:57.780Z]     at runCallback (timers.js:781:20)
[2019-08-05T07:44:57.780Z]     at tryOnImmediate (timers.js:743:5)
[2019-08-05T07:44:57.780Z]     at processImmediate [as _immediateCallback] (timers.js:714:5)

After which, all subsequent specs fail with:

[2019-08-05T07:44:58.040Z] Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
[2019-08-05T07:44:58.040Z]     at ChildProcess.target.send (internal/child_process.js:584:16)
[2019-08-05T07:44:58.040Z]     at Object.send (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/plugins/util.js:34:27)
[2019-08-05T07:44:58.040Z]     at /root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/plugins/index.js:74:28
[2019-08-05T07:44:58.040Z]     at /root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/plugins/util.js:77:16
[2019-08-05T07:44:58.040Z]     at Promise.cancellationExecute [as _execute] (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/debuggability.js:321:9)
[2019-08-05T07:44:58.040Z]     at Promise._resolveFromExecutor (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:481:18)
[2019-08-05T07:44:58.040Z]     at new Promise (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:77:14)
[2019-08-05T07:44:58.040Z]     at Object.wrapParentPromise (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/plugins/util.js:61:14)
[2019-08-05T07:44:58.040Z]     at Object.before:browser:launch (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/plugins/index.js:67:27)
[2019-08-05T07:44:58.040Z]     at Object.execute (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/plugins/index.js:115:38)
[2019-08-05T07:44:58.040Z]     at /root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/browsers/electron.js:202:28
[2019-08-05T07:44:58.040Z]     at tryCatcher (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
[2019-08-05T07:44:58.040Z]     at Function.Promise.attempt.Promise.try (/root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)
[2019-08-05T07:44:58.040Z]     at /root/.cache/Cypress/3.1.5/Cypress/resources/app/packages/server/lib/browsers/electron.js:198:32
[2019-08-05T07:44:58.040Z]     at <anonymous>:null:null

We're using Cypress 3.1.5 and our plugins file is as follows - neither of these have changed since things were working fine:

const path = require('path')
const wp = require('@cypress/webpack-preprocessor')

module.exports = on => {
  const options = {
    webpackOptions: require('../../../../webpack.config')
  }

  on('file:preprocessor', wp(options))

  on('before:browser:launch', (browser = {}, args) => {
    if (browser.name === 'chrome') {
      const sampleFile = path.resolve('samples/speech.wav')
      args.push('--use-fake-ui-for-media-stream')
      args.push('--use-fake-device-for-media-stream')
      args.push(`--use-file-for-fake-audio-capture=${sampleFile}`)
      return args
    }
  })

  on('task', {
    log(message) {
      console.log(message)

      return null
    }
  })
}

@Narretz
Copy link
Contributor

Narretz commented Dec 17, 2020

I just encountered this issue with Cypress 5.6.0 after upgrading the cypress webpack preprocessor from 4.1.0 to 5.5.0, running in gitlab ci with Chrome 87.

The following error was thrown by a plugin. We stopped running your tests because a plugin crashed. Please check your plugins file (`/builds/project/repo/cypress/plugins/index.js`)
 Error [ERR_IPC_CHANNEL_CLOSED] [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.js:679:16)
    at Object.send (/builds/project/repo/tmp/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/plugins/util.js:28:25)
    at EventEmitter.<anonymous> (/builds/project/repo/tmp/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:47:16)
    at EventEmitter.emit (events.js:322:22)
    at Object.removeFile (/builds/project/repo/tmp/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:121:17)
    at Object.options.onBrowserClose (/builds/project/repo/tmp/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/open_project.js:119:28)
    at ChildProcess.<anonymous> (/builds/project/repo/tmp/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/browsers/index.js:213:19)
    at Object.onceWrapper (events.js:417:26)
    at ChildProcess.emit (events.js:322:22)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

 
    ....

      Running:  asdf/error_spec.ts                                                 (66 of 82)
Timed out waiting for the browser to connect. Retrying...
Timed out waiting for the browser to connect. Retrying again...
The browser never connected. Something is wrong. The tests cannot run. Aborting...
The browser never connected. Something is wrong. The tests cannot run. Aborting...

and all subsequent suites also fail. The whole run usually takes around 60 minutes, and has 480 tests.
If I find the time, I will test which version exactly causes the problem.

@Count174
Copy link

Count174 commented Sep 13, 2021

I've just faced the same issue on Cypress 7.5.0. Suite is running via Jenkins CI and I've never experienced such error

The following error was thrown by a plugin. We stopped running your tests because a plugin crashed. Please check your plugins file ('/e2e/cypress/plugins/index.js')

 Error [ERR_IPC_CHANNEL_CLOSED] [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.js:705:16)
    at Object.send (/root/.cache/Cypress/7.5.0/Cypress/resources/app/packages/server/lib/plugins/util.js:32:25)
    at EventEmitter.<anonymous> (/root/.cache/Cypress/7.5.0/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:45:16)
    at EventEmitter.emit (events.js:327:22)
    at Object.removeFile (/root/.cache/Cypress/7.5.0/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:119:17)
    at Object.options.onBrowserClose (/root/.cache/Cypress/7.5.0/Cypress/resources/app/packages/server/lib/open_project.js:137:28)
    at ChildProcess.<anonymous> (/root/.cache/Cypress/7.5.0/Cypress/resources/app/packages/server/lib/browsers/index.js:212:19)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:327:22)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

@BurhanH
Copy link

BurhanH commented Nov 2, 2021

Same here. Cypress 8.5.0. Docker. Chrome browser in headless mode.
The following error was thrown by a plugin. We stopped running your tests because a plugin crashed. Please check your plugins file (/usr/src/app/cypress/plugins/index.js) Error [ERR_IPC_CHANNEL_CLOSED] [ERR_IPC_CHANNEL_CLOSED]: Channel closed at ChildProcess.target.send (internal/child_process.js:705:16) at Object.send (/root/.cache/Cypress/8.5.0/Cypress/resources/app/packages/server/lib/plugins/util.js:32:25) at EventEmitter.<anonymous> (/root/.cache/Cypress/8.5.0/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:45:16) at EventEmitter.emit (events.js:327:22) at Object.removeFile (/root/.cache/Cypress/8.5.0/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:119:17) at Object.options.onBrowserClose (/root/.cache/Cypress/8.5.0/Cypress/resources/app/packages/server/lib/open_project.js:163:40) at ChildProcess.<anonymous> (/root/.cache/Cypress/8.5.0/Cypress/resources/app/packages/server/lib/browsers/index.js:212:19) at Object.onceWrapper (events.js:422:26) at ChildProcess.emit (events.js:327:22) at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

@SophieDePaula
Copy link

Hi, I am seeing the same issue with Cypress 8 and 8.4.
Here you can find the complete log file, but essentially the error I see is:

 Error [ERR_IPC_CHANNEL_CLOSED] [ERR_IPC_CHANNEL_CLOSED]: Channel closed
     at ChildProcess.target.send (internal/child_process.js:705:16)
     at Object.send (/app/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/plugins/util.js:32:25)
     at EventEmitter.<anonymous> (/app/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:45:16)
    at EventEmitter.emit (events.js:327:22)
     at Object.removeFile (/app/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/plugins/preprocessor.js:119:17)
    at Object.options.onBrowserClose (/app/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/open_project.js:148:26)
    at ChildProcess.<anonymous> (/app/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/browsers/index.js:212:19)
     at Object.onceWrapper (events.js:422:26)
     at ChildProcess.emit (events.js:327:22)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

And:

 Error [ERR_IPC_CHANNEL_CLOSED] [ERR_IPC_CHANNEL_CLOSED]: Channel closed
     at ChildProcess.target.send (internal/child_process.js:705:16)
     at Object.send (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/lib/plugins/util.js:32:25)
     at /home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/lib/plugins/index.js:161:17
     at /home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/lib/plugins/util.js:85:14
     at Promise.cancellationExecute [as _execute] (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/debuggability.js:406:9)
     at Promise._resolveFromExecutor (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:518:18)
     at new Promise (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:103:10)
     at Object.wrapParentPromise (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/lib/plugins/util.js:63:12)
     at Object.after:run (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/lib/plugins/index.js:146:23)
     at Object.execute (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/lib/plugins/index.js:231:33)
     at Object.<anonymous> (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/lib/plugins/run_events.js:10:20)
     at Object.tryCatcher (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
     at Object.execute (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/method.js:15:34)
     at /home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/lib/modes/run.js:1399:26
     at tryCatcher (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
     at Promise._settlePromiseFromHandler (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
     at Promise._settlePromise (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
     at Promise._settlePromiseCtx (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:641:10)
     at _drainQueueStep (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:97:12)
     at _drainQueue (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
     at Async._drainQueues (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
     at Immediate.Async.drainQueues [as _onImmediate] (/home/runner/.cache/Cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
     at processImmediate (internal/timers.js:461:21)

More details about the test suite:
We have a plugin that starts a local server, that local server communicates with the browser constantly.

We believe that the ERR_IPC_CHANNEL_CLOSED error is a symptom of a plugin crash and that Cypress doesn't show the actual reason for the crash, but rather errors when trying to communicate with the plugin process as part of the browser close operation.
Is there a way to get more visibility to the actual error that happened?

@lewisP707
Copy link

Having the same issue. Can this be reopened?

@SophieDePaula
Copy link

@jennifer-shehane can we reopen this thread? See my comment above

@mjhenkes
Copy link
Member

mjhenkes commented Jan 4, 2022

@SophieDePaula with this change #19553 we will be doing a better job of surfacing errors that occur in plugin code.

@gogoid88
Copy link

I am facing the same issue with cypress 9.6.0 on docker.

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

No branches or pull requests