SFTP plugin: copy write error

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

gyari
Junior Member
Junior Member
Posts: 9
Joined: 2018-11-18, 20:41 UTC

SFTP plugin: copy write error

Post by *gyari »

Hi!

If i want to copy from my nas through sftp connection to my internal storage, or from my internal storage to nas, i get this error:

Write error
Error writing to target file!
/storage/emulated/0/folder/file!

In this case i wanted to copy a file from internal storage to my nas. SMB and webdav work just fine.

I use a Samsung Galaxy Tab S3 stock tablet with android 7.0.

Can anyone help me what's going on here?

Thanks any help!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: sftp copy - write error

Post by *ghisler(Author) »

Please check in the Android settings whether you have accidentally disabled access to "storage" for the app Totalcmd-sftp.
Author of Total Commander
https://www.ghisler.com
gyari
Junior Member
Junior Member
Posts: 9
Joined: 2018-11-18, 20:41 UTC

Re: sftp copy - write error

Post by *gyari »

Just checked the "storage" permission for Totalcmd-sftp and all TC components, it's granted.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: sftp copy - write error

Post by *ghisler(Author) »

I'm really sorry but I don't have any other ideas what could be wrong on your device. I haven't received any other reports that the SFTP plugin fails to download files.
Author of Total Commander
https://www.ghisler.com
gyari
Junior Member
Junior Member
Posts: 9
Joined: 2018-11-18, 20:41 UTC

Re: sftp copy - write error

Post by *gyari »

Is there any way i could generate a log file about the error? I'm afraid if i uninstall and reinstall sftp plugin it will work ok, but if you say you want to investigate the error than i could help with a log file. Of course i understand if you don't want to spend your time to investigate an error which exists only on 1 device, but if you are intrested, i'm happy to help you at least with one log file :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: sftp copy - write error

Post by *ghisler(Author) »

Yes, but it's a bit tricky. Please follow these instructions carefully:
1. Switch to the internal memory, usually /storage/emulated/0 , by going to the home folder, and then tap on the first entry in the list
2. Create a new folder named .TotalCommander including the dot at the beginning (if it doesn't exist yet)
3. You may need to enable the display of hidden files in the TC configuration if you cannot see that folder.
4. Go inside this folder .TotalCommander
5. Create a new file named log.txt by holding down a finger on the first line (..) and choosing "new text file"
6. Close Total Commander via "X" button and restart it
Author of Total Commander
https://www.ghisler.com
gyari
Junior Member
Junior Member
Posts: 9
Joined: 2018-11-18, 20:41 UTC

Re: sftp copy - write error

Post by *gyari »

Thanks, it worked like a charm!

These are the errors:

From NAS to droid: error: net.schmizz.sshj.xfer.scp.SCPException: Could not parse message `

From droid to NAS: error: net.schmizz.sshj.xfer.scp.SCPException: EOF while expecting response to protocol message. Additional info: `Permission denied, please try again.`

If you need the whole log.txt i PM to you.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: sftp copy - write error

Post by *ghisler(Author) »

Seems like the server is sending you a "permission denied". Do other SFTP clients work?
Author of Total Commander
https://www.ghisler.com
gyari
Junior Member
Junior Member
Posts: 9
Joined: 2018-11-18, 20:41 UTC

Re: sftp copy - write error

Post by *gyari »

Yes, other sftp clients are working, tested with Mixplorer and Solid Explorer.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: sftp copy - write error

Post by *ghisler(Author) »

Try disabling SCP in the connection settings. Your server may not be able to do SCP connections. Btw, what else does the log show?
Author of Total Commander
https://www.ghisler.com
gyari
Junior Member
Junior Member
Posts: 9
Joined: 2018-11-18, 20:41 UTC

Re: sftp copy - write error

Post by *gyari »

I've sent an email to you with the full log.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: sftp copy - write error

Post by *ghisler(Author) »

Thanks! As I suspected, the server doesn't support the SCP protocol. You need to disable it in the settings of that connection.
Author of Total Commander
https://www.ghisler.com
gyari
Junior Member
Junior Member
Posts: 9
Joined: 2018-11-18, 20:41 UTC

Re: sftp copy - write error

Post by *gyari »

Thank you very much for your help and your time! Disabling the SCP protocol did help!
User avatar
zaffi
Junior Member
Junior Member
Posts: 34
Joined: 2009-03-24, 08:50 UTC

Re: sftp copy - write error

Post by *zaffi »

[quote=ghisler(Author) post_id=348967 time=1542886095 user_id=2]I haven't received any other reports that the SFTP plugin fails to download files.[/quote]

Now you do :)
Exactly the same error -- and same solution.

I'd suggest to add a hint to the error message about disabling SCP,

if not, the user (e.g. me) thinks that there's a permissions problem on the CLIENT side, and searches for solutions in the wrong direction.
Commaster
Junior Member
Junior Member
Posts: 3
Joined: 2019-02-09, 05:40 UTC

Re: sftp copy - write error

Post by *Commaster »

SCP mode is great for reaching high transfer speeds but it looks like the progress bar can't keep up with the actual data flow.
My SFTP/SCP connection is via WiFi so it has no trouble pulling 6 MB/sec. But according to what I can observe, the data transfer finishes before the progress bar fills. And at around 128 MB per file the data transfer is complete before 50% of the progress bar. Any larger file will trigger a write error after reaching a bit over twice the progress of when the data transfer finished.
Tested with 125.2MB file - finished fine. Tested with 133.1MB file - data transfer finished at 43%, so at 96% the write error popup appeared and only 128.3MB are written to the target file. Tested with 139.0MB file - data transfer finished at 41%, error pop up at 88%, only 128.2MB written.
Can this be improved? Do we need some "keep-alive" packets? Cause non-SCP mode is only 400kB/sec.
P.S. I'm downloading to /storage/0000-0000 which is a microSD card.
Post Reply