tursodatabase/turso · error · TursoException

Remote request returned an empty ok response.

Error message

Remote request returned an empty ok response.

What it means

The first pipeline result entry said type:"ok" but carried no nested response object. For a single execute request the client expects ok plus {type:"execute", result:{...}}; a missing response field means the server acknowledged the request without its payload, which is a malformed reply under the pipeline protocol.

Source

Thrown at bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs:227

                });
            }
        }

        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}");
        }

        ValidateOptionalTrailingClose(response, "Remote request");
        return statementResult;
    }

    private static IReadOnlyList<RemoteStatementResult> ExtractBatchResults(RemotePipelineResponse response, int expectedCount)
    {

View on GitHub (pinned to 244cde92a7)

Solutions

  1. Inspect the raw JSON envelope for the failing call (curl the same pipeline request) to confirm the response field is missing.
  2. Eliminate JSON-rewriting intermediaries between client and server.
  3. Align server and Turso.Data binding versions, then retest.
  4. Reproduce against a known-good instance to determine whether the server genuinely omits the field.
  5. File an issue with the raw envelope if it persists on current versions.
Defensive patterns

Strategy: try-catch

Try / catch

try { await cmd.ExecuteNonQueryAsync(cancellationToken); }
catch (TursoException ex) when (ex.Message.Contains("empty ok response"))
{
    logger.LogError(ex, "Malformed ok entry from server for {Sql}", cmd.CommandText);
    throw;
}

Prevention

When it happens

Trigger: Single-statement remote execution (any TursoCommand Execute* on a Url connection) where response.Results[0].Type is "ok" and its Response property is null because the JSON entry lacked a "response" field.

Common situations: A proxy or custom serializer strips fields it considers null or unknown; a server bug that omits the response object; a response body cut mid-stream that still happened to parse; protocol drift between server and binding versions.

Related errors


AI-assisted analysis of tursodatabase/turso@244cde92a7 (2026-08-20). Data as JSON: /api/errors/73bd19bfcc1845bb. Report an issue: GitHub.