SFTP through JSch throws error 4: Failure

I am having a special problem when trying an SFTP file from Windows to a Unix server. Stack Trace Error -

4: Failure at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2846) at com.jcraft.jsch.ChannelSftp.checkStatus(ChannelSftp.java:2459) at com.jcraft.jsch.ChannelSftp._sendCLOSE(ChannelSftp.java:2465) at com.jcraft.jsch.ChannelSftp._put(ChannelSftp.java:683) at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:475) at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:365) 

I searched a lot in other forums, but could not find the reason. I noticed one more thing: the name of the file I'm trying to use SFTP is * .xml when I change it to .XML, SFTP is โ€œsuccessfulโ€. Very strange it was not possible to identify the problem. I am trying to use the JSch Java API. But I saw the same problem when trying the WinSCP interface.

+9
source share
3 answers

I ran into the same problem. Make sure your SFTP service is running. And if it is already running, restarting this service should do the trick.

+1
source

I had the same problem. I tried everything, it turned out that I set the timeout to 30 seconds, but in fact it was 30 ms. A change of 30,000 ms solved the problem.

 session.setTimeout(30000); 
0
source

Source: https://habr.com/ru/post/978121/


All Articles