keepass2android icon indicating copy to clipboard operation
keepass2android copied to clipboard

Synchronization to SFTP remote writes 0 byte file

Open M-Pixel opened this issue 4 years ago • 2 comments

Loading a database over SFTP works, but synchronizing changes from KeePassXC results in the file having a size of 0 bytes. Attempting to reload database in KeePassXC after replacing the 0-byte file with a backup of the database on PC caused this exception:

1/16/2021 10:25:46 AM:855 -- System.Exception: error ---> Java.IO.IOException: error
  at Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0006e] in <0210827da739493eacd54644187f8f4f>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <0210827da739493eacd54644187f8f4f>:0 
  at Keepass2android.Javafilestorage.SftpStorage.OpenFileForRead (System.String path) [0x00029] in <22ea6fdc4f22412fb4d9e754030034f8>:0 
  at keepass2android.Io.JavaFileStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x0000d] in <d0bf64c0589048ecb8c19cb8be709fcc>:0 
   --- End of inner exception stack trace ---
  at keepass2android.Io.JavaFileStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x0002b] in <d0bf64c0589048ecb8c19cb8be709fcc>:0 
  at keepass2android.Io.OfflineSwitchableFileStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00006] in <d0bf64c0589048ecb8c19cb8be709fcc>:0 
  at keepass2android.Io.CachingFileStorage.GetRemoteDataAndHash (KeePassLib.Serialization.IOConnectionInfo ioc, System.String& hash) [0x00006] in <d0bf64c0589048ecb8c19cb8be709fcc>:0 
  at keepass2android.SynchronizeCachedDatabase.Run () [0x0005b] in <d0bf64c0589048ecb8c19cb8be709fcc>:0 

Android 10, key file authorization, IPV6, OpenSSH Server 8.4_p1-r2 x86 on Alpine 3.13.

M-Pixel avatar Jan 16 '21 18:01 M-Pixel

I've confirmed that the issue does not occur when using RClone instead of OpenSSH Server. This tells me that the issue is a matter of the SFTP client not tolerating some protocol nuance that it should be able to handle.

M-Pixel avatar Jan 17 '21 02:01 M-Pixel

can you please test if this is still present in https://github.com/PhilippC/keepass2android/releases/tag/v1.10-pre?

PhilippC avatar Nov 21 '23 12:11 PhilippC