Recovering from Esent errors


  • RavenDB server side error messages like:
    • Secondary index is corrupt. The database must be defragmented
    • System.InvalidOperationException: Could not open transactional storage


An error in Esent's file.


Run Esent Utility for recovering from errors. There are two approaches to recover a corrupted database:

  • Recovery - a loss-less operation that tries to recover the Esent file (esentutl /r RVN /l logs /s system)
  • Repair - a more aggressive approach that may cause data loss (esentutl /p Data)

In both cases, at the end, the defragmentation should be performed (esentutl /d Data)

Equivalent options for a file system:

  • Recovery - esentutl /r RFS /l logs /s system
  • Repair - esentutl /p Data.ravenfs
  • Defragment - esentutl /d Data.ravenfs

Further read: