Since updating Node Red in my Home Assistant addon install to v20.2.3, I have an issue with the STPF Node.
Actually I am a bit confused with the versions
Node red is v4.1.1.
And the Addon i believe is V20.2.3
Maybe need to post this somewhere else?
Error
getSftpChannel: Packet length 1399350636 exceeds max length of 262144
Error: getSftpChannel: Packet length 1399350636 exceeds max length of 262144
at fmtError (/config/node_modules/ssh2-sftp-client/src/utils.js:55:18)
at /config/node_modules/ssh2-sftp-client/src/index.js:150:18
at SFTP.onError (/config/node_modules/ssh2/lib/client.js:1587:11)
at SFTP.emit (node:events:518:28)
at doFatalSFTPError (/config/node_modules/ssh2/lib/protocol/SFTP.js:2717:8)
at SFTP.push (/config/node_modules/ssh2/lib/protocol/SFTP.js:220:18)
at CHANNEL_DATA (/config/node_modules/ssh2/lib/client.js:585:23)
at 94 (/config/node_modules/ssh2/lib/protocol/handlers.misc.js:930:16)
at Protocol.onPayload (/config/node_modules/ssh2/lib/protocol/Protocol.js:2059:10)
at AESGCMDecipherNative.decrypt (/config/node_modules/ssh2/lib/protocol/crypto.js:987:26)
Any Ideas what I can do?
Just to further note:
I have reverted back to the add on v 20.2.2 and that didn't solve the issue
and now back to v20.2.1 and that didn't alter the issue.
So I do not believe that this is to do with the HA addon.
To prove that, you should stand up a separate, stand-alone instance of Node-RED and test there.
Many of us in the forum don't use HA at all, just Node-RED. So there aren't so many people who can help. You may need to also try the HA forum.
The HA add-in version and its odd versioning comes, I believe from HA and not from the core Node-RED devs who don't have anything to do with the HA addin.
Did you select the option to create a backup when you were prompted to upgrade?
v20.2.3, v20.2.2, v20.2.1. The difference between these 3 releases are changes to the home assistant nodes only. NR itself was updated v19.x - v20.x. You were probably running v19.
OK so yesterday I established that the hosting server had not made any alterations to their server settings or updates.
I re-installed the updates for the HA addons back to the latest as that obviously wasn't the issue.
I don't really want to go backwards with versions of Node-Red, because long term that is not a viable solution.
Next I updated the FTP/SFTP node in the palette, the effect of that created another issue.
The original node was over 7 years old and I noticed on the description page of the node this was updated 3 years ago, which version I had was impossible to determine. However I now can't authenticate the key, never mind send or receive data.
I tried a couple of other SFTP nodes, at least one of them had no labels against the input boxes and with the help of Chatgpt I managed to complete the entries, but not one of these worked. my conclusion is that there isn't a SFTP node I can use in my setup.
Now I have tried using FTPS, (I think that is what it is called), instead of SFTP and using the node-red-contrib-advanced-ftp, I have managed to get connected and all is working well now.
Hope that might shortcut things for somebody else, if they have a similar issue, always of course that the hosting server supports that method of transfer.
Assuming the original node you used is node-red-contrib-sftp (as it's about 7 years old as you mention) - then yes ... it is indeed a bit tired... the underlying library has moved on somewhat (and is still being maintained I think). Looking at the code it does seem the actual api calls have changed slightly so it's not totally simple to update by just refactoring in the latest lib - but it wouldn't be hard.
I've had a quick go and it seems to "work for me"... for gets and puts at least. I haven't published it to the library but you could install it manually in your .node-red directory by "npm i @dceejay/node-red-contrib-sftp" - If someone does try it and it seems to be OK then I will tidy it up and release it properly.
[edit] tried get on simplesi.net/last.txt (latest cheerlights colour) and that worked fine as well
And just to say - things get a mixed messed up with both yours and the original installed at same time so had to remove old one - delete config - then install yours and re-config
Hi - indeed they would get mixed up as mine is just the old one updated and tiny tweak to the api call to fix "get" command. Seeing as you confirm it works "in the wild" I'll carry on to tidy it up a bit more. Thanks
Indeed - the original had code in there to try to add it - but it wasn't working so i fixed it... but yes - can certainly add a name field. (Should have had one!)
Well I have been using it on two Pi instances uploading a few xml files to my website for about a year and on Nov 25th at 16 40 it stopped working. Which is very strange because the only change on that day was updating from 20.2.1 to 20.2.2.
As I do an auto backup to my NAS everyday I can see that is the only change.
I restored only the Node-red 20.2.1, not the whole of HA, as I didn't want to loose some other stuff I had done. However it didn't make any difference, maybe it affected some other thing that is irreversible.
I notice today there is another version 20.2.4 which has just popped up. I might load that on my test pi and see what happens.
The other thing is I think Windows handles SFTP calls in a slightly different way. because I could authenticate using Windows and power shell.
OK so I have just updated to 20.2.4.
Now I am confused.
My original Node in the flow, which has always been working there is no change to the error.
I still get getSftpChannel: Packet length 1399350636 exceeds max length of 262144.
If I drop a new Node into my flow and configure that to EXACTLY the same parameters I get a different error connect: Cannot parse privateKey: Failed to generate information to decrypt key.