Database disk image is malformed, 3 years of work emails in offline folders and no backup, now what???

Yesterday I had a crash of eM Client and now I keep getting a database error.  

The log says this:

System.IO.IOException: database disk image is malformed —> System.Data.SQLite.SQLiteException: database disk image is malformed
   at System.Data.SQLite.SQLiteBlob.Read(Byte[] buffer, Int32 count, Int32 offset)
   at MailClient.Storage.Data.BlobStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   — End of inner exception stack trace —
   at MailClient.Storage.Data.BlobStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at MailClient.Streams.StreamHelper.CopyStream(Stream inputStream, Stream outputStream, Nullable`1 cancellationToken, ProgressReporter reporter)
   at MailClient.Storage.Data.DatabaseCopyTool.CopyContents(Table table, Boolean sortDesc)
   at MailClient.Storage.Data.DatabaseCopyTool.CopyTableData(Table table)
   at MailClient.Storage.Data.DatabaseCopyTool.CopyInternal(String specificTable, Boolean copyIndexesViewsAndTriggers)
   at DbRepair.CorruptionChecker.CheckCorruption(RepairOptions repairOptions, CancellationToken token)
   at DbRepair.CheckingProcess.Check(CancellationToken token)
Data:
Table: LocalMailContents
databaseFile: dae564d2-72c7-41ea-b637-842fae2c3d34\b1c9d9dd-fd32-4e15-a0f6-f152340ea4a9\mail_data.dat

I understand that renaming the DB folder can get eM Client working again, but I had 3 years of work emails in offline folders and I simply cannot lose those!!!

Anyone knows how I can fix this?

Your help would be much appreciated!!

Cheers,
Steven

Hello Steven,

Just as you say, the database is corrupted after the crash. Can you enter the program to export those offline files? 

Regards,
Russel

Hello Russel,

I am facing the similar issue.
Can you help me to sort this out or send me the step by step procedure

Regards
Roopesh

System.ApplicationException: SQL logic error or missing database
table “ContactItemContents” already exists
Line: 203
CREATE TABLE contact_data.“ContactItemContents” (
“id” INTEGER NOT NULL CONSTRAINT fk_ContactItemContents_id REFERENCES “ContactItems”(“id”) ON DELETE CASCADE,
“propertyName” TEXT,
“propertyId” TEXT,
“properties”,
PRIMARY KEY (“id”, “propertyName”, “propertyId”));
   at MailClient.Storage.Data.DbRepository1.ImportFromResource(IDbConnection connection, Stream myStream, CancellationToken token)    at MailClient.Storage.Data.DbRepository1.CheckSchema(String databaseName, String resourceName)
   at MailClient.Storage.Data.DbRepository1..ctor(DataStore dataStore, String location, String indexTable, String[] readWriteDatabaseNames, String[] readOnlyDatabaseNames)    at MailClient.Storage.Data.DbItemRepository1…ctor(DataStore dataStore, String dbLocation, String categoryNamesTable, String indexTable, String[] readWriteDatabaseNames, String[] readOnlyDatabaseNames)
   at MailClient.Storage.Contact.Data.DbContactRepository…ctor(DataStore dataStore, String dbLocation)
   at MailClient.Accounts.ItemRepositories.Open(DataStore dataStore, String accountPath, AccountType accountType)
   at MailClient.Accounts.ItemRepositories…ctor(DataStore dataStore, String accountPath, AccountType accountType)
   at DbRepair.ConsistencyChecker.CheckConsistencyForAccount(String accountDirectory, RepairMode mode, CancellationToken token)
   at DbRepair.ConsistencyChecker.<>c__DisplayClass2_0.b__0(String p)
at DbRepair.PerAccountExecutor.Execute(String dataStoreLocation, Func`2 action)
at DbRepair.ConsistencyChecker.Check(RepairMode mode, CancellationToken token)
at DbRepair.CheckingProcess.Check(CancellationToken token)
Data:
AccountType: Mail, Contact, Calendar
DatabaseLocation: C:\Users\USER\AppData\Roaming\eM Client\Local Folders

Hi Russel,

I found a solution from another community member.  I could not enter eM Client, so the way I solved it was like this:

I renamed the eM Client storage folder.  Then I opened eM client so it built a new database.  I skipped the wizard and didn’t set up any accounts.  Closed eM Client again.

From the log file I noticed that the damaged database file was located in this folder: databaseFile: dae564d2-72c7-41ea-b637-842fae2c3d34\b1c9d9dd-fd32-4e15-a0f6-f152340ea4a9\mail_data.dat.  

So what I did was I copied every file and folder from my old database database folder into the new database folder, except for the complete dae564d2-72c7-41ea-b637-842fae2c3d34 folder.  Then restarted eM Client and tadaaaaaaa.  Not only did I have all my archives back, also all my accounts and preferences were back.  It just had to download the unarchived emails from the IMAP server again.

Super easy!!  I guess I got lucky that the corrupted database was the one with my online emails and not the one with my offline emails.

I hope that my reply helps some people.

 I do have to give a big remark though.  I also contacted your customer support via email.  After a bit of conversation I got the following response from one of your colleagues:  "Well, from the log it is clear that the database got corrupted by 3rd party application thus I cannot provide you with any solution, I am very sorry. "  And that was it!!  I must say that this was the worst response ever!!  People with a crashed DB are desperate.  What he was basically saying was, it crashed because of another application so it’s not our fault, live with it and leave us alone.  And this while the solution that I found was this simple???

I hope your colleague gets heavily reprimanded.  He damaged your company’s reputation horribly!!  I have backed up my emails and I will migrate to another email client this weekend.  Because of him!!  Because I am not confident that I will get the necessary support if anything happens again in the future.

Best regards,
Steven

Hello Roopesh,

Did you change the database location recently? You can rename the database file and start eM Client with the new database. You will find the location in Menu > Tools > Settings > Storage and you need to enable displaying hidden folders. Please close eM Client before making any changes to the database.

Regards,
Russel 

Hello Russel,

Thanks for the quick reply
I actually deleted the old file and installed the emclient once again. Now its working fine but how can i pull back the old emails to inbox and also from the sent items.
Could you suggest on that?

Regards
Roopesh

Hello Roopesh,

Are the emails stored on your server? If yes they should be pulled to eM Client automatically.

Or if you have a backup file available, you can restore the data from that. You will find the restore feature in Menu > File > Restore.

Regards,
Russel

Hello Russel,

I used to use windows Live mail for couple of months and now i have shifted to emclient i need to know how can i pull the emails(from inbox and sent items) to emclient
Secondly my earlier version was emclient 6 and unfortunately its crashed and was giving me the error message which i shared with you in my earlier threads and i had to delete the file. Is there any possibility to pull the emails from emclient6 (both from inbox and sent items) 
Kindly help

Thanks

Roopesh,

When you go to: Menu > File > Import you will choose Import from eM Client 6. This can be used to import from the older V6 database.

Regards,
Russel

see the screen shot

Hello Roopesh,

I am sorry for the late reply.

You can try this:

  1. Close eM Client
  2. Locate the old V6 database
  3. Copy the requested folders to the currently used database
    Please note that eM Client must be closed while making any changes to the database folders because otherwise another crash might corrupt the database again.

If the database doesn’t work because of different type, I would recommend creating a blank install of eM Client V6 on another computer, following the steps and exporting all emails into .eml files to import them to the V7.

Regards,
Russel

I’m having somewhat of a similar issue.  It started with a corrupt database, but following the steps to remove the database didn’t help.  Now eM client completely fails to start.  I’ve tried renaming database folders, uninstalling and reinstalling, but it still fails to launch.  I’ve checked the disk for errors and there are none.  Anyone have any ideas of anything else to try?

Hello,

I ́m from Argentina, so I hope you can apologise me about my english.
Yesterday my emclient had crashed and gives the following error:

System.ApplicationException: database disk image is malformed
database disk image is malformed
Line: 9
DELETE FROM mail_index.MailItems WHERE NOT EXISTS(SELECT id FROM mail_data.LocalMailContents WHERE id=mail_index.MailItems.id LIMIT 1);
   en MailClient.Storage.Data.DbRepository1.ImportFromResource(IDbConnection connection, Stream myStream, CancellationToken token) &nbsp; &nbsp;en MailClient.Storage.Data.DbRepository1.ImportFromManifestResource(String resourceName, CancellationToken token)
   en MailClient.Storage.Data.DbRepository1.Repair(RepairMode mode, CancellationToken token) &nbsp; &nbsp;en MailClient.Accounts.ItemRepositories.Repair(RepairMode mode, CancellationToken token) &nbsp; &nbsp;en DbRepair.ConsistencyChecker.CheckConsistencyForAccount(String accountDirectory, RepairMode mode, CancellationToken token) &nbsp; &nbsp;en DbRepair.ConsistencyChecker.\<\>c\_\_DisplayClass2\_0.<check>b__0(String p)<br> en DbRepair.PerAccountExecutor.Execute(String dataStoreLocation, Func2 action)
en DbRepair.ConsistencyChecker.Check(RepairMode mode, CancellationToken token)
en DbRepair.CheckingProcess.Check(CancellationToken token)
Data:
ResourceName: MailClient.Storage.Mail.Data.DbMailRepository.consistency.sql
DatastoreLocation: C:\Users\jarena\AppData\Roaming\eM Client<br>

Can anybody help me with this issue?..
Thanks very much in advance.

Javier.

If the database is corrupt, and you have no backup then there is not much you can do to recover your local folders.

But IMAP or Exchange folders will be on the server, so there is no problem with those. If that is all you had then just delete the database and start again. Close eM Client, and then rename C:\Users\jarena\AppData\Roaming\eM Client. You may have to show hidden items in Explorer to do that. When you start eM Client again setup your account and your data will sync from the server.

If you had data saved in local folders, that is emails, contacts and calendars that are not synced with the server, what you can try is to start with a new database, then copy the local folders as Steven did above. If those folders were not corrupt, then you may have a chance.

So close eM Client, and then rename C:\Users\jarena\AppData\Roaming\eM Client\ to something else like C:\Users\jarena\AppData\Roaming\eM Client-old. You may have to show hidden items in Explorer to do that.

When you restart eM Client you will have a new blank database. Setup your accounts, and when finished close eM Client. Then copy the C:\Users\jarena\AppData\Roaming\eM Client-old\Local Folders\ directory to the new C:\Users\jarena\AppData\Roaming\eM Client\Local Folders.

Restart eM Client and all the local data should be there. Unfortunately if the error was in the Local Folders, then you may not be able to start eM Client as before.

If you are storing data in local folders, it is advisable to make regular backups. eM Client can do that automatically once you setup Menu > Tools > Settings > General > Backup.

Gary,

Thank you very much for your help!..
I did what you tell me, I renamed the eMClient folder, then I start the eMClient and in the new folder I copy the info I had in the folowwing folder: Archive, Local Folders, Search Folders, and the files wich are in the general eMClient folder.
Then I open the programm again and it ́s started Ok.

Thanks you very much…regards.
Javier

Well this thread is certainly making me re-think my plan to migrate my team to this app.  Especially the post including the reply a user got from tech support.  Database corruption is a serious issue, and in this day and age, not acceptable.  At least when I use GMail I don’t have to worry about such nonsense.

Glad I stumbled on this thread.  I will be watching to see what the company has to say.

As an aside, I’ve been using eM Client for 5+ years and I have never had any corruption issues.  While it might look like a constant problem, there are 1 million users out there (according to EMC), so it really seems to be a relatively rare event.

That being said, all databases are subject to corruption and it is important that the database is backed up (eM Client has a good automated tool for this).  The good news is that most accounts synchronize, so even if the database is corrupt and there is no backup, no data is typically lost (just settings, etc. but no messages) and all a user has to do is create a new database and resynchronize.

Good point!  (except the “all databases” part ;-))  I get what you’re saying, just not sure I buy the marketing claim of over a million users.  I tend to think that a product with that size user base would have a structure in place to handle such a drastic issue, regardless of how rare it might seem.  By “structure” I mean both software tech and support.  Just IMHO and I’m new and just evaluating, so my $0.02 is clearly worth a nickel less!

I forgot to mention that there is a database repair tool, which I have not tried, but seems to cure many issues.

Also, I can say that there pro support has been very good.  They are responsive and their solutions typically are effective. So your not stuck with us if you decide to purchase.

eM Client has a great support structure for Pro License users, and a dedicated development team. I have actually been amazed at how quickly they respond to bugs I have logged, and the fixes appearing in the development builds. 

A lot of work was done recently to change the way eM Client deals with corrupt databases, and I think it is becoming even less common to see comments about that with the improved versions of the application. As Jay said, he has not had any corruption issues, and on my work computer I have not had any either. Trying to create a corrupt database on a test machine proved very difficult.