microsoft/FASTER · critical · FasterException

Unable to recover from previous commit. Inner exception:

Error message

Unable to recover from previous commit. Inner exception: 

What it means

FasterLogRecoveryInfo.Initialize failed while reading the persisted commit metadata stream (version/cookie/commit num) from the commit manager's recovery file (FasterLogRecoveryInfo.cs:91). The underlying I/O or format exception is wrapped in this FasterException to mark the log unrecoverable from the previous commit.

Solutions

  1. Inspect the inner exception (it is appended to the message) to identify whether it is I/O or format related and fix the underlying cause (permissions, disk, network storage).
  2. Restore the commit metadata (and log) from the last good checkpoint.
  3. Ensure the entire log directory (metadata + device files) is moved/restored atomically as a set.
  4. Do not edit or truncate commit metadata files manually; use FasterLog APIs or delete the whole stale log set and start fresh if data loss is acceptable.

Example fix

// before
var log = new FasterLog(new FasterLogOptions(path)); // throws on corrupt metadata

// after
try { log = new FasterLog(new FasterLogOptions(path)); }
catch (FasterException ex) when (ex.Message.StartsWith("Unable to recover"))
{
    // restore from checkpoint or reinitialize the log directory
}
Defensive patterns

Strategy: try-catch

Try / catch

try { log = new FasterLog(options); } catch (FasterException ex) when (ex.Message.StartsWith("Unable to recover from previous commit")) { RestoreFromCheckpoint(); }

Prevention

When it happens

Trigger: Opening a FasterLog whose commit metadata file is missing bytes, truncated by a crash mid-write, or written in an unreadable format; I/O errors (permissions, disk failure) while reading the recovery info; deserializing a file from a different FasterLog version.

Common situations: Crash or power loss while CommitAsync was flushing metadata; hand-copied or partially synced log directories; committing metadata on one storage medium and reading from a stale replica.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of microsoft/FASTER@321d872eab (2026-09-15). Data as JSON: /api/errors/12bd0e6fad3b67ab. Report an issue: GitHub.

Appendix: source

Thrown at cs/src/core/FasterLog/FasterLogRecoveryInfo.cs:91

        /// <param name="reader"></param>
        public void Initialize(BinaryReader reader)
        {
            int version;
            long checkSum;
            try
            {
                version = reader.ReadInt32();
                checkSum = reader.ReadInt64();
                BeginAddress = reader.ReadInt64();
                UntilAddress = reader.ReadInt64();
                if (version > 0)
                    CommitNum = reader.ReadInt64();
                else
                    CommitNum = -1;
            }
            catch (Exception e)
            {
                throw new FasterException("Unable to recover from previous commit. Inner exception: " + e.ToString());
            }
            if (version < 0 || version > FasterLogRecoveryVersion)
                throw new FasterException("Invalid version found during commit recovery");

            var iteratorCount = 0;
            try
            {
                iteratorCount = reader.ReadInt32();
            }
            catch { }

            if (iteratorCount > 0)
            {
                Iterators = new Dictionary<string, long>();
                for (int i = 0; i < iteratorCount; i++)
                {
                    int len = reader.ReadInt32();
                    byte[] bytes = reader.ReadBytes(len);

View on GitHub (pinned to 321d872eab)