cURL / Mailing Lists / curl-users / Single Mail

curl-users

Problem with sftp directory listing: Could not open remote file for reading: Unknown error in libssh2 :: -37

From: Emanuel Norrbin <emanuel.norrbin_at_jitterbit.com>
Date: Mon, 22 Sep 2014 12:40:29 -0700

I'm having a problem doing a directory listing on a particular sftp server.
I'm not exactly sure what make the sftp server is but I get this when I log
in using FileZilla client, "Response: fzSftp started", so it could be a
FileZilla server. I'm not having any problems with other sftp servers.

I'm using the latest curl version and a recent libssh2 snapshot:

$ curl --version
curl 7.38.0 (i686-pc-linux-gnu) libcurl/7.38.0 OpenSSL/0.9.8y zlib/1.2.3.4
libssh2/1.4.4-20140922
Protocols: file ftp ftps http https scp sftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz

This is the command that fails and the output:

$ curl sftp://ftp3.xxx.com/ftp/ADAP323/bookings/ -u "XX:YY" --trace
/tmp/curl.trace -k
drwxr-x--- 2 ADAP323 FTPADM 8192 Sep 22 15:11 .
curl: (79) Could not open remote file for reading: Unknown error in libssh2
:: -37

The contents of /tmp/curl.trace is (with some anonymization):
== Info: Hostname was NOT found in DNS cache
== Info: Trying XXX.YY.ZZZ.QQ...
== Info: Connected to ftp3.xxx.com (XXX.YY.ZZZ.QQ) port 22 (#0)
== Info: SSH MD5 fingerprint: f4cbcaff21936a0d247362ef7ea33dde
== Info: SSH authentication methods available: publickey,password
== Info: Using ssh public key file /home/emanuel/.ssh/id_dsa.pub
== Info: Using ssh private key file /home/emanuel/.ssh/id_dsa
== Info: SSH public key authentication failed: Unable to open public key
file
== Info: Initialized password authentication
== Info: Authentication complete
=> Send data, 58 bytes (0x3a)
0000: 64 72 77 78 72 2d 78 2d 2d 2d 20 20 20 20 32 20 drwxr-x--- 2
0010: 41 44 41 50 33 32 33 20 20 46 54 50 41 44 4d 20 ADAP323 FTPADM
0020: 20 20 20 20 20 20 38 31 39 32 20 53 65 70 20 32 8192 Sep 2
0030: 32 20 31 35 3a 31 31 20 2e 0a 2 15:11 ..
== Info: Could not open remote file for reading: Unknown error in libssh2
:: -37
== Info: Connection #0 to host ftp3.xxx.com left intact

I build libssh2 with: --prefix #{node.build.install} --with-openssl
--with-libssl-prefix=#{node.build.install}

and curl: --prefix #{node.build.install} --disable-ldap --disable-dict
--disable-gopher --disable-imap --disable-pop3 --disable-rtsp --disable-smtp
--disable-telnet --disable-tftp --with-ssl=#{node.build.install}
--with-libssh2=#{node.build.install}"

#{node.build.install} just expands to my install directory, e.g. /usr/local.

Let me know if you think this is a problem with libssh2 and I will try
their forum or if there is any other information that I could provide.

/Thanks
Emanuel

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-09-22