mikejdorm / sftp_ex

MIT License
25 stars 23 forks source link

ls/2 hangs #16

Open andrelip opened 5 years ago

andrelip commented 5 years ago

I've used sftp_ex with no issue at all in the past. But now I can connect to the server but every other operation hangs. Same behaviour with ssh_sftp.start_channel/3 and list_dir/3. The shell hangs forever or I receive a timeout if ssh_sftp receives the optional parameter. Using filezilla it loads in 3 seconds. The root folder only have 9 folders. Connecting to the same server through ftp works fine with :ftp. Any clue?

Filezilla trace (logger level 4)

Command:    open "(ommited).exavault.com" 22
Trace:          Server version: SSH-2.0-mod_sftp
Trace:          Using SSH protocol version 2
Trace:          Doing ECDH key exchange with curve nistp256 and hash SHA-256
Trace:          Host key fingerprint is:
Trace:          ssh-rsa 2048 0e:ce:3e:a2:be:7e:45:1f:0b:dd:c5(ommited)
Command:    Trust new Hostkey: Once
Trace:          Initialised AES-256 SDCTR client->server encryption
Trace:          Initialised HMAC-SHA-256 client->server MAC algorithm
Trace:          Initialised AES-256 SDCTR server->client encryption
Trace:          Initialised HMAC-SHA-256 server->client MAC algorithm
Trace:          Pageant is running. Requesting keys.
Trace:          Pageant has 0 SSH-2 keys
Command:    Pass: **************
Trace:          Sent password
Trace:          Access granted
Trace:          Opening session as main channel
Trace:          Opened main channel
Trace:          Started a shell/command
Status:         Connected to arvoredelivros.exavault.com
Trace:          CSftpControlSocket::ConnectParseResponse()
Trace:          CSftpControlSocket::ResetOperation(0)
Trace:          CControlSocket::ResetOperation(0)
Status:         Retrieving directory listing...
Trace:          CSftpControlSocket::SendNextCommand()
Trace:          CSftpControlSocket::ChangeDirSend()
Command:    pwd
Response:   Current directory is: "/"
Trace:          CSftpControlSocket::ResetOperation(0)
Trace:          CControlSocket::ResetOperation(0)
Trace:          CSftpControlSocket::ParseSubcommandResult(0)
Trace:          CSftpControlSocket::ListSubcommandResult()
Trace:          CSftpControlSocket::SendNextCommand()
Trace:          CSftpControlSocket::ListSend()
Command:    ls
Status:         Listing directory /
Trace:          CSftpControlSocket::ListParseResponse()
Trace:          CSftpControlSocket::ResetOperation(0)
Trace:          CControlSocket::ResetOperation(0)
Status:         Directory listing of "/" successful
jocyvanpg commented 5 years ago

Hey @andrelip, do you solved that?

andrelip commented 5 years ago

@jocyvanpg No. I had to fork ExFtp to use in my pipeline. https://github.com/andrelip/exftp

DerTim1 commented 3 years ago

Using SftpEx.connect/1 with option sftp_svn: 3 may solve this problem for some sftp hosts, showing this behaviour. Due to an other hint, this is an issue because the client is choosing version 4 and old host implementation using version 3.

https://elixirforum.com/t/no-response-from-ssh-sftp-list-dir-2-when-given-path-other-than-root/25130/4