{"record":{"id":"73bd19bfcc1845bb","repo":"tursodatabase/turso","slug":"remote-request-returned-an-empty-ok-response","errorCode":null,"errorMessage":"Remote request returned an empty ok response.","messagePattern":"Remote request returned an empty ok response\\.","errorType":"exception","errorClass":"TursoException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs","lineNumber":227,"sourceCode":"                });\n            }\n        }\n\n        return statement;\n    }\n\n    private static RemoteStatementResult ExtractExecuteResult(RemotePipelineResponse response)\n    {\n        if (response.Results.Count == 0)\n            throw new TursoException(\"Remote request returned no results.\");\n\n        var result = response.Results[0];\n        RemoteStatementResult statementResult;\n        switch (result.Type)\n        {\n            case \"ok\":\n                if (result.Response is null)\n                    throw new TursoException(\"Remote request returned an empty ok response.\");\n                if (result.Response.Type != \"execute\")\n                    throw new TursoException($\"Remote request returned unexpected response type: {result.Response.Type}\");\n                statementResult = result.Response.DeserializeResult<RemoteStatementResult>();\n                break;\n\n            case \"error\":\n                throw CreateRemoteError(result.Error);\n\n            default:\n                throw new TursoException($\"Remote request returned unexpected result type: {result.Type}\");\n        }\n\n        ValidateOptionalTrailingClose(response, \"Remote request\");\n        return statementResult;\n    }\n\n    private static IReadOnlyList<RemoteStatementResult> ExtractBatchResults(RemotePipelineResponse response, int expectedCount)\n    {","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs#L209-L245","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the raw JSON envelope for the failing call (curl the same pipeline request) to confirm the response field is missing.","Eliminate JSON-rewriting intermediaries between client and server.","Align server and Turso.Data binding versions, then retest.","Reproduce against a known-good instance to determine whether the server genuinely omits the field.","File an issue with the raw envelope if it persists on current versions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await cmd.ExecuteNonQueryAsync(cancellationToken); }\ncatch (TursoException ex) when (ex.Message.Contains(\"empty ok response\"))\n{\n    logger.LogError(ex, \"Malformed ok entry from server for {Sql}\", cmd.CommandText);\n    throw;\n}","preventionTips":["Avoid JSON re-serializing proxies on the database route.","Version-align server and bindings before rolling out either side.","Add protocol smoke tests to CI for the server build you deploy against.","Capture raw envelopes when integrating a new server version so field drops are caught in testing."],"tags":["turso","dotnet","remote","protocol","json"],"backgroundTag":"missing-response-field","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}