Article: Symptom "NNN errors have been found (see above)."

Symptom / Error message:

When file or database corruption happens, MailStore Home will record and notify you. A common error message of this is the Symptom: NNN errors have been found (see above).

Example (English and German translation):

40 errors have been found (see above).
40 Fehler wurden festgestellt (siehe oben)

What does it mean?

MailStore Home is comparing content of its database records (archived emails within container files) with content it finds/retrieves from the email program or email host, before it determines if an item was already archived or needs to be archived. If it encounters an issue that it can not resolve, it will try to continue its operation but makes a note by counting the errors it encountered. Once completed, it will return this message. So on this symptom, MailStore Home encountered issues with emails and the database records, and counted them to report these.

What is causing these errors, or is the root cause?

The error itself can be caused by defect emails, defect container files (corrupted files within the database) or even something else unexpected inside the database structure files. Corruption of database files can happen by non-exclusive access to the database (e.g. MailStore Home and another program like a virus protection application or backup solution opening and modifying the files). It is important to ensure that the archive database files are exclusively accessed by MailStore Home during its operation. If MailStore Home closes, a backup or virus scan can take place.

Can this be fixed?

If you have this symptom, you can try to export all emails from the archive as EML files, and re-import these EML back into a new archive file. Issue is that defect emails/container files are most likely lost.

How to troubleshoot?

To find out what is causing the error and maybe fix it, you can review the extent by looking at a debug log file:

  1. Make a backup of the current information. Ensure MailStore Home is closed and nothing keeps the database open (like virus protection applications). Before making any changes to files and/or updating the software, ensure that you have a valid or current backup of your data/archive. A backup is explained in the :globe_with_meridians: MailStore Home Help - Backup and Restore

  2. Make a DEBUG-Log file for review
    First we need to generate a DEBUG-LOG file. Sometimes the information it records will get you a clue to what to look for. To create log file please do the following in MailStore Home v9 and up:

    • close the MailStore Home application
    • start > MailStore Home folder > open “MailStore Home - Configuration” (tile, folder)
    • in section “Additional Settings” select as “Start Mode” the ‘Debug’ option instead of ‘Normal’, then [Start] MailStore Home
    • repeat your actions that cause an error (e.g. “Check Data Integrity”, under “Maintenance” in “Administrative Tools”)
    • close MailStore Home
    • the log file should be in the directory “C:\ProgramData\MailStore Home Debug Log” (if C: is your system drive)
    • in case it did not happen automatically please switch the “Start Mode” of MailStore Home back to ‘Normal’ (instead of ‘Debug’)
  3. Use your preferred text editor and open the LOG file.

  4. Glance through or search for error locations (look for EXCEPTION as example). Review the content to see what type of issues you encounter.
    Here is an example:

    11:38:06.135 [10] INFO: Terminal: 27.389 messages are about to be verified.
    12:07:44.796 [10] EXCEPTION: System.Exception: Mail not found.

The characters “#xx.#xxx.#xxx” indicate .Net code information, which you can ignore.
Below is an example of a more clear indication of data corruption going on (I removed some lines for clarity).

   12:08:05.343 [10] EXCEPTION: System.Exception: Mail nicht gefunden.
   12:08:05.343 [10] INFO: Terminal: Message #26916: Mail nicht gefunden.
   12:08:48.632 [10] EXCEPTION: FirebirdSql.Data.FirebirdClient.FbException: internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 228)
          *** Inner Exception ***
          FirebirdSql.Data.Common.IscException: internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 228)

   12:08:48.633 [10] INFO: Terminal: Message #27538: Ein Datenbankfehler ist aufgetreten. Code: 335544333. 
   Details: internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 228)
   12:08:48.636 [10] EXCEPTION: FirebirdSql.Data.FirebirdClient.FbException: invalid statement handle
          *** Inner Exception ***
          FirebirdSql.Data.Common.IscException: invalid statement handle
   12:08:48.636 [10] INFO: Terminal: Message #27539: Ein Datenbankfehler ist aufgetreten. Code:     335544485. Details: invalid statement handle
   12:08:48.638 [10] EXCEPTION: FirebirdSql.Data.FirebirdClient.FbException: invalid statement handle
   bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
   bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader()
          *** Inner Exception ***
          FirebirdSql.Data.Common.IscException: invalid statement handle

How to fix this:

  1. Using the example above, it is clearly some sort of file corruption. The fastest way to fix it is to use a valid backup and restore it.

  2. If you might miss a few emails, and backup is not at hand, and you are fine in loosing some defect emails, export the archive as emails into EML format. Create a new archive location, re-import all EML files and setup a new archiving profile.

  3. Finally a last option: You can try to recover the archived messages from the container files (*.dat).
    For that you need to install MailStore Server. A license is not necessary - you just need the program files.Follow this link for the :globe_with_meridians: MailStore Server Download.

The next steps will be a list to attempt to extract the data directly from the container files.
We make a few assumptions here to have the description work:

  1. MailStore Server is installed at “C:\Program Files (x86)\deepinvent\MailStore Server”
  2. Your server archive is at C:\MailStore\
  3. You have a directory called C:\EML that contains enough space to hold all of your recovered email. This may be somewhat larger than your MailStoreFileGroup size as MailStore compresses and deduplicates messages, this process will create uncompressed message files. The paths used do not need to be on c:\ and you can use mapped drive letters if needed (this is one of the rare cases where MailStore can use mapped drive letters), adjust the instructions as needed.

Step by Step Instructions:

  1. Shut down the MailStore Service.
    See :globe_with_meridians: MailStore Server Help - MailStore Server Service Configuration

  2. Create C:\EML if it doesn’t already exist.

  3. Delete all files in “C:\MailArchive” and its sub-directories but leave the folder structure untouched

  4. Copy all *.dat files from “%userprofile%\My documents\MailStore Home” to C:\MailArchive\DefaultFileGroup\Content\A\AXXX"
    There need to be 999 container files at most in the first folder A000. Please copy “1000.dat” up to “1999.dat” to folder A001 and “2000.dat” up to “2999.dat” to folder A002 and so on.

  5. Copy all *.fdb files from “%userprofile%\My documents\MailStore Home” to “C:\MailArchive”

  6. Open a Windows Command Prompt and enter the following command:

    "C:\Program Files (x86)\deepinvent\MailStore Server\MailStoreServer_x86.exe" /recover /inputDir="C:\MailStore" /outputDir="C:\EML"

    This may take a significant amount of time, and will export all of your archived mail.
    Note: If you run into an issue at this step, create a new conversation, reference this article and your error message/problem.

  7. create a new archive directory for MailStore Home (e.g. via Windows Startmenu -> “All Programs” -> “MailStore Home” -> “MailStore Home - Select Data Directory” -> “Create Archive…”)

  8. In MailStore Home Go to “Archive E-mail” -> Click on “EML and MSG Files” -> Archive from C:\EML, leaving “Include Subfolders” and “Read MailStore Headers” enabled.

It may work and fix it - or not, but there is a possibility you succeed.

Further Reading and Information


How can I find the email in my archive that is shown as MESSAGE ID?

12:08:05.343 [10] EXCEPTION: System.Exception: Mail nicht gefunden.
12:08:05.343 [10] INFO: Terminal: Message #26916: Mail nicht gefunden.

So you get the above information, but you need to find that email with the message #26916.
Use “Quick Search Archive” (not the “Search E-Mail” dialog) and type the following search pattern syntax:

[File Group]:[Message ID] 

Since MailStore Home has only one File Group, this is effectively “1”. The message ID is what you have found. So type in “Quick Search Archive” and hit ENTER


and respectively the same for all the other emails you are looking for.