cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: SFTP "File already completely downloaded" but the file is empty

From: NEDJARI Hafed <hnedjari_at_generixgroup.com>
Date: Tue, 12 Jun 2012 15:16:57 +0000

Here is the curl command .... but always "File already download" message.

E:\Temp\curl\curl-7.24.0-ssh2-ssl-sspi-zlib-static-bin-w32>curl -k -v -u login:passwd sftp://sftp.tradinggrid.gxs.com/AMR52527/././POLLABLE/%2513348364340002%25O093108548006900%25SFTP%25POLLABLE%2539fedh006vfv8h570007s0kr > plop.txt
* About to connect() to sftp.tradinggrid.gxs.com port 22 (#0)
* Trying 204.90.130.72...
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0*
connected
* Connected to sftp.tradinggrid.gxs.com (204.90.130.72) port 22 (#0)
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0*
SSH MD5 fingerprint: 805a4c765e53d1b81adb3fe455f781a9
* SSH authentication methods available: publickey,password
* Using ssh public key file E:\TradeXpress\users\exploitedi/.ssh/id_dsa.pub
* Using ssh private key file E:\TradeXpress\users\exploitedi/.ssh/id_dsa
* SSH public key authentication failed: Unable to open public key file
* Initialized password authentication
* Authentication complete
  0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0*
File already completely downloaded
  0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
  0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
* Connection #0 to host sftp.tradinggrid.gxs.com left intact
  0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0*
Closing connection #0

E:\Temp\curl\curl-7.24.0-ssh2-ssl-sspi-zlib-static-bin-w32>

I get exactly the same result with :

-bash-4.1$ curl --version
curl 7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
-bash-4.1$

I have no problem to download a file with psftp (GXS documentation talk also about PuTTY SFTP, WinSCP SFTP, OpenSSH SFTP and Cleo Lexicom SFTP)

get and/or mget command to download the documents.

As our binaries use curl, you need to know that I have this problem only with this specific server .... and I don't know why !

Thanks.

Hafed

-----Message d'origine-----
De : curl-library-bounces_at_cool.haxx.se [mailto:curl-library-bounces_at_cool.haxx.se] De la part de Daniel Stenberg
Envoyé : mardi 3 avril 2012 23:35
À : libcurl development
Objet : Re: SFTP "File already completely downloaded" but the file is empty

On Mon, 26 Mar 2012, NEDJARI Hafed wrote:

> With libcurl 7.23.1 and libssh2 1.3.0

...

> The log "* file already completely downloadedl" is displayed by libcurl when
> the function libssh2_sftp_stat_ex returns an attrs.filesize to 0 (zero). It
> seems that the stat function is not supported by the GXS server.

Do you _know_ this or do you guess this is the reason? The SSH_FXP_FSTAT
packet type is a fundamental piece of SFTP and it seems *really* odd to me
that any server claiming to support SFTP would not support it.

I think there's a serious risk the bug is different.

> IMPORTANT : this case has already been reported to you :
> http://curl.haxx.se/mail/archive-2009-01/0114.html

... on a very early libssh2 version and the reporter didn't respond to follow
up. Unfortunately such "bug reports" are left behind to die.

> Are you agree with our possible explanation ?

I would like to be sure first.

But looking at the libcurl code, it actually tries to "survive" even if
libssh2_sftp_stat_ex() returns an error and the size is unknown. Can you
figure out what goes wrong and what we can do about it?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-06-12