{"record":{"id":"b5e99b868197b3f0","repo":"tursodatabase/turso","slug":"remote-request-returned-no-results","errorCode":null,"errorMessage":"Remote request returned no results.","messagePattern":"Remote request returned no results\\.","errorType":"exception","errorClass":"TursoException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs","lineNumber":219,"sourceCode":"                statement.Args.Add(value);\n            }\n            else\n            {\n                statement.NamedArgs.Add(new RemoteNamedArg\n                {\n                    Name = parameter.ParameterName,\n                    Value = value,\n                });\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}\");","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs#L201-L237","documentation":"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.","triggerScenarios":"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\":[]}).","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    return await cmd.ExecuteReaderAsync(cancellationToken);\n}\ncatch (TursoException ex) when (ex.Message.Contains(\"returned no results\"))\n{\n    logger.LogError(ex, \"Empty results envelope from server for {Sql}\", cmd.CommandText);\n    throw; // protocol violation: retrying the identical call rarely helps\n}","preventionTips":["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."],"tags":["turso","dotnet","remote","protocol","pipeline"],"backgroundTag":"empty-results-array","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}