Open novski opened 10 months ago
I found this issue #2 and tried the same with a function node:
[
{
"id": "d77bd36f191e36e1",
"type": "ssh-exec",
"z": "eb5fe652f01eee64",
"sshconfig": "node-red",
"name": "octopi",
"host": "octopi",
"port": 22,
"username": "myUser",
"x": 720,
"y": 3080,
"wires": [
[
"6fc200658a27e452"
]
]
},
{
"id": "f34dc88b3da3f789",
"type": "catch",
"z": "eb5fe652f01eee64",
"name": "",
"scope": [
"d77bd36f191e36e1"
],
"uncaught": false,
"x": 690,
"y": 3140,
"wires": [
[
"813e2d54241e3ee4"
]
]
},
{
"id": "6fc200658a27e452",
"type": "debug",
"z": "eb5fe652f01eee64",
"name": "debug 71",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 900,
"y": 3080,
"wires": []
},
{
"id": "813e2d54241e3ee4",
"type": "debug",
"z": "eb5fe652f01eee64",
"name": "debug 72",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 900,
"y": 3140,
"wires": []
},
{
"id": "a68ff67b1c2be3ac",
"type": "inject",
"z": "eb5fe652f01eee64",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 330,
"y": 3080,
"wires": [
[
"ca19e955d44b9025"
]
]
},
{
"id": "ca19e955d44b9025",
"type": "function",
"z": "eb5fe652f01eee64",
"name": "payload:pwd\\n",
"func": "msg.payload = \"pwd\\n\"\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 3080,
"wires": [
[
"d77bd36f191e36e1",
"363fc4aa7fa933d8"
]
]
},
{
"id": "363fc4aa7fa933d8",
"type": "debug",
"z": "eb5fe652f01eee64",
"name": "debug 73",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 700,
"y": 3020,
"wires": []
}
]
I think there are more Problems.
Why does the node export above show myUser
?
If I configure to use the config file, it should use the user set in the config.
As well as not setting a user leads to an error on deploy because NR thinks the node is not properly configured.
If the two are not related, you can tell me and I will create two separate issues...
The cannot read [0] is a result of the ssh-config object not found. handled in 0.3.5
The "can not read properties of undefined (reading '0')" is now fixed.
I installed this node today (0.3.2) and I am encountering that error. When will the fix be pushed to the repository?
0.3.5?
The package name has changed to
@insectos/node-red-ssh-exec v0.3.5
Describe the bug I set up an ssh connection that works from cli on NR host. Proved by executing
ssh node-red
while "node-red" is the Host in my config file not the hostname of the remote client.Then I tried to execute a primitive cli command like
pwd
but got anTypeError: Cannot read properties of undefined (reading '0')
back from the catch node. As next, I tried to execute thepwd
with a newline as mentioned in the readme.pwd \n
Somehow that generates some (I assume) escape, see belowpwd \\n
.To Reproduce Steps to reproduce the behavior:
Expected behavior to get the path of my remote client connection back.
Screenshots
Workstation / Process / Context
Full NR debug object: