keepass2android icon indicating copy to clipboard operation
keepass2android copied to clipboard

Error while opening database: Illegal Seek

Open ClemensSchneider opened this issue 4 years ago • 24 comments

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!

ClemensSchneider avatar Aug 20 '21 08:08 ClemensSchneider

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.

FrankDickschat avatar Aug 22 '21 11:08 FrankDickschat

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

AnastasiosT avatar Aug 23 '21 12:08 AnastasiosT

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

AnastasiosT avatar Aug 24 '21 11:08 AnastasiosT

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

coffiarts avatar Aug 25 '21 17:08 coffiarts

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

AnastasiosT avatar Aug 25 '21 18:08 AnastasiosT

Thx, @AnastasiosT, for the initiative!

coffiarts avatar Aug 26 '21 07:08 coffiarts

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

AnastasiosT avatar Aug 26 '21 10:08 AnastasiosT

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 avatar Aug 26 '21 12:08 AnastasiosT

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 😄

AnastasiosT avatar Aug 27 '21 08:08 AnastasiosT

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

buster avatar Aug 29 '21 17:08 buster

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

buster avatar Aug 29 '21 17:08 buster

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

buster avatar Jan 22 '22 10:01 buster

no, this issue is still open

PhilippC avatar Jan 22 '22 16:01 PhilippC

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

PhilippC avatar Jan 22 '22 16:01 PhilippC

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

christof1209 avatar Mar 12 '22 00:03 christof1209

Any news on this?

steafy avatar Oct 04 '22 10:10 steafy

Is there any updates on this issue?

sharzas avatar Feb 14 '23 19:02 sharzas

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.

buster avatar Feb 14 '23 20:02 buster

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

christof1209 avatar Feb 15 '23 02:02 christof1209

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

buster avatar Feb 15 '23 06:02 buster

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 avatar Feb 15 '23 09:02 christof1209

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

christof1209 avatar Feb 18 '23 11:02 christof1209

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...

mnisius avatar Apr 27 '24 01:04 mnisius

I stumbled over the same problem when i switched from dropbox to the european alternative koofr. Keepassdx is the solution for this problem.

bitkleberAST avatar Apr 13 '25 08:04 bitkleberAST