How do I handle error '(7054-323-317) Unable to restore databases since backup does not exist'?

Description of Problem

When running an Urchin profile, you get the following messages:

(7050-323-317) Starting automatic rollback +
(7054-323 317) Unable to restore databases since backup does not exist.

Cause

This error may result if a previous run of this Urchin Profile was terminated abnormally. This can happen if the "Stop Task" button was clicked when running a Profile with the Run Now button, or if the task was killed by a system administrator, or perhaps due to a system reboot. Ordinarily, Urchin is able to recover gracefully from an abnormal termination by rolling back to the last known good state of the Profile; however, if the profile processing was terminated on the first run of a profile (or the first run for a month), there will be no backup file to roll back to. At this point, Urchin issues the "Unable to restore databases" error.

On a more technical level, the Urchin log processing engine creates a lock.udb file in the reporting directory for the profile it is currently processing. It keeps this file locked while processing to ensure that only one instance of the log processing engine can run for the profile at any given time. At startup time, the log processing engine checks for the existence of the lock.udb file. If the file is present, the log processing engine checks for current locks. If none are found, then the previous run of the profile failed, so the log processing engine attempts to rollback the profile's databases to the last known good state before proceeding. As noted above, if the rollback archive does not exist, the rollback error messages are printed and the log processing terminates.

Remedy

Due to the fact that the previous run of Urchin terminated abnormally, the Urchin databases for the month being processed are in an unknown state and the data contained in them was not properly checkpointed. Therefore, the data for the entire month being processed will need to be removed. In most cases, the only Urchin data for the month will be that created during the failed processing run, so no good data exists anyway.

Please use the following procedure to reset the Urchin profile data and allow you to continue running the profile:

Windows Systems

  1. Start a DOS Shell (Start -> Run -> "cmd")
  2. Change directory to the folder where Urchin profile data is stored, usually
    C:\Program Files\Urchin\data\reports\profilename
  3. View the contents of the lock.udb file with the command "TYPE lock.udb". There should be one or more lines consisting of YYYYMM date entries, e.g. 200408.
  4. For each YYYYMM line the in lock.udb file, perform the following steps:
    • Remove the corresponding monthly Urchin databases with the command "DEL YYYYMM-*data*"
    • Check to see if a backup archive exists for the corresponding month using the command "DIR YYYYMM*backup*.zip". The backup archives are named YYYYMM-backup-YYYYMMDDHHMMSS.zip, e.g. 200408-backup-20040831103340.zip.
    • If one or more backup file exists for that month, restore the data from the backup archive with latest timestamp using the command "..\..\..\util\unzip -o -u backupfile.zip", e.g. "..\..\..\util\unzip -o -u 200408-backup-20040831103340.zip"
  5. Remove the lock.udb file with the command "DEL lock.udb"
  6. You can now run the profile again with the Run Now button

UNIX-type Systems

  1. Start a command shell either as "root" or the user that Urchin runs as
  2. Change directory to the location where the Urchin profile data is kept - e.g.
    "cd /usr/local/urchin/data/reports/profilename"
  3. View the contents of the lock.udb file with the command "cat lock.udb". There should be one or more lines consisting of YYYYMM date entries, e.g. 200408.
  4. For each YYYYMM line the in lock.udb, perform the following steps:
    • Remove the corresponding monthly Urchin databases with the command "rm YYYYMM-*data*"
    • Check to see if a backup archive exists for the corresponding month using the command
      "ls YYYYMM*backup*.zip". The backup archives are named YYYYMM-backup-YYYYMMDDHHMMSS.zip, e.g. 200408-backup-20040831103340.zip.
    • If one or more backup file exists for that month, restore the data from the backup archive with latest timestamp using the command "../../../util/unzip -o -u backupfile.zip", e.g. "../../../util/unzip -o -u 200408-backup-20040831103340.zip"
  5. Remove the lock.udb file with the command "rm lock.udb"
  6. You can now run the profile again with the Run Now button