UnhandledPromiseRejectionWarning

Open
#346 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
node.js, typescript
Domain
networking

Research direction

No repository file or test is named. Start by reproducing the asynchronous SSH command loop described in the report, then inspect the stack frames in node_modules/ssh2/lib/client.js and node_modules/ssh2-streams/lib/ssh.js. Done means identifying the rejected operation and documenting or correcting how the caller handles that rejection.

Written by the indexing model from the issue text.

Description

unconfirmed bug

Hello !
First of all I want to tell you that I love your module!
Here is the mistake I come across:

(node:20550) UnhandledPromiseRejectionWarning: Error: (SSH) Channel open failure: open failed
    at SSH2Stream.onFailure (/usr/src/app/node_modules/ssh2/lib/client.js:1205:13)
    at Object.onceWrapper (events.js:421:26)
    at SSH2Stream.emit (events.js:314:20)
    at SSH2Stream.EventEmitter.emit (domain.js:486:12)
    at parsePacket (/usr/src/app/node_modules/ssh2-streams/lib/ssh.js:3455:10)
    at SSH2Stream._transform (/usr/src/app/node_modules/ssh2-streams/lib/ssh.js:701:13)
    at SSH2Stream.Transform._read (_stream_transform.js:205:10)
    at SSH2Stream._read (/usr/src/app/node_modules/ssh2-streams/lib/ssh.js:253:15)
    at SSH2Stream.Transform._write (_stream_transform.js:193:12)
    at writeOrBuffer (_stream_writable.js:352:12)
(node:20550) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 12)

I run an SSH command in a for loop in an asynchronous function and I don’t understand why I always have this error

Dominant language
TypeScript
Stars
1k
Forks
94
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from steelbrain/node-ssh

All issues in steelbrain/node-ssh

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.