UnhandledPromiseRejectionWarning: Error: invalid command ping www.google.com
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- node.js, typescript
- Domain
- backend, networking
Research direction
Start with the supplied index.js example and trace the execCommand("ping www.google.com") entry point in node-ssh. Check how the command and its arguments are sent to the switch, then compare the returned error with the manual session. Done means the reproduction is explained and the behavior or usage is verified.
Written by the indexing model from the issue text.
Description
I am attempting to connect to one of my network switches via ssh and just run the command ping www.google.com but get the following error:
node index.js
Ping Completed
(node:56662) UnhandledPromiseRejectionWarning: Error: invalid command www.google.com.
...
My config:
ssh
.connect({
host: "172.35.0.2",
username: "admin",
port: 22,
password,
// debug: console.log,
algorithms: {
kex: [
"diffie-hellman-group1-sha1",
"ecdh-sha2-nistp256",
"ecdh-sha2-nistp384",
"ecdh-sha2-nistp521",
"diffie-hellman-group-exchange-sha256",
"diffie-hellman-group14-sha1",
],
cipher: [
"3des-cbc",
"aes128-ctr",
"aes192-ctr",
"aes256-ctr",
"aes128-gcm",
"[email protected]",
"aes256-gcm",
"[email protected]",
],
serverHostKey: [
"ssh-rsa",
"ecdsa-sha2-nistp256",
"ecdsa-sha2-nistp384",
"ecdsa-sha2-nistp521",
],
hmac: ["hmac-sha2-256", "hmac-sha2-512", "hmac-sha1"],
},
})
.then(() => {
ssh
.execCommand("ping www.google.com", { options: { pty: true } })
.then((result) => {
console.log("STDOUT: " + result.stdout);
console.log("STDERR: " + result.stderr);
});
})
.then(
function () {
console.log("Ping Completed");
},
function (error) {
console.log("Something's wrong");
console.log(error);
}
);
What am I doing wrong?
I am able to manually connect to the switch and run ping successfully:
olt-lab-01# ping www.google.com
Resolving www.google.com... 172.217.170.100
sent rcvd rate rtt avg mdev max min reply from
1 1 100 20 20 0 20 20 172.217.170.100
2 2 100 95 29 19 95 20 172.217.170.100
3 3 100 18 28 17 95 18 172.217.170.100
olt-lab-01#
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from steelbrain/node-ssh
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
steelbrain/node-ssh#487 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
steelbrain/node-ssh#482 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
steelbrain/node-ssh#474 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
steelbrain/node-ssh#473 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
steelbrain/node-ssh#472 ·
All issues in steelbrain/node-ssh
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 62/100
lingdojo/kana-dojo#34127 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
osmlab/name-suggestion-index#13104 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100