0

I'm trying to transfer files from one server to another using phpseclib and the Net_SFTP get() function. The problem that I'm running into is that about half the time, the file doesn't actually transfer over. I have 10 files that are supposed to be transferred over and every time I run the script, it fails on different files so there isn't really a pattern on where it's failing. I did a var dump using getSFTPErrors() and that returns an array with 2 entries, both of which are NET_SFTP_STATUS_EOF: End of file

Does anyone know what that error means in regard to file transfers? The files that its transferring are made with the Linux split command so my first thought was that it had something to do with how the original file is split up, but then there should be a pattern of some sort. Any suggestions or a direction to start looking in would be greatly appreciated. Thanks for the help!

Eric Strom
  • 715
  • 9
  • 20
  • How big are the files you're trying to transfer? What version of phpseclib are you using? – neubert Dec 01 '14 at 19:22
  • Right now the files are around 4mb, but that will most likely change once I get everything working. It looks like the version of phpseclib is 1.5.0.0. – Eric Strom Dec 01 '14 at 19:27
  • I think you're looking at the svn version tags, which haven't even been around for a while. The latest phpseclib version is 0.1.9. You can download it from http://sourceforge.net/projects/phpseclib/files/phpseclib0.3.9.zip/download – neubert Dec 01 '14 at 22:13
  • Yup thats a my bad, I was looking at the individual files. I'm using 0.3.6 – Eric Strom Dec 01 '14 at 22:19
  • Just an update: I just updated the to latest phpseclib version and still get that error. – Eric Strom Dec 01 '14 at 22:36
  • In that case if you could do `define('NET_SSH2_LOGGING', 3)` and redirect the output to a file and then zip it up (the logs will probably be like maybe 10mb for a 4mb file) and then post a link to it that'd be helpful. – neubert Dec 01 '14 at 22:53
  • Here's a link to some of the logs. I just pasted what seems to be the end of a file that does transfer, and the beginning of a file that doesn't transfer. If you need more let me know, just thought I'd narrow it down to start http://pastebin.com/UqUF4FXt – Eric Strom Dec 01 '14 at 23:50
  • I'll try to check it out today after work. Thanks! – neubert Dec 03 '14 at 16:03
  • Thanks so much! I realized that out of habit, I made the past expire after an hour. Here's one that shouldn't expire: http://pastebin.com/r5Ms3J5H – Eric Strom Dec 03 '14 at 22:55
  • Sorry for the delay. Anyway, I dissected the relevant packet and nothing looks suspect about that: http://pastebin.com/GmJVYdMh If the server is saying the file has reached the end then that's what the server is saying and there's not a whole lot that can be done about that. Are you able to successfully transfer files with any other SFTP client? – neubert Dec 07 '14 at 14:02
  • Well from the logs it looks like your downloaded file should be 3,999,747 bytes long. Is it? And if not then how big is it? And how big is the file on the server? – neubert Dec 07 '14 at 14:15

0 Answers0