You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(node:988) UnhandledPromiseRejectionWarning: Error: Timed out while waiting for handshake at Timeout._onTimeout (/home/dev/www_1/node_modules/ssh2/lib/client.js:687:19) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10) (node:988) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:988) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
also does not work
ssh.on('error', () => { // Or close, end.
console.log('ERRO');
})
I get this bug when I try to run on ubuntu 18.04 My windows test machine does not throw this error. Both machines are on the same network and trying to access the same machines.
as some quick testing. From ubuntu command line I can run
ssh 10.0.1.50
and get access to the requested device so there is definetly no network issue blocking. Problem is strictly with the node-ssh library not timing out when run from the ubuntu server but works on webstorm on the pc.
I can confirm this bug. In my case, it is thrown during initial connection (i assume ?), after i execute connect(...) on a new Client(). I'm unable to catch the error in the callback .on('error') {} nor in a try catch around the connection attempt.
Nevermind I'm able to catch the error. I was listening on client.exec().on('error', ..) not on the client directly with client.on('error', ...). Maybe this solves the problem for OP.
Activity
steelbrain commentedon May 4, 2020
Thanks for the report @lucaspojo
Is this error thrown during initial connection or during command execution? Any context here would help a lot.
mctrivia commentedon Sep 10, 2020
I get this bug when I try to run on ubuntu 18.04 My windows test machine does not throw this error. Both machines are on the same network and trying to access the same machines.
mctrivia commentedon Sep 10, 2020
as some quick testing. From ubuntu command line I can run
ssh 10.0.1.50and get access to the requested device so there is definetly no network issue blocking. Problem is strictly with the node-ssh library not timing out when run from the ubuntu server but works on webstorm on the pc.
heilmela commentedon Nov 11, 2020
I can confirm this bug. In my case, it is thrown during initial connection (i assume ?), after i execute
connect(...)on a new Client(). I'm unable to catch the error in the callback .on('error') {} nor in a try catch around the connection attempt.heilmela commentedon Nov 11, 2020
Nevermind I'm able to catch the error. I was listening on
client.exec().on('error', ..)not on the client directly with client.on('error', ...). Maybe this solves the problem for OP.steelbrain commentedon Nov 16, 2026
Fix for this will be part of v14
Keep an error listener for the connection's lifetime (#132)
Reject exec on connection errors and throwing callbacks (#132, #257)