Backup for Files - Backup fails due to database disk image is malformed error

Written By Tami Sutcliffe (Super Administrator)

Updated at March 31st, 2021

Problem

The backup fails with an error message similar to the following:

ERROR: 0x30000: Failed to insert folder cache entry: database disk image is malformed

The error can also have a log entry similar to the following:

ERROR: 0x30000: Failed to insert folder cache entry: columns Dir, Filename are not unique

Cause

Our software uses the embedded sqlite database engine, as do other well-known products, such as Firefox. Rare software bugs in sqlite can cause database corruption, but more often corruption is a result of operating system or hardware failures. The sqlite wiki has additional details on causes of corruption.

Resolution

We have created a repair tool that will automatically repair the database.

For Windows systems, follow these steps:

IMPORTANT: Make sure that the backup is not running.

  1. Locate the database file that is causing the error. The location of the file can be determined by looking at the entry in the log immediately preceding the error entry. Note the name of the top-level folder (as would be seen on the Folders page).
  2. Open Windows explorer.

efolder.jpg

3. Download repair-all-sqdb3.bat and unzip it into the folder open in Windows explorer above.
[current location:]

4. Several files should now appear in the folder, including repair-all-sqdb3.bat.

5. Double click repair-all-sqdb3.bat to start the repair process. 

6. Follow the on-screen instructions. It will tell you how to determine if the repair was successful.

7. If it was successful, double click uninstall-repair.bat to remove the repair tool files.

After the backup runs successfully, you can optionally delete the old *.old-corrupt files to save disk space.

For Linux and OSX systems, follow these steps:

  1. IMPORTANT: Make sure that the backup is not running.
  2. Locate the database file that is causing the error. The location of the file can be determined by looking at the entry in the log immediately preceding the error entry. Note the name of the top-level folder (as would be seen on the Folders page in the user interface or in the .conf configuration file).
  3. Open a command prompt terminal.
    1. If the remote backup failed, change the current directory to "/var/yourbrand/folder-cache/(username)/(folder)/.efs.cache"
    2. If the local network backup failed, browse to "/var/yourbrand/folder-cache-local/(username)/(folder)/.efs.cache"
    3. If the local disk backup failed, browse to "(local disk storage path)/folder-cache-disk/(username)/(folder)/.efs.cache"
  4. Download this .tar file and untar it (e.g., tar xzvf repair-sqdb3.tar.gz) into the current directory opened in the command prompt terminal above. 

    Tip: In Linux to download the file at the command prompt use this file:

    Tip: In OSX to download the file at the command prompt use this file: 

  5. Several files should now appear in the current directory, including repair-all-sqdb3.sh.
  6. In the command prompt, run repair-all-sqdb3.sh to start the repair process (e.g., bash ./repair-all-sqdb3.sh).
  7. Follow the on-screen instructions. It will tell you how to determine if the repair was successful.
  8. If it was successful, run ./uninstall-repair.sh to remove the repair tool files.
  9. After the backup runs successfully, you can optionally delete the old *.old-corrupt files to save disk space.

If you have any questions during this process, please contact us.