Closed chrplr closed 1 year ago
Likely, what is happening is that the remote service is has so many extensions, that it oversteps the builtin 256 kibibyte maximum packet size of the packet reader.
Thanks!
I did not configure sftp manually (I only installed opensshserver under linux ubuntu 20.04)
But I did something I should have tried before, that is, connect from the command line, and the issue is already there (see below). So it is indeed a problem with the configuration of the sftp server. Sorry for opening this issue. I close it. HAve a nice day.
PS: explanation => https://www.pcwdld.com/troubleshooting-received-message-too-long (The starter bash files need to be quiet to not interfere with the SFTP (or SCP2) protocol.). The problem was solved by adding [[ $- == *i* ]] || return
on the first line of ~/.bashrc
> sftp localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
xxxxxx@localhost's password:
Received message too long 543121247
In the following code, sftp.newclient() returns an error "packet too long". This is not simply a connection issue as I can open a ssh connection and use run to display execute a command on the remote server. Below, I have pasted code from dlv showing that the error arises from
github.com/pkg/sftp.recvPacket()
at line 272.Passing the option
sftp.MaxPacketChecked(1024)
or not, has no effect.I suspect it must be a silly problem in my code, not pkg/sftp, but I do not see the bug.