[Q] How to fix corrupt database? - General Questions and Answers

Hello,
When I try to recover my Whatsapp messages on my new phone after I have copied the Whatsapp folder from my old phone to the SDcard, it suddenly crashes after 10 seconds: "Whatsapp has stopped working"
I looked into the System Log to find some clues about this crash. It looks like it has something to do with SQLite and the msgstore.db (or msgstore.db.crypt) file which says that the msgstore.db file is corrupt.
"E/DefaultDatabaseErrorHandler (3784): Corruption reported by sqlite on database: /data/data/com.whatsapp/databasesmsgstore.db"
"E/AndroidRuntime (3784): java.lang.AssertionError: android.database.sqlite.SQLiteDatabaseCorruptExcep tion: Database disk image is malformed (code 11), SQLiteConnection.java,-2"
"E/SQLiteLog (3784): (14) cannot open file at line 30191 of [00bb9c9ce4]"
"E/SQLiteDatabase (3784): Failed to open database '/data/data/com.whatsapp/databases/msgstore.db' "
"E/SQLiteDatabaseException: unknown error (code 14): Could not open database"
"I/sqlite_db_corrupt (3784): /data/data.com.whatsapp/databases/msgstore.db"
Can somebody help me to unravel this mistery? I really want to copy my old messages to my new phone and continue using the app on my new phone.
How can I fix the corrupt msgstore file? Or see what part of the file is corrupt (the exact cause)
NOTE: I added some screenshots of the System Log file to give you more information

Many people complained about whats app is force closed since Facebook bought whats app company,you should google it,or you can try delete backup folder on whats app /sdcard/whatsapp/backup maybe it can help,sorry if im not helped you
Sent from my N986 using xda premium

kelvinvalencio said:
Many people complained about whats app is force closed since Facebook bought whats app company,you should google it,or you can try delete backup folder on whats app /sdcard/whatsapp/backup maybe it can help,sorry if im not helped you
Sent from my N986 using xda premium
Click to expand...
Click to collapse
Thanks for your reply. But If I delete the backup file, then it will not be possible for Whatsapp to recover my message history right?

thanks
appreciate it

Related

"Sharing violation" when trying to restore from a copied cemail.vol

My phone got all screwed up, so I copied as many files off of it as I could using the Windows "Mobile Device" folder (no programs will run on the phone, but I could see the files). I copied pim.vol and cemail.vol among others. I hard reset the phone and copied pim.vol back onto the phone, and now my contacts, calendar, call history, are all restored. I'd like to restore the cemail.vol file also, but when I try to delete the default one I get:
Cannot delete 'cemail':
There has been a sharing violation.
The source or destination file may be in use.
Click to expand...
Click to collapse
When I try to delete it from the computer, I get the same thing:
Cannot delete file cemail: There has been a sharing violation.
The source or destination file may be in use.
Click to expand...
Click to collapse
How do I get around this?
Answer: Remove "messaging" from the Today screen so that it is not in use, and restart.
Long path tool
Hi Guys, just to update you, finally I found a way to solve it
Do you have error messages?, like :
* Path too long
* Error cannot delete file: cannot read from source file or disk
* Cannot delete file: Access is denied
* There has been a sharing violation.
* Cannot delete file or folder The file name you specified is not valid or too long. Specify a different file name.
For that I tried it with LONG PATH TOOL

[Q] [WHATSAPP] Unable to recover message history: Corrupt Database

Hello,
Whatsapp problem! I want to copy my chat history from my Samsung Galaxy S1 (2.3.6) to my new Nexus 5 (4.4.2).
I copied my entire Whatsapp folder to my Nexus 5 (/sdcard/Whatsapp/) and then installed Whatsapp. It asked me if I would like to recover my history chat messages. After clicking yes it started recovering but after 10-20 seconds it shuts down and an error message comes forward saying that Whatsapp had stopped working. I tried it multiple times.
When looking in my System Log file it says that it has something to do with SQLite. These are some lines in the Log file concerning Whatsapp:
"E/DefaultDatabaseErrorHandler (3784): Corruption reported by sqlite on database: /data/data/com.whatsapp/databasesmsgstore.db"
"E/AndroidRuntime (3784): java.lang.AssertionError: android.database.sqlite.SQLiteDatabaseCorruptException: Database disk image is malformed (code 11), SQLiteConnection.java,-2"
"E/SQLiteLog (3784): (14) cannot open file at line 30191 of [00bb9c9ce4]"
"E/SQLiteDatabase (3784): Failed to open database '/data/data/com.whatsapp/databases/msgstore.db' "
"E/SQLiteDatabaseException: unknown error (code 14): Could not open database"
"I/sqlite_db_corrupt (3784): /data/data.com.whatsapp/databases/msgstore.db"
Can someone tell me how to fix this problem or how to find what the error causes in my database file? :crying:
NOTE: I added screenshots of System Log

[TOOL] Merjapp - merge whatsapp databases

If you ever lost your phone due to an accident, or just had to use a temporary phone for some reason...
And you're one of those who hates to lose history, even if you know you hardly look at it...
This tool is for you.
Pre-requisites:
Neither of your phones where your whatsapp is installed need be rooted.
You must enable USB debugging on both devices
You must have Android SDK, we will be using the Android Debug Bridge (ADB)
Have Android Backup Extractor ready, we will use it.
Instructions:
Connect the phone which holds your old database to your computer, and enable USB debugging.
Use ADB to make a backup of the whatsapp database
Code:
adb.exe backup -f whatsapp.ab com.whatsapp
Use 'Android Backup Extractor' to extract whatsapp.ab to whatsapp.tar
Open whatsapp.tar with 7zip (or any other compression utility) and extract the file called 'msgstore.db'
Rename the file to 'old.db'
Repeat the above steps for your new phone, but rename the file to 'new.db'
Run merjapp in the following fashion:
Code:
java.exe -jar merjapp.jar -old old.db -new new.db
You can also use the -simulation mode if you like, it will not create any output database, and you will be able to read the log created in the working directory.
If you want extra debug information you can use the -debug mode.
If everything went correctly and "Done!' is displayed, rename output.db (which is your merged database) to msgstore.db
Connect your new phone to your computer, open the Whatsapp/Databases directory on the internal SD card and backup its contents to some other location.
Copy msgstore.db created in the previous steps to this directory
Clear whatsapp's data from your new phone and force stop it.
Open whatsapp and when prompted, elect to restore from backup, and voila!
Download
Download merjapp v141201 (runnable jar file)
Backup
Backup
Just registered to say thank you. It works!
Official whatsapp method wasn't working for me: "unable to recover chat history". So your tool saved me. Thanks!
namnoops said:
If you ever lost your phone due to an accident, or just had to use a temporary phone for some reason...
And you're one of those who hates to lose history, even if you know you hardly look at it...
This tool is for you.
Pre-requisites:
Neither of your phones where your whatsapp is installed need be rooted.
You must enable USB debugging on both devices
You must have Android SDK, we will be using the Android Debug Bridge (ADB)
Have Android Backup Extractor ready, we will use it.
Instructions:
Connect the phone which holds your old database to your computer, and enable USB debugging.
Use ADB to make a backup of the whatsapp database
Code:
adb.exe backup -f whatsapp.ab com.whatsapp
Use 'Android Backup Extractor' to extract whatsapp.ab to whatsapp.tar
Open whatsapp.tar with 7zip (or any other compression utility) and extract the file called 'msgstore.db'
Rename the file to 'old.db'
Repeat the above steps for your new phone, but rename the file to 'new.db'
Make back-ups of both old.db and new.db, as merjapp will make changes in them
Run merjapp in the following fashion:
Code:
java.exe -jar merjapp.jar -old old.db -new new.db
You can also use the -simulation mode if you like, it will not change your databases and you will be able to read the log created in the working directory.
If you want extra debug information you can use the -debug mode.
If everything went correctly and "Done!' is displayed, rename old.db (which is your merged database now) to msgstore.db
Connect your new phone to your computer, open the Whatsapp/Databases directory on the internal SD card and move its contents to some other location
Copy msgstore.db created in the previous steps to this directory
Clear whatsapp's data from your new phone and force stop it.
Open whatsapp and when prompted, elect to restore from backup, and voila!
Download
Download merjapp v141005 (runnable jar file)
Click to expand...
Click to collapse
A pretty neat tool!
I was trying to merge two databases. It seemed that everything went okay and all with the "Done!" message. However, there seems to be no changes made two any of the database. Their filesizes remains the same for old.db and new.db.
I tried loaded the old.db anyway since you said that is the merged one. However, I am getting only the old one.
Please advise.
And you didn't use the '-simulation' flag by chance, right?
Can you attach the log file?
Hi,
I think I have done everything as instructed above. But the phone doesn't seem to recognize the new mgstore.db backup file.
I notice that the new file isn't crypt7 as the original mgstore.db file from the internal drive. Is that causing my problems? How do I fix it?
Greetz
clevernam said:
mgstore.db
Click to expand...
Click to collapse
Did you make a typo with the file like you did here? It should be msgstore.db, not mgstore.db.
No, it doesn't have to be encrypted in order for whatsapp to recognize it.
namnoops said:
Did you make a typo with the file like you did here? It should be msgstore.db, not mgstore.db.
No, it doesn't have to be encrypted in order for whatsapp to recognize it.
Click to expand...
Click to collapse
Nope, that's not it, just checked.
Do i have to put it into the msgstore.tar file? Where i extracted new and old from?
Greetz (thanks for helping btw., if this works, its a realy big help to me!!)
Nope, you just have to place msgstore.db inside the 'whatsapp' directory on your internal SD card (I'd make sure it's the only file there).
Then clear data on whatsapp, force close it, and run it.
Is that exactly what you're doing?
Multiple Databases
Can this app merge multiple databases...
Like if i want to merge 3-4 old databases into one? is it possible? if either one of these databases have same data, will that be duplicated?
It can merge more than one, but that's under the assumption they're mutually exclusive (in terms of messages - i.e., no message appears twice)
So if you used one phone (1), started with a clean whatsapp on a second phone (2), then another clean whatsapp on a third (3), and so on...
You'll merge (1) as 'old' and (2) as 'new', then use the output as 'old' and merge it with (3) as 'new', etc.
namnoops said:
Nope, you just have to place msgstore.db inside the 'whatsapp' directory on your internal SD card (I'd make sure it's the only file there).
Then clear data on whatsapp, force close it, and run it.
Is that exactly what you're doing?
Click to expand...
Click to collapse
Yes, thats exactly what i did. Any other idea what could be wrong?
I'm sorry - it should be under WhatsApp/Databases like the opening post says...
namnoops said:
I'm sorry - it should be under WhatsApp/Databases like the opening post says...
Click to expand...
Click to collapse
That's what i figured, because I was already thinking about all the other files with dates like msgstore-2014-10-12.1.db.crypt7 that i took out of the Database folder.
namnoops said:
I'm sorry - it should be under WhatsApp/Databases like the opening post says...
Click to expand...
Click to collapse
The output file, that I renamed to msgstore.db has "gear wheels" as an icon, but the msgstore file from the database of the phone has no icon at all. Is that somehow significant? Does that maybe lead you to my mistacke?
The fact the the output file has the 'gear wheel' icon just means Windows detects it as a database, I think it's quite meaningless...
The other files it didn't give this icon are *.db? Or are you referring to the encrypted databases? They encrypted ones probably won't have this icon.
It seems to me you're doing everything right:
Renaming the file to 'msgstore.db'
Put it in your internal SD card under WhatsApp/Databases
Making sure there's no other file there except this file
Force closing whatsapp, clearing data, opening the app...
So you're doing all this, and when whatsapp loads it initializes from scratch and doesn't tell you a backup has been found?
It just goes on to initialize an empty database as though you just installed whatsapp for the first time?
namnoops said:
The fact the the output file has the 'gear wheel' icon just means Windows detects it as a database, I think it's quite meaningless...
The other files it didn't give this icon are *.db? Or are you referring to the encrypted databases? They encrypted ones probably won't have this icon.
It seems to me you're doing everything right:
Renaming the file to 'msgstore.db'
Put it in your internal SD card under WhatsApp/Databases
Making sure there's no other file there except this file
Force closing whatsapp, clearing data, opening the app...
So you're doing all this, and when whatsapp loads it initializes from scratch and doesn't tell you a backup has been found?
It just goes on to initialize an empty database as though you just installed whatsapp for the first time?
Click to expand...
Click to collapse
Precisley. Nothing comes, when I reinstall whatsapp.
It is not like when I put the normal backup data back in the databse folder. Then whatsapp realises that there is a backup file in the internal memory and gives me the option to restore the history. Not so with the merged file.
Btw. I have no sd card. I connect the phone with usb. I figured that it is an unessencial diffrence? Am I wrong? My phone btw. is Motorola Moto G. If that helps
I'll check, if the old an new are mutually exclusive. I think in the progress I got a message on the new and old one. What would happen in that case? Would your program do the job, but then creat a bad "output" file?
If the only problem was, that I messed up the historys, I'm sorry, namnoops.
Are you using the latest version of whatsapp?
iclumyc Doctrine
namnoops said:
Are you using the latest version of whatsapp?
Click to expand...
Click to collapse
Well if I didn't then, now I do. And it still doesn't work
I checked if there are any intersecting messages... It turns out there weren't any.
@namnoops: Does the oldest message in the new history have to be more recent then any old message from the old history? I mean: Is it a problem for merjapp if the timelines intersect in any way, although there are no double messages?
Thanks for your help in advance

[Q] Xperia Flashtool problem

Hi guys. Can someone tell me how to fix this ? I have no idea what to do. :crying:
Just do what the error says - go to the directory where your flashtool is located (first path) and move Firmwares folder to the user profile (second path). Or you can just simply delete it.
resutatto said:
Just do what the error says - go to the directory where your flashtool is located (first path) and move Firmwares folder to the user profile (second path). Or you can just simply delete it.
Click to expand...
Click to collapse
I did it. It didn't work and I also noticed that there is something with Java wrong. Don't you know what the hell is this error and how to solve it?
This maybe:
https://java.com/en/download/
Sent from my D2303 using XDA Free mobile app

Help with Currency Converter Small App ( com.sony.smallapp.currency)

Hey all,
This "small app" has recently become broken because the source for the currency file's URL has changed.
When the app is newly installed, it pops an error at first launch:
"Unable to download currency file. Please try again later".
It broke around mid-july 2018.
What I'm looking for is the latest available currency file so that the program can at least work (even if it can't update).
It should be located at:
Android/data/com.sony.smallapp.currency/files/
If someone could kindly .zip and upload the "files" folder here, it would be majorly helpful.
Thanks.
Ps24u said:
Hey all,
This "small app" has recently become broken because the source for the currency file's URL has changed.
When the app is newly installed, it pops an error at first launch:
"Unable to download currency file. Please try again later".
It broke around mid-july 2018.
What I'm looking for is the latest available currency file so that the program can at least work (even if it can't update).
It should be located at:
Android/data/com.sony.smallapp.currency/files/
If someone could kindly .zip and upload the "files" folder here, it would be majorly helpful.
Thanks.
Click to expand...
Click to collapse
Just install any apk manager (I recommend this https://play.google.com/store/apps/details?id=com.jumobile.manager.systemapp ) and uninstall your app, it will give u an error message that it couldn't uninstall, that's mean it successfully uninstalled it from your data root folder.
This should solve your problem..
Sent from my ONEPLUS A6003 using Tapatalk
It's mindblowing how off-topic you are, but thx I guess.
I support your request... It's a pity that this app doesn't works anymore for a simple error like this...

Categories

Resources