tursodatabase/turso · error · TursoException
Remote batch did not return a result for step {i}.
Error message
Remote batch did not return a result for step {i}. What it means
Inside a batch result, a step had neither an error nor a result: step_errors[i] and step_results[i] were both null. The protocol requires exactly one of the two per step, so the server omitted the outcome for statement i.
Source
Thrown at bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs:315
private static List<RemoteStatementResult> ExtractBatchStepResults(RemoteBatchResult batch, int expectedCount)
{
if (batch.StepErrors.Count != expectedCount || batch.StepResults.Count != expectedCount)
{
throw new TursoException(
$"Remote batch returned an unexpected result shape: {batch.StepResults.Count} results, {batch.StepErrors.Count} errors, expected {expectedCount}.");
}
for (var i = 0; i < batch.StepErrors.Count; i++)
{
if (batch.StepErrors[i] is { } error)
throw CreateRemoteError(error);
}
var statementResults = new List<RemoteStatementResult>(expectedCount);
for (var i = 0; i < batch.StepResults.Count; i++)
{
var stepResult = batch.StepResults[i]
?? throw new TursoException($"Remote batch did not return a result for step {i}.");
statementResults.Add(stepResult);
}
return statementResults;
}
private static void ValidateCloseResult(RemotePipelineResponse response)
{
foreach (var result in response.Results)
{
switch (result.Type)
{
case "ok":
if (result.Response?.Type is not "close")
throw new TursoException($"Remote close returned unexpected response type: {result.Response?.Type}");
break;
case "error":View on GitHub (pinned to 244cde92a7)
Solutions
- Identify which step index fails (the message includes i) and map it back to the TursoBatchCommand at that position; simplify that statement to find the trigger.
- Run the failing statement as a standalone command to see whether it produces a normal result outside a batch.
- Align server and bindings versions.
- If it reproduces on current versions, report the batch and the missing step index.
Defensive patterns
Strategy: try-catch
Try / catch
try { return await batch.ExecuteReaderAsync(cancellationToken); }
catch (TursoException ex) when (ex.Message.Contains("did not return a result for step"))
{
logger.LogError(ex, "Batch step missing a result; message names the step index");
throw;
} Prevention
- Map the failing step index from the message back to the TursoBatchCommand and simplify that statement to find the trigger.
- Run suspicious statements standalone before putting them in batches.
- Keep server and bindings versions aligned.
- Report reproducible cases with the exact batch contents.
When it happens
Trigger: TursoBatch execution where the counts match but a specific step i has a null entry in step_results while its step_errors slot is also null.
Common situations: Server bugs that skip result materialization for certain statements (for example DDL or empty SQL inside a batch); schema drift between server and bindings; intermediaries nulling out fields.
Related errors
- Remote batch returned no results.
- Remote batch returned an unexpected result shape: {batch.Ste
- Remote request returned no results.
- Remote request returned an empty ok response.
- Remote request returned unexpected response type: {result.Re
AI-assisted analysis of tursodatabase/turso@244cde92a7 (2026-08-20).
Data as JSON: /api/errors/90ade0e7085f3651.
Report an issue: GitHub.