PhilippC / keepass2android

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

[BUG] K2A claims every database is corrupt #2638

Open headcase0570 opened 1 month ago

headcase0570 commented 1 month ago

Checks

Describe the bug you encountered:

For a few weeks I've been having issues with Keepass2Android; 1st login attempt on any database results in error: "The file signature is invalid. Eith..." (abbreviated, full message not shown) 2nd and following login attempts: "The file signature is invalid. Either the file isn't a KeePass database at all or it is corrupted. I am sure it's the correct file 'database.kdbx', as I use it on PC and on Mac as well, it's synchronized through Google Drive to all my devices.

Due to this issue persisting on Keepass2Android, I created a new database, and imported the 'old' database using the official KeePass windows software (on which no corruption is mentioned by the way) The new database is called 'DBv2.kdbx'. For a few days it's worked on K2A, but now it also claims corruption upon opening.

No issues have occurred on Windows or OSx that would result, as far as I can tell, in any corruption. It is only Keepass2Android that claims any form of corruption. I mainly use K2A for copying and pasting credentials on my smartphone, as I mainly use generated passwords that are impossible to remember and a hassle to copy from another screen.

What can I do or test to diagnose and fix this issue?

Describe what you expected to happen:

Start Keepass2Android, open database and get access to credentials.

What version of Keepass2Android are you using?

1.10-pre

Which version of Android are you on?

14

WebworkrNet commented 1 month ago

Have a look at [BUG] file signature invalid #2355.

I have also described a workaround there. However, the framework conditions are different. It may also help in your situation.

headcase0570 commented 1 month ago

I have taken a look at #2355 but I'm not seeing your workaround? Copying the database over USB to my phone is something I'd rather avoid completely as that'll eventually lead to discrepancies between versions. Plus I'd be copying it back and forth several times a day as I use Keepass extensively.

WebworkrNet commented 4 weeks ago

In my experience so far, the only option is to replace the current database. To do this, you export the local copy from KP2A to GDrive. (Alternatively, you could also use a local version of another device, but I have not yet tried this). You should primarily use a local version that contains the last editing status and can be opened via KP2A. After all, we want to avoid data loss as far as possible. This is usually the case when using the cache version of KP2A. This can be selected under KP2A when displaying local backups. This service process only needs to be carried out once in order to get the database running again in productive operation. The wording "always" in ticket 2355 was perhaps misleading. This referred to the fact that I do this every time the error occurs and only then. Constant copying back and forth is not necessary on an ongoing basis.