Please ignore my previous email. The problem was I had a typo in a filename.
You'd think if it tries downloading a file that doesn't exist it would return some more meaningful error, such as "file not found". Instead it gives me an SFTP protocol error and a message from the server: "Internal server error". Sorry for the false alarm. Bob > -----Original Message----- > From: Bob Kast [mailto:[email protected]] > Sent: Wednesday, July 16, 2014 12:59 PM > To: 'libssh2 development' > Subject: Getting "Internal Server Error" from SFTP server > > My SFTP installation is used to fetch files from a specific SFTP server. It has > been working fine for many months and now suddenly it is failing. I suspect > that my company has upgraded their SFTP server. > > Some shorter files (about 78k bytes) work fine, but when it attempts to > download a 36Mbyte file it fails with -31 (LIBSSH2_ERROR_SFTP_PROTOCOL). > Oddly enough, it fails in the first call to libssh2_sftp_read() (with a buffer of > 40,000 bytes), so I'm not sure what the length of the file has to do with > anything. > > I can use filezilla to successfully download the files using SFTP, so I'm not sure > if this is a problem with their server or libssh2. > > I've done a run with debug tracing on and I've attached the output. > Unfortunately, I'm not sure what I'm looking at, except for the bit at the end > where it receives this from the server: > > 0000: 5E 00 00 00 00 00 00 00 2D 00 00 00 29 65 00 00 : ^.......-...)e.. > 0010: 00 02 00 00 00 04 00 00 00 16 49 6E 74 65 72 6E : ..........Intern > 0020: 61 6C 20 73 65 72 76 65 72 20 65 72 72 6F 72 2E : al server error. > 0030: 00 00 00 02 65 6E : ....en > > I've tried it with wincng and openssl and both fail and I've tried a buffer size > of 2000 bytes instead of 40000. > > I've found in the past that I NEED to specify a buffer that is an exact multiple > of 2000 bytes for it to work with this SFTP server. > > If anyone has any ideas on how to proceed, I'd greatly appreciate it. > > Thanks, > Bob Kast > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
