{"record":{"id":"a75458c8efd86463","repo":"tursodatabase/turso","slug":"remote-batch-returned-no-results","errorCode":null,"errorMessage":"Remote batch returned no results.","messagePattern":"Remote batch returned no results\\.","errorType":"exception","errorClass":"TursoException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs","lineNumber":247,"sourceCode":"                    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    {\n        if (response.Results.Count == 0)\n            throw new TursoException(\"Remote batch returned no results.\");\n\n        var result = response.Results[0];\n        List<RemoteStatementResult> statementResults;\n        switch (result.Type)\n        {\n            case \"ok\":\n                if (result.Response is null)\n                    throw new TursoException(\"Remote batch returned an empty ok response.\");\n                if (result.Response.Type != \"batch\")\n                    throw new TursoException($\"Remote batch returned unexpected response type: {result.Response.Type}\");\n\n                var batch = result.Response.DeserializeResult<RemoteBatchResult>();\n                statementResults = ExtractBatchStepResults(batch, expectedCount);\n                break;\n\n            case \"error\":\n                throw CreateRemoteError(result.Error);\n","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs#L229-L265","documentation":"The batch counterpart of the empty-results check: ExecuteBatchAsync sent a one-request pipeline containing a batch, the response parsed, but the results array was empty. Every pipeline request must be answered with at least one result entry, so this is a malformed reply from the server or an intermediary.","triggerScenarios":"Executing a TursoBatch (with at least one TursoBatchCommand) against a remote-URL connection: ExecuteBatchAsync -> ExtractBatchResults finds response.Results.Count == 0.","commonSituations":"Version mismatch where the server does not implement batch requests and returns an empty envelope; gateways that rebuild response JSON and drop the results field; server bugs specific to batch handling.","solutions":["Reproduce the batch pipeline POST with curl and inspect the raw envelope.","Align server and Turso.Data binding versions, upgrading the older side.","As a diagnostic, run the same statements as individual commands to confirm non-batch execution works.","Remove JSON-rewriting proxies from the path.","Report with the raw request and envelope if it reproduces on current versions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return await batch.ExecuteNonQueryAsync(cancellationToken); }\ncatch (TursoException ex) when (ex.Message.Contains(\"Remote batch returned no results\"))\n{\n    logger.LogError(ex, \"Empty envelope for batch of {Count} commands\", batch.BatchCommands.Count);\n    throw;\n}","preventionTips":["Smoke-test batch execution (two trivial INSERTs in a TursoBatch) when validating a new server version.","Keep bindings and server versions matched; batch support varies across releases.","Keep transforming proxies off the pipeline route.","Confirm plain commands work when debugging batch failures, to isolate the batch path."],"tags":["turso","dotnet","remote","batch","protocol","pipeline"],"backgroundTag":"empty-results-array","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}