microsoft/FASTER · error · Exception
Unable to find session
Error message
Unable to find session {sessionID} to recover What it means
After resuming a session by ID, FASTER checks the returned commit point: UntilSerialNo == -1 means InternalContinue found no durable checkpoint state for that session ID. The library then rejects the resume because there is nothing to recover.
Solutions
- Verify the session ID was captured from a checkpointed session and is present in the current recovery info.
- Resume by session name instead of numeric ID to avoid stale-ID mismatches.
- Fall back to NewSession if the ID no longer exists in recovery info.
- Avoid resuming the same session ID more than once.
Example fix
// before
var session = fht.ResumeSessionById<Functions>(functions, staleId, out var cp);
// after
try
{
var session = fht.ResumeSessionById<Functions>(functions, staleId, out var cp);
}
catch (FasterException)
{
var session = fht.NewSession<Functions>(functions);
} Defensive patterns
Strategy: try-catch
Try / catch
try
{
session = fht.ResumeSessionById<Functions>(functions, sessionId, out var cp);
}
catch (FasterException ex) when (ex.Message.Contains("Unable to find session"))
{
session = fht.NewSession<Functions>(functions); // fall back to fresh session
} Prevention
- Prefer name-based resume over raw numeric session IDs.
- Persist session IDs together with the checkpoint they belong to.
- Never reuse a session ID across recoveries.
When it happens
Trigger: Calling ResumeSession/ResumeSessionById with a sessionID that was never checkpointed or whose recovery info was already consumed (UntilSerialNo == -1 returned from InternalContinue).
Common situations: Resuming by stale numeric session IDs from a previous process after the checkpoint set changed; double-resume of the same session ID; recovering a store whose checkpoint predates the session.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Session named already exists in recovery info, use…
- Unable to find session named
- Unexpected entry type
- Unable to set first valid segment to
- Unable to set last valid segment to
AI-assisted analysis of microsoft/FASTER@321d872eab (2026-09-15).
Data as JSON: /api/errors/c1240944593572ef.
Report an issue: GitHub.
Appendix: source
Thrown at cs/src/core/ClientSession/FASTERClientSession.cs:273
internal ClientSession<Key, Value, Input, Output, Context, Functions> ResumeSession<Input, Output, Context, Functions>(Functions functions, int sessionID, out CommitPoint commitPoint,
SessionVariableLengthStructSettings<Value, Input> sessionVariableLengthStructSettings = null, ReadCopyOptions readCopyOptions = default)
where Functions : IFunctions<Key, Value, Input, Output, Context>
{
return InternalResumeSession<Input, Output, Context, Functions, ClientSession<Key, Value, Input, Output, Context, Functions>>(functions, sessionID, out commitPoint,
ctx => new ClientSession<Key, Value, Input, Output, Context, Functions>(this, ctx, functions, sessionVariableLengthStructSettings), readCopyOptions);
}
private TSession InternalResumeSession<Input, Output, Context, Functions, TSession>(Functions functions, int sessionID, out CommitPoint commitPoint,
Func<FasterExecutionContext<Input, Output, Context>, TSession> sessionCreator, ReadCopyOptions readCopyOptions)
where TSession : IClientSession
{
if (functions == null)
throw new ArgumentNullException(nameof(functions));
string sessionName;
(sessionName, commitPoint) = InternalContinue<Input, Output, Context>(sessionID, out var ctx);
if (commitPoint.UntilSerialNo == -1)
throw new Exception($"Unable to find session {sessionID} to recover");
ctx.MergeReadCopyOptions(this.ReadCopyOptions, readCopyOptions);
var session = sessionCreator(ctx);
if (_activeSessions == null)
Interlocked.CompareExchange(ref _activeSessions, new Dictionary<int, SessionInfo>(), null);
lock (_activeSessions)
_activeSessions.Add(sessionID, new SessionInfo { sessionName = sessionName, session = session, isActive = true });
return session;
}
/// <summary>
/// Dispose session with FASTER
/// </summary>
/// <param name="sessionID"></param>
/// <param name="sessionPhase"></param>
/// <returns></returns>
internal void DisposeClientSession(int sessionID, Phase sessionPhase)View on GitHub (pinned to 321d872eab)