PhilippC / keepass2android

Password manager app for Android
https://play.google.com/store/apps/details?id=keepass2android.keepass2android
GNU General Public License v3.0
4.77k stars 385 forks source link

Error while opening database: Illegal Seek #1768

Open ClemensSchneider opened 3 years ago

ClemensSchneider commented 3 years ago

This seems to be a regression as this exception started to occur with the latest update (currently on 1.09a-r3). My setup is using BoxCryptor to load the database file from (through Android-Filebrowser), so maybe this error is caused by an update on the BoxCryptor side..

The log shows the following exception when trying to open the database (after having entered the password)

20.08.2021 10:28:09:825 -- content://com.boxcryptor.android.content.provider/document/5345e482-9dbd-4cf9-b188-cf3d8cea7090 isCached = False
20.08.2021 10:28:09:826 -- LockingActivity: OnActivityResult 
20.08.2021 10:28:09:827 -- PasswordActivity.OnActivityResult 874348/1000
20.08.2021 10:28:09:844 -- status message: Initializing...
20.08.2021 10:28:09:844 -- status submessage: 
20.08.2021 10:28:09:887 -- status message: Lade Datenbank…
20.08.2021 10:28:09:892 -- Java.IO.IOException: Illegal seek
  at Java.Interop.JniEnvironment+InstanceMethods.CallLongMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0006e] in <779d05ba5af24e759d3f9b3c6a932802>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeAbstractInt64Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00014] in <779d05ba5af24e759d3f9b3c6a932802>:0 
  at Java.Nio.Channels.FileChannelInvoker.Position () [0x0000a] in <5bf15d4eb5b643d887d450c892d69beb>:0 
  at Android.Runtime.InputStreamInvoker.get_Position () [0x0000e] in <5bf15d4eb5b643d887d450c892d69beb>:0 
  at System.IO.Stream.GetCopyBufferSize () [0x00015] in <a34fd6632bd44f86bb1b93c90e79b165>:0 
  at System.IO.Stream.CopyTo (System.IO.Stream destination) [0x00000] in <a34fd6632bd44f86bb1b93c90e79b165>:0 
  at (wrapper remoting-invoke-with-check) System.IO.Stream.CopyTo(System.IO.Stream)
  at keepass2android.Io.CachingFileStorage.UpdateCacheFromRemote (KeePassLib.Serialization.IOConnectionInfo ioc, System.String cachedFilePath) [0x0001f] in <feecb384529343508c0f04da640f314c>:0 
  at keepass2android.Io.CachingFileStorage.OpenFileForReadWhenNoLocalChanges (KeePassLib.Serialization.IOConnectionInfo ioc, System.String cachedFilePath) [0x00023] in <feecb384529343508c0f04da640f314c>:0 
  at keepass2android.Io.CachingFileStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x0005a] in <feecb384529343508c0f04da640f314c>:0 
  at keepass2android.PasswordActivity.PreloadDbFile () [0x0004c] in <a80b664dd37144a2b06baa8dfaf3799f>:0 
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <a34fd6632bd44f86bb1b93c90e79b165>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <a34fd6632bd44f86bb1b93c90e79b165>:0 
20.08.2021 10:28:09:901 -- OnFinish message: Ein Fehler ist aufgetreten: Illegal seek

Copying the database to a local folder manually and opening the file from there works without any issues.

Thanks for the great work!

FrankDickschat commented 3 years ago

Exact same thing here. Version 1.09aR3 Using Boxcryptor (2.108.1021) to open the DB via Android Filebrowser. My Log looks the same as above. Also same as above: Copying the DB to local folder and opening works like a charm.

AnastasiosT commented 3 years ago

Same here. I'm also using Boxcryptor to oben the DB via the Android Filebrowser

AnastasiosT commented 3 years ago

Short Update: I think it's a boxcryptor problem. I tried several keepass apps on android and I always get the same error. I opended a thread in the boxcryptor community: https://boxcryptor.community/d/17237-boxcryptor-android-and-keepass

coffiarts commented 3 years ago

Having the same issue. And the boxcryptor community post linked by @AnastasiosT seems to be gone. Any ideas what's the status of this issue (be it here or on boxcryptor's side)? [EDIT:] This BC thread here seems to address the issue mentioned: https://boxcryptor.community/d/14497-after-update-encrypted-files-can-not-be-opened-or-downloaded-on-android

AnastasiosT commented 3 years ago

Hi Coffiarts, I have a premium boxcryptor account and opened an isse for this.

coffiarts commented 3 years ago

Thx, @AnastasiosT, for the initiative!

AnastasiosT commented 3 years ago

Hi @coffiarts, my Community Post is now (in german, I'm sorry :( ) available. Now I'm also in touch with the Boxcryptor support.

AnastasiosT commented 3 years ago

Hi all, I received an answer from Boxcryptor. They've forwarded the case to the development team. Let's hope they will fix it asap.

AnastasiosT commented 3 years ago

Hi all, after talking to Boxcryptor and some tests I can confirm that it is an issue with the latest keepass2android version. I installed the 1.08d-r5 apk and everything is working like a charm 😄

buster commented 3 years ago

I am not using boxcryptor but EDS lite and getting this error, so I will try the downgrade.

buster commented 3 years ago

I can confirm,that the prior version works. It must be a bug in keepass2android.

buster commented 2 years ago

Is this probably fixed in the latest update on Google play? It says 1.09c-r0...

PhilippC commented 2 years ago

no, this issue is still open

PhilippC commented 2 years ago

it might be a consequence of changing the targetSdkVersion, apart from that I can't think of any relevant code change since 1.08

christof1209 commented 2 years ago

Hi, can we still hope for a solution to this problem ? The combination of keepass and boxcryptor was really good practice. Best Regards

steafy commented 2 years ago

Any news on this?

sharzas commented 1 year ago

Is there any updates on this issue?

buster commented 1 year ago

I just tried that latest version (on a Samsung s10, same phone as origin issue but several os updates later) and it works for me now. The version is 1.09e-r1.

christof1209 commented 1 year ago

Hi, Same issue since august 2021 ! Still "Ilegal seek" in 1.09e-r1. I use the very old 1.08d-r5. I think a lot of people would be happy that you finally fixed this problem. Kinds Regards

buster commented 1 year ago

If this happened to me on the same device it sounds like it might be a device/vendor/android version update?

Either it's dependant on the targetSdkVersion (is there a possibility to change that back?) or it's fixed because my android version got updated/fixed. It's probably helpful if you state your device and Android version.. Mine is (its fixed for me,though) : Samsung S10e, Android 12, patchlevel from 1.1.2023

christof1209 commented 1 year ago

Hi, my current phone is a samsung galaxy S23 with android 13 (kernel 5.15.41). I had the same problem with my galaxy S22 (Android 12 and 13) and S21 (Android 11 and 12). Can you tell me how you open the files on the phone. Me, I go to keepass and open system file selection --> kdbx File Path in Boxcryptor (tree with Boxcryptor in root) ? Kind regards

christof1209 commented 1 year ago

After a year and a half of waiting for a solution, moving to keepassdx.

mnisius commented 5 months ago

Same problem when I try accessing a database from an roundsync folder. Very annoying kepassdx has no such problem. Why is this open since 2021...