This project has moved. For the latest updates, please go here.

Clearing corrupt files

Sep 29, 2015 at 6:30 PM
Hello, I've been happily using Keepass2Android for several years now.
Just last week my Nexus 5 locked up on some silly Facebook page and I had to hold down the power button to reboot it ungracefully. Since then I haven't been able successfully open my main keepass2 file, it rejects it with:

Remote file and cache are synchronized.

An error occurred: The file is corrupted.


I typically keep the kdb on Google Drive, and have a local secret key file that I use with the master password. Both still work fine from my Linux PC with keepass2 . I've downloaded the kdb locally using Drive and tried to open it using the local file selector, but that also fails. The md5 sums for the secret key file and the kdb are the same between the Nexus5 and my PC, though. Keepass2Android 0.9.8b does manage to open a really old copy of the kdb that I have on my phone using the secret keyfile, just not my current kdb, even if I rename it. I've also tried clearing the cache and data for Keepass2Android in App Info, and reinstalling Keepass2Android.

I've only been using Keepass2Android to add entries to my kdb for the past year, so it's not like keepass2 on Linux has been adding new incompatible data to corrupt the kdb.

Are there any other corrupt cache files or directories that I might try clearing out to get this working again?
Coordinator
Oct 3, 2015 at 4:31 AM
I have heard of similar behavior a few times already: KP2A seems to reject opening files which seem to be valid, but up to now this was always about .kdbx, not .kdb.
You might check if it works with Keepassdroid which uses the same code for opening .kdb files. You might also just make some changes on the PC and see if it works again. If not (or in any case), you might remove all passwords and change the master key and send me the file then, so I can take a look.
Oct 9, 2015 at 5:35 PM
Sorry for the confusion, it was a .kdbx all throughout.

Thanks for the suggestion! That did get things working again by re-saving the corrupted .kdbx file in keepass2 and uploading it back to Google Drive. After that, I was able to successfully use it on Keepass2Android like before.

Haven't noticed any corrupt entries yet, so hopefully that means it was just some unencrypted filesystem metadata that was borked. I still have a copy of the corrupt .kdbx , if you think it's worthwhile I'll try to get you a binary diff with a fixed one...
Coordinator
Oct 11, 2015 at 5:59 AM
you can try to do the diff, but I don't believe it will show anything helpful. You might also export both as XML from Keepass2 and see if there is a difference in that.

Could you please also try to load both of them with the Android app from https://keepass2android.codeplex.com/releases/view/120663? That shows quite a bit of debug output while loading. Maybe you can send me the two logs?