SFTP via JSch is throwing error 4: Failure

I was facing the same issue. Please make sure that your SFTP service is running. And If it is already running then restarting this service should do the trick.


i was facing the same issue. was puzzled then i realized there was a space issue on the server folder. Please do check the server available space.

command: df path to the folder


It is common for OpenSSH SFTP server to return code 4 (Failure) for many different reasons, without giving any details.

You would have to check SFTP server log to find more.

Though the most usual cause is a lack of free disk or user quota space – Which can usually be identified by the file being created with zero size.