Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.5k views
in Java FTP by (120 points)
We're getting the following error when attempting to upload files bigger than 1GB:

com.enterprisedt.net.j2ssh.transport.TransportProtocolException: IO Error on socket: Connection reset by peer: socket write error
at com.enterprisedt.net.j2ssh.transport.b.a(TransportProtocolOutputStream.java:212)
at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.sendMessage(TransportProtocolCommon.java:473)
at com.enterprisedt.net.j2ssh.connection.ConnectionProtocol.sendChannelData(ConnectionProtocol.java:276)
at com.enterprisedt.net.j2ssh.connection.Channel.sendChannelData(Channel.java:223)
at com.enterprisedt.net.j2ssh.subsystem.SubsystemChannel.sendMessage(SubsystemChannel.java:72)
at com.enterprisedt.net.j2ssh.sftp.SftpSubsystemClient.writeFileAsync(SftpSubsystemClient.java:862)
at com.enterprisedt.net.j2ssh.sftp.SftpFileOutputStream.write(SftpFileOutputStream.java:130)
at com.enterprisedt.net.j2ssh.SftpClient.a(SftpClient.java:637)
at com.enterprisedt.net.j2ssh.SftpClient.put(SftpClient.java:1199)
at com.enterprisedt.net.j2ssh.SftpClient.put(SftpClient.java:1097)
at com.enterprisedt.net.ftp.ssh.SSHFTPClient.put(SSHFTPClient.java:1016)
at CDNsFTPUploader.uploadFile(CDNsFTPUploader.java:83)
at CDNsFTPUploader.uploadFile(CDNsFTPUploader.java:43)
at CDNsFTPUploader.main(CDNsFTPUploader.java:108)
Exception in thread "main" com.enterprisedt.net.ftp.ssh.SSHFTPException: The SSH client has not yet connected to the server. The requested action cannot be performed until after a connection has been established.
at com.enterprisedt.net.ftp.ssh.SCPClient.checkConnection(SCPClient.java:1185)
at com.enterprisedt.net.ftp.ssh.SSHFTPClient.quit(SSHFTPClient.java:1834)
at CDNsFTPUploader.uploadFile(CDNsFTPUploader.java:95)
at CDNsFTPUploader.uploadFile(CDNsFTPUploader.java:43)
at CDNsFTPUploader.main(CDNsFTPUploader.java:108)

The code works for files under 1GB. Here's the instantiation of the SSHFTPClient code (running within eclipse):

   private SSHFTPClient getFTPClient() throws Exception {
      SSHFTPClient sftp = new SSHFTPClient();
      sftp.setTimeout(50000);
      sftp.setRemoteHost("192.168.17.130");
      sftp.setRemotePort(990);
      sftp.setAuthentication("ubuntu", "*ubuntu!");
      sftp.getValidator().setHostValidationEnabled(false);
      sftp.setRekeyEnabled(true);
      sftp.setDetectTransferMode(true);
      sftp.setType(FTPTransferType.BINARY);
      sftp.connect();
      sftp.setUmask("0022");
      return sftp;
   }


Where 192.168.17.130 is a virtual ubuntu server in vmware player.

The very same file is uploaded without a problem with Filezilla on the same server, and the very same code works when uploading it to a different FTP server, or with the same ProFTPD 1.3.4b when files are less than 1GB in size.

We have added the "SFTPOptions PessimisticKexinit" setting in ProFTPD's configuration, as described in http://www.proftpd.org/docs/contrib/mod_sftp.html#Installation.

Any ideas will be much appreciated

1 Answer

0 votes
by (162k points)
Please enable logging at the DEBUG level and send us a *zipped* log file (support at enterprisedt dot com)

Categories

...