teambition / gulp-ssh

SSH and SFTP tasks for gulp
184 stars 38 forks source link

with nodejs > 19.9, plugin doesn't work #107

Open jcvignoli opened 7 months ago

jcvignoli commented 7 months ago

I was expecting that Gulp 5 would address the fact that gulp-ssh is not compatible with nodejs > 19.9, but unfortunately it doesn't. I have quite a slow network (in particular a slow ping) which might be the reason why the ssh handshake fails as soon as I install, for example, the latest nodejs (v21, but the same happens with v20). I have a gulp workflow that copy my files from /src to /dist and then upload on a webserver my files. But with nodejs > 19.9 I get this error:

   at new PluginError (/node_modules/plugin-error/index.js:64:11)
    at Client.<anonymous> (/node_modules/gulp-ssh/index.js:57:27)
    at Client.emit (node:events:519:28)
    at Client.emit (node:domain:488:12)
    at Socket.<anonymous> (/node_modules/ssh2/lib/client.js:807:12)
    at Socket.emit (node:events:519:28)
    at Socket.emit (node:domain:488:12)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

which is actually this error when I throw it into the console:

AggregateError [ETIMEDOUT]: 
    at internalConnectMultiple (node:net:1116:18)
    at internalConnectMultiple (node:net:1184:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1710:5)
    at listOnTimeout (node:internal/timers:575:11)
    at process.processTimers (node:internal/timers:514:7) {
  code: 'ETIMEDOUT',
  level: 'client-socket',
  [errors]: [
    Error: connect ETIMEDOUT[ipv4 address removed]:22
        at createConnectionError (node:net:1646:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1705:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -110,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '[ipv4 address removed]',
      port: 22
    },
    Error: connect ENETUNREACH [ipv6 address removed]:22 - Local (:::0)
        at internalConnectMultiple (node:net:1180:16)
        at Timeout.internalConnectMultipleTimeout (node:net:1710:5)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -101,
      code: 'ENETUNREACH',
      syscall: 'connect',
      address: '[ipv6 address removed]',
      port: 22
    }
  ]
}

This happens very often, but it's not systematic. I believe that 90% of the uploads fail. I tried to patch my gulp-ssh index.js file with the latest pull, with no luck.

Any idea?