earendil-works/pi · error · SessionError

storage

storage

Error message

Lane ${lane} points at missing open operation ${laneRow.open_operation_id}

What it means

Error "Lane ${lane} points at missing open operation ${laneRow.open_operation_id}" thrown in earendil-works/pi.

Source

Thrown at packages/session-backends/sqlite-node/src/sqlite/storage/records.ts:89

}

export function readOpenOperationRows(
	db: SqliteDatabase,
	sessionId: string,
	lane: string,
	_options: { limit?: number } = {},
): RecordRow[] {
	const laneRow = sql`SELECT open_operation_id FROM lanes WHERE session_id = ${sessionId} AND lane = ${lane}`.get<{
		open_operation_id: string | null;
	}>(db);
	if (!laneRow?.open_operation_id) return [];

	const record = sql`SELECT session_id, seq, id, lane, run_id, type, op_kind, timestamp, payload
		FROM records
		WHERE session_id = ${sessionId}
			AND id = ${laneRow.open_operation_id}`.get<RecordRow>(db);
	if (!record) {
		throw new SessionError("storage", `Lane ${lane} points at missing open operation ${laneRow.open_operation_id}`);
	}
	if (record.lane !== lane || record.type !== "operation_started") {
		throw new SessionError("storage", `Lane ${lane} points at invalid open operation ${laneRow.open_operation_id}`);
	}
	return [record];
}

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. The lane's open operation row is missing; the database is inconsistent, repair or recreate it.

When it happens

Trigger: Thrown at packages/session-backends/sqlite-node/src/sqlite/storage/records.ts:89 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/3802b3674fe60938. Report an issue: GitHub.