Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

"Error [ERR_IPC_CHANNEL_CLOSED]: channel closed" running concurrent npm installs on CircleCI 2.0 (npm 5.1.0) #17658

Open
choliver opened this issue Jul 7, 2017 · 1 comment

Comments

@choliver
Copy link

choliver commented Jul 7, 2017

I'm opening this issue because:

  • npm is crashing.

What's going wrong?

Running concurrent npm installs in Docker as root on CircleCI 2.0, I consistently see failures of the following form:

/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^

Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
    at process.target.send (internal/child_process.js:557:16)
    at callback (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/worker-farm/lib/child/index.js:29:17)
    at tryCatcher (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
    at Promise.successAdapter [as _fulfillmentHandler0] (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/nodeify.js:22:30)
    at Promise._settlePromise (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
    at Promise._settlePromise0 (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._settlePromise (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:582:21)
    at Promise._settlePromise0 (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._resolveCallback (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:432:57)
    at Promise._settlePromiseFromHandler (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:524:17)
    at Promise._settlePromise (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^

Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
    at process.target.send (internal/child_process.js:557:16)
    at callback (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/worker-farm/lib/child/index.js:29:17)
    at tryCatcher (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
    at Promise.successAdapter [as _fulfillmentHandler0] (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/nodeify.js:22:30)
    at Promise._settlePromise (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
    at Promise._settlePromise0 (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._settlePromise (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:582:21)
    at Promise._settlePromise0 (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._resolveCallback (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:432:57)
    at Promise._settlePromiseFromHandler (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:524:17)
    at Promise._settlePromise (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
/root/my-project/.gradle/npm/npm-v5.1.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:61

[... and so on over and over again ...]

Running the same thing in the same Docker image locally (i.e. not in CircleCI 2.0) works fine. So I wonder if it's related to the following issues where it worked locally, but not in Circle (this was our previous blocker prior to trying 5.1.0):

Also these similar Docker-related ones:

See also CircleCI discussions for more context on NPM/Docker/Circle weirdnesses:

(Note that this is being orchestrated by Gradle via the gradle-node-plugin hence the bizarre .gradle/npm/npm-v5.1.0 paths above. But this is hopefully irrelevant, as it worked fine in the pre-v5 days.)

How can the CLI team reproduce the problem?

Extracting a minimal repro will take time, because of the dependency on Circle 😢 I'll update this issue if and when I manage it 😉

Run the following under CircleCI: https://github.com/quartictech/npm-17658. It fails around 50% of the time - see e.g. https://circleci.com/gh/quartictech/npm-17658/86.

It's not yet minimal because it's still orchestrated by Gradle - I've tried invoking NPM directly with a script, and I can't make it fail in the same way. So it seems a failure occurs only if all of the following are true:

  • Running in Docker in CircleCI.
  • Running concurrent instances.
  • Orchestrated by Gradle (or maybe Java, or at least not Bash).

I'll continue to plug away at the repro to see if I can figure out why Gradle is important.

supporting information:

  • npm -v prints: 5.1.0
  • node -v prints: v8.1.3
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Debian 8 / Docker / CircleCI 2.0
  • Container:
    • I develop / deploy using Docker.
@choliver
Copy link
Author

choliver commented Jul 7, 2017

I've created a standalone repro, although it's not yet minimal - see https://github.com/quartictech/npm-17658.

This fails around 50% of the time on CircleCI - see e.g. https://circleci.com/gh/quartictech/npm-17658/86.

It's not minimal because it's still orchestrated by Gradle - I've tried invoking NPM directly with a script, and I can't make it fail in the same way. So it seems a failure occurs only if all of the following are true:

  • Running in Docker in CircleCI.
  • Running concurrent instances.
  • Orchestrated by Gradle (or maybe Java, or at least not Bash).

I'll continue to plug away at the repro to see if I can figure out why Gradle is important.

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

1 participant