Crash wipes backup

This is third time this has happened on my PC:

  • The PC crashes (Win7 x64 Pro)
  • Upon reboot, WhatPulse has no valid database. It reports “Something really bad happened to the database and the backup database. The only way to recover is to create a new database”
  • The actual database and it’s backup are 3.136KBytes of nothing but zeroes.

Here is the last from the log:
22-03-2014 20:11:27.497 DEBUG Starting backup of database to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup”
22-03-2014 20:11:27.596 DEBUG Created database backup in 100 ms “(1718 pages)”
22-03-2014 20:16:28.552 DEBUG Applications successfully uploaded: “Processed 1 application(s)”
22-03-2014 20:26:27.496 DEBUG Starting backup of database to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup”
22-03-2014 20:26:27.617 DEBUG Created database backup in 121 ms “(1722 pages)”
22-03-2014 20:41:27.499 DEBUG Starting backup of database to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup”
22-03-2014 20:41:27.582 DEBUG Created database backup in 83 ms “(1722 pages)”
22-03-2014 20:56:27.501 DEBUG Starting backup of database to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup”
22-03-2014 20:56:27.621 DEBUG Created database backup in 120 ms “(1722 pages)”
22-03-2014 21:11:27.500 DEBUG Starting backup of database to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup”
22-03-2014 21:11:27.588 DEBUG Created database backup in 88 ms “(1723 pages)”
22-03-2014 21:26:27.500 DEBUG Starting backup of database to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup”
22-03-2014 21:26:27.592 DEBUG Created database backup in 92 ms “(1726 pages)”
22-03-2014 21:41:27.502 DEBUG Starting backup of database to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup”
22-03-2014 21:41:27.597 DEBUG Created database backup in 95 ms “(1726 pages)”
22-03-2014 21:56:27.502 DEBUG Starting backup of database to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup”
22-03-2014 21:56:27.579 DEBUG Created database backup in 77 ms “(1733 pages)”
22-03-2014 22:07:57.608 DEBUG Detected system suspend!
22-03-2014 22:07:57.608 DEBUG enableInputHook: false
22-03-2014 22:07:57.608 DEBUG LowLevelHookHandler stopping
23-03-2014 08:23:54.513 DEBUG Starting backup of database to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup”
23-03-2014 08:25:23.776 INFO “Starting WhatPulse 2.3.1…”
23-03-2014 08:25:23.890 DEBUG Installed CrashRpt!
23-03-2014 08:25:24.414 DEBUG Database file: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db”
23-03-2014 08:25:24.490 DEBUG Database check: “*** in database main ***
Main freelist: freelist leaf count too big on page 1731
On tree page 1477 cell 5: Rowid 143403 out of order (max larger than parent min of 143368)
On tree page 1478 cell 12: Rowid 143416 out of order (max larger than parent max of 143380)
On tree page 13 cell 2: 2nd reference to page 1737
On tree page 13 cell 2: Child page depth differs”
23-03-2014 08:25:24.502 DEBUG Database integrity check: “*** in database main ***
Main freelist: freelist leaf count too big on page 1731
On tree page 1477 cell 5: Rowid 143403 out of order (max larger than parent min of 143368)
On tree page 1478 cell 12: Rowid 143416 out of order (max larger than parent max of 143380)
On tree page 13 cell 2: 2nd reference to page 1737
On tree page 13 cell 2: Child page depth differs”
23-03-2014 08:25:24.503 DEBUG Detected a database failure…trying to restore!
23-03-2014 08:25:24.506 DEBUG Copied: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup” to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db”
23-03-2014 08:25:24.507 DEBUG Unable to recover from database backup file!
23-03-2014 08:25:30.999 DEBUG User declined fresh database
23-03-2014 08:25:35.598 DEBUG User declined fresh database
23-03-2014 08:25:35.598 FATAL Unable to open database: failed database integrity check ( “file is encrypted or is not a database Unable to execute statement” )
23-03-2014 08:25:54.712 INFO “Starting WhatPulse 2.3.1…”
23-03-2014 08:25:54.738 DEBUG Installed CrashRpt!
23-03-2014 08:25:54.962 DEBUG Database file: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db”
23-03-2014 08:25:54.963 DEBUG Detected a database failure…trying to restore!
23-03-2014 08:25:54.966 DEBUG Copied: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db.backup” to: “C:/Users/bork/AppData/Local/WhatPulse/whatpulse.db”
23-03-2014 08:25:54.966 DEBUG Unable to recover from database backup file!
23-03-2014 08:25:57.803 DEBUG User declined fresh database
23-03-2014 08:25:58.478 DEBUG User declined fresh database
23-03-2014 08:25:58.478 FATAL Unable to open database: failed database integrity check ( “file is encrypted or is not a database Unable to execute statement” )

If my guess that 23-03-2014 08:23:54.513 is right before the crash, is right…your Windows has some terrible timing…

Your system appears to have crashed during the database backup, corrupting the real database and the backup file. There’s nothing you can do about that, besides making a manual backup of either the current or backup database file yourself.

Seems self evident, but try not to have Windows crash that much…

If you are using Windows 7 or 8, right click on the database file and go to properties, Click on the previous versions tab and check if there is any version and restore. The same thing happened to me today and I was lucky that there was a backup made 4 hours ago. So try your luck :slight_smile: