0
Fixed

Error overwriting files with SFTP

Bryan Creel 12 years ago in General updated by Alexander Blach (Developer) 12 years ago 7
I just got Textastic and I like it quite a bit.  I currently have my connections working using WebDAV, but I'd prefer to switch to SFTP (SSH).  I'm using Bitvise SSH Server 5.57 and the problem is that I'm unable to overwrite existing files using Textastic. 

It asks for overwrite confirmation and then returns "Error in the SSH layer."  The strange thing is that this exact process (Download a file, upload the same file again to overwrite) works fine with Goodreader SFTP using the same login information.  My SSH server logs don't indicate any error, they just are missing the actual file transfer.  On the Textastic side, if I enable logging then here is the relevant section:

== Info: Connection #0 to host xxxx.xxx left intact
== Info: Re-using existing connection! (#0) with host xxxx.xxx
== Info: Connected to xxxx.xxx (xx.xx.xx.xx) port 22 (#0)
== Info: Could not seek stream
== Info: Connection #0 to host xxxx.xxx left intact
== Info: FTP: command REST failed
== Info: Re-using existing connection! (#0) with host xxxx.xxx
== Info: Connected to xxxx.xxx (xx.xx.xx.xx) port 22 (#0)
== Info: Creating directory '/d'
== Info: Creating directory '/d/Downloads'
== Info: Creating the dir/file failed: Operation failed
== Info: Connection #0 to host xxxx.xxx left intact
== Info: Error in the SSH layer
== Info: Re-using existing connection! (#0) with host xxxx.xxx
== Info: Connected to xxxx.xxx (xx.xx.xx.xx) port 22 (#0)


Please help; I'd much rather use SFTP to access my server.

Version 4.3

Answer

Answer
Fixed

Will be fixed in the next update.

Hello,


thanks for the detailed report. Can you please try to set the "Connections" setting to "1". This limits the amount of concurrent connections to 1 - the default is three. 


Please let me know if this changes anything.

I tried setting "Connections" to 1 but I still got the "Error in the SSH layer."

I'll try to setup a Bitvise SSH server in a VM to see if I can reproduce the problem.

Thanks very much for the quick response!  I'm using the free version of their SSH server.  FYI, both Goodreader and Textastic use the same SSH library according to my server logs:

  <parameters clientVersion="SSH-2.0-libssh2_1.1"/>


If it would help, I can give you a test account on my own server. 


That would be great. You can send the account details to support@textasticapp.com - thanks!

Thanks for the test account. I could fix the problem. Here's the reason:


In order to show the overwrite prompt, Textastic first checks to see if the file already exists on the server. This check left the file opened on the server. 

On Linux SFTP servers, this isn't a problem and the following upload of the same file works. Bitvise SSH Server or Windows itself seems to block the file and the upload fails.


I could fix the problem by properly closing the file after the check for its existence. It will be fixed in the next update.

Answer
Fixed

Will be fixed in the next update.