Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Simultaneous corruption of source and target database during sync

wellread1
2013-02-25
2013-03-02
  • wellread1
    wellread1
    2013-02-25

    In recent months I have observed two instances of database corruption occurring during synchronization. In each case a local (source database) and network (sync target database) were simultaneously corrupted. The cases occurred on independent, physically remote installations, with entirely different databases. The corruption is rare, and seems to occur during events where KeePass normally executes flawlessly. Following is a description of the circumstances that are common to both instances of database corruption.

    Setup:

    1. KeePass 2.20.1 (known in one case, probable version in the other case, but possibly an earlier version)
    2. Client computer containing local database: Win 7 Home edition x64
    3. Network Computer containing sync target database: Windows Home Server 2011
    4. One case the client computer was hardwired to the network, in the other the case, the client was connected over Wifi.

    Sync trigger:

    1. Events: Closing database file (before saving): Contains {DB_NAME}
    2. Conditions
      a. Remote HOST is reachable (ping) Host: servername
      b. File exists: \\servername\path\{DB_BASENAME}_central.kdbx
      c. String: NOT, {DB_PATH}, Starts with: \\servername
    3. Actions: Synchronize active database with a file/URL: File/URL: \\servername\path\{DB_BASENAME}_central.kdbx

    It is likely that corruption occurred when the trigger was activated by a reboot while the database was unlocked. My risk of data loss is small since both installations are backed-up regularly , but users who use sync as a form of backup could be at a higher risk.

    In my mind, the notable feature of this error is that both source and target database are corrupted. This suggests that the corruption event occurred prior to saving either database, and corrupted databases were saved. This distinct from corruption occurring as a result of an interrupted save.

     
  • Paul
    Paul
    2013-03-02

    Did the corruption result in an unusable database or just an entry or two?
    Did it change the database size significantly?

    cheers, Paul

     
  • wellread1
    wellread1
    2013-03-02

    The databases were unusable. I did not check file size before I overwrote the corrupt versions.

    Going forward I am running a test database alongside my production database. If the corruption happens again I'll be able to provide a sample database. However, the corruption event is very rare.