earendil-works/pi · error · SessionError

not_found

not_found

Error message

Session not found: ${sessionId}

What it means

Error "Session not found: ${sessionId}" thrown in earendil-works/pi.

Source

Thrown at packages/session-backends/sqlite-node/src/sqlite/repo.ts:329

function matchesEntryQuery(entry: Entry, query: EntryQuery): boolean {
	return (
		(query.type === undefined || entry.type === query.type) &&
		(query.customType === undefined || (entry.type === "custom" && entry.customType === query.customType)) &&
		(query.cursor === undefined ||
			(query.order === "oldestFirst" ? entry.seq > query.cursor.afterSeq : entry.seq < query.cursor.afterSeq))
	);
}

function assertUnusedId(db: SqliteDatabase, sessionId: string, id: string): void {
	if (idExistsInEntries(db, sessionId, id) || idExistsInRecords(db, sessionId, id)) {
		throw new SessionError("already_exists", `ID already exists: ${id}`);
	}
}

function requireSessionRow(db: SqliteDatabase, sessionId: string): SessionRow {
	const row = readSessionRow(db, sessionId);
	if (!row) throw new SessionError("not_found", `Session not found: ${sessionId}`);
	return row;
}

class SqliteSessionStorage implements SessionStorage<SqliteSessionMetadata> {
	private readonly db: SqliteDatabase;
	private readonly metadata: SqliteSessionMetadata;
	private readonly lease: WriterLease;
	private readonly leaseOptions: ResolvedWriterLeaseOptions;
	private readonly onRelease: () => void;
	private readonly operations = new SerialOperationQueue();
	private heartbeatTimer: ReturnType<typeof setTimeout> | undefined;
	private leaseError: SessionError | undefined;
	private closing = false;
	private releasePromise: Promise<void> | undefined;

	constructor(
		db: SqliteDatabase,
		metadata: SqliteSessionMetadata,

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. The session id does not exist; create the session or verify the id.

When it happens

Trigger: Thrown at packages/session-backends/sqlite-node/src/sqlite/repo.ts:329 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/6433aa7245cedd06. Report an issue: GitHub.