tursodatabase/turso · error · TursoException
Remote request returned no results.
Error message
Remote request returned no results.
What it means
After a successful HTTP round trip and JSON parse, the pipeline response contained zero entries in its results array. The pipeline protocol guarantees at least one result entry per submitted request; ExtractExecuteResult enforces this for single-statement execution, so the server (or something between you and it) returned a syntactically valid but empty response envelope.
Source
Thrown at bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs:219
statement.Args.Add(value);
}
else
{
statement.NamedArgs.Add(new RemoteNamedArg
{
Name = parameter.ParameterName,
Value = value,
});
}
}
return statement;
}
private static RemoteStatementResult ExtractExecuteResult(RemotePipelineResponse response)
{
if (response.Results.Count == 0)
throw new TursoException("Remote request returned no results.");
var result = response.Results[0];
RemoteStatementResult statementResult;
switch (result.Type)
{
case "ok":
if (result.Response is null)
throw new TursoException("Remote request returned an empty ok response.");
if (result.Response.Type != "execute")
throw new TursoException($"Remote request returned unexpected response type: {result.Response.Type}");
statementResult = result.Response.DeserializeResult<RemoteStatementResult>();
break;
case "error":
throw CreateRemoteError(result.Error);
default:
throw new TursoException($"Remote request returned unexpected result type: {result.Type}");View on GitHub (pinned to 244cde92a7)
Solutions
- Capture the raw response for the failing statement by reproducing the pipeline POST with curl, and confirm the results array is actually empty.
- Compare server and Turso.Data binding versions and upgrade whichever is behind.
- Remove or fix any gateway/proxy that parses and re-emits response JSON on the pipeline route.
- Run the same statement against a known-good instance (for example a cloud database) to isolate server versus environment.
- If it reproduces against a current server, report it with the exact request body and raw envelope.
Defensive patterns
Strategy: try-catch
Try / catch
try
{
return await cmd.ExecuteReaderAsync(cancellationToken);
}
catch (TursoException ex) when (ex.Message.Contains("returned no results"))
{
logger.LogError(ex, "Empty results envelope from server for {Sql}", cmd.CommandText);
throw; // protocol violation: retrying the identical call rarely helps
} Prevention
- Run a SELECT 1 smoke test immediately after OpenAsync to catch protocol-level breakage early.
- Keep server and bindings on matching versions.
- Keep the client-to-server path free of intermediaries that parse and re-emit response JSON.
- Log the exact SQL when this fires -- empty envelopes often correlate with specific statement shapes.
When it happens
Trigger: TursoCommand.ExecuteReader/ExecuteNonQuery/ExecuteScalar on a connection whose Url is remote: ExecuteAsync builds a one-request pipeline, the response parses, but response.Results.Count == 0 (for example the server replied {"baton":"...","results":[]}).
Common situations: Version mismatch where an older server ignores /v2/pipeline request bodies; a gateway that re-serializes JSON and drops the results field (it then defaults to an empty list); a server bug for specific statement shapes; middleware stripping fields it does not recognize.
Related errors
- Remote batch returned no results.
- Remote request returned an empty response.
- Remote request returned an empty ok response.
- Remote request returned unexpected response type: {result.Re
- Remote request returned unexpected result type: {result.Type
AI-assisted analysis of tursodatabase/turso@244cde92a7 (2026-08-20).
Data as JSON: /api/errors/b5e99b868197b3f0.
Report an issue: GitHub.