clockworklabs/SpacetimeDB · error · InvalidOperationException
Reducer result for unknown request_id {reducerResult.Request
Error message
Reducer result for unknown request_id {reducerResult.RequestId} What it means
Every reducer call is tracked client-side in pendingReducerCalls under a request id. When a ReducerResult arrives whose request id is not in that map, the parse thread throws InvalidOperationException. The parse loop's catch-all logs the exception, fails pending operations and disconnects, so users see this as a dropped connection with the message in the log.
Source
Thrown at sdks/csharp/src/SpacetimeDBClient.cs:553
{
try
{
reducerEvent = new(
(DateTimeOffset)reducerResult.Timestamp,
reducerStatus,
Identity ?? throw new InvalidOperationException("Identity not set"),
ConnectionId,
null,
pendingReducer.Reducer);
}
catch (Exception)
{
// The local reducer request still completed; failure here should not block update apply.
}
}
else
{
throw new InvalidOperationException(
$"Reducer result for unknown request_id {reducerResult.RequestId}"
);
}
break;
case ServerMessage.ProcedureResult(var procedureResult):
procedureEvent = new ProcedureEvent(
procedureResult.Timestamp,
procedureResult.Status,
Identity ?? throw new InvalidOperationException("Identity not set"),
ConnectionId,
procedureResult.TotalHostExecutionDuration,
procedureResult.RequestId
);
if (!stats.ProcedureRequestTracker.FinishTrackingRequest(procedureResult.RequestId, unparsed.timestamp))
{
Log.Warn($"Failed to finish tracking procedure request: {procedureResult.RequestId}");
}View on GitHub (pinned to 524b4487d9)
Solutions
- Update the C# SDK to the version matching your server release
- After a disconnect, build a fresh connection via a new builder rather than resuming the old one
- Implement OnDisconnect handling that reconnects with backoff so the desync recovers automatically
- If it reproduces on matched versions, attach full client logs and file a SpacetimeDB issue
Defensive patterns
Strategy: retry
Prevention
- Handle OnDisconnect by rebuilding a fresh connection with backoff
- Do not re-drive a connection object after a network failure; rebuild it
- Run client SDK and server at matched released versions
When it happens
Trigger: Server/client desync of the request-id space: a reconnect while the server still had in-flight reducer calls, duplicated or replayed ReducerResult delivery, or SDK/server version mismatch changing protocol bookkeeping.
Common situations: Custom reconnect logic re-driving one DbConnection after a network blip; flaky mobile networks causing duplicate frames; preview-channel server against a released SDK.
Related errors
- Invalid procedure signature.
- Received InitialConnection with unexpected identity. Previou
- Received InitialConnection with unexpected connection_id. Pr
- Reducer arguments type {typeof(T).FullName} is not assignabl
- unknown reducerId ${reducerId}
AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16).
Data as JSON: /api/errors/c75ba21fb9911ea6.
Report an issue: GitHub.