Npm install with alot of private repositories - connection_closed, cb never called()

Hi

What I Wanted to Do

I am using a package.json with 18 private packages (all pointing to my gitlab, “git+ssh” …). I Want to run npm install to download my packages.

What Happened Instead

When I try to run npm install, depending on npm version, I get different errors like ’ remote host connection_closed’, cb never called() etc…

Reproduction Steps

It seems it happens when you are requesting a server with sshd allowing less connections than npm install does when using mode silly to get metadata about the repositories.

My server had 10 connections max ( http://www.hypertable.com/documentation/misc/ssh_maxstartups/ ).

So to reproduce it should be easy, but requires to setup an environmnent:

  • dispose a git host (gitlab etc…) on a custom container/server etc…
  • create X (X > 5, the more is better) private repositories on the git host
  • create a repository which requires them all with urls of format “git+ssh”
  • decrease sshd_config ‘MaxStartups’ to 5 or lower.
  • try to run npm install on the package which requires the X private packages

Details

By increasing sshd_config MaxStartups to 30 on my server hosting Gitlab, I don’t have the error anymore.

I think that in silly mode, npm doesn’t close ssh connections, and is stacking them until it has all the repositories information.

Platform Info

$ npm --versions
{ npm: '6.9.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.33.0',
  node: '8.15.1',
  openssl: '1.0.2r',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.23.2',
  v8: '6.2.414.75',
  zlib: '1.2.11' }
$ node -p process.platform
linux

I hope this could help you.

Best regards

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.